Asterisk - The Open Source Telephony Project
18.5.0
|
RTP (Multicast and Unicast) Media Channel. More...
#include "asterisk.h"
#include "asterisk/channel.h"
#include "asterisk/module.h"
#include "asterisk/pbx.h"
#include "asterisk/acl.h"
#include "asterisk/app.h"
#include "asterisk/rtp_engine.h"
#include "asterisk/causes.h"
#include "asterisk/format_cache.h"
#include "asterisk/multicast_rtp.h"
#include "asterisk/dns_core.h"
Go to the source code of this file.
Enumerations | |
enum | { OPT_RTP_CODEC = (1 << 0), OPT_RTP_ENGINE = (1 << 1) } |
enum | { OPT_ARG_RTP_CODEC, OPT_ARG_RTP_ENGINE, OPT_ARG_ARRAY_SIZE } |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static struct ast_format * | derive_format_from_cap (struct ast_format_cap *cap) |
static int | load_module (void) |
Function called when our module is loaded. More... | |
static struct ast_channel * | multicast_rtp_request (const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause) |
Function called when we should prepare to call the multicast destination. More... | |
static int | rtp_call (struct ast_channel *ast, const char *dest, int timeout) |
Function called when we should actually call the destination. More... | |
static int | rtp_hangup (struct ast_channel *ast) |
Function called when we should hang the channel up. More... | |
static struct ast_frame * | rtp_read (struct ast_channel *ast) |
Function called when we should read a frame from the channel. More... | |
static int | rtp_write (struct ast_channel *ast, struct ast_frame *f) |
Function called when we should write a frame to the channel. More... | |
static struct ast_channel * | unicast_rtp_request (const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause) |
Function called when we should prepare to call the unicast destination. More... | |
static int | unload_module (void) |
Function called when our module is unloaded. More... | |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "RTP Media Channel" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_CHANNEL_DRIVER, .requires = "res_rtp_multicast", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_channel_tech | multicast_rtp_tech |
static const struct ast_app_option | unicast_rtp_options [128] = { [ 'c' ] = { .flag = OPT_RTP_CODEC , .arg_index = OPT_ARG_RTP_CODEC + 1 }, [ 'e' ] = { .flag = OPT_RTP_ENGINE , .arg_index = OPT_ARG_RTP_ENGINE + 1 }, } |
static struct ast_channel_tech | unicast_rtp_tech |
RTP (Multicast and Unicast) Media Channel.
Definition in file chan_rtp.c.
anonymous enum |
Enumerator | |
---|---|
OPT_RTP_CODEC | |
OPT_RTP_ENGINE |
Definition at line 249 of file chan_rtp.c.
anonymous enum |
Enumerator | |
---|---|
OPT_ARG_RTP_CODEC | |
OPT_ARG_RTP_ENGINE | |
OPT_ARG_ARRAY_SIZE |
Definition at line 254 of file chan_rtp.c.
|
static |
Definition at line 451 of file chan_rtp.c.
|
static |
Definition at line 451 of file chan_rtp.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 451 of file chan_rtp.c.
|
static |
Definition at line 122 of file chan_rtp.c.
References ast_format_cap_count(), ast_format_cap_get_format(), ast_format_slin, and ast_format_ulaw.
Referenced by multicast_rtp_request(), and unicast_rtp_request().
|
static |
Function called when our module is loaded.
Definition at line 419 of file chan_rtp.c.
References ast_channel_register(), ast_format_cap_alloc, ast_format_cap_append_by_type(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_log, AST_MEDIA_TYPE_UNKNOWN, AST_MODFLAG_LOAD_ORDER, AST_MODPRI_CHANNEL_DRIVER, AST_MODULE_INFO(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_CORE, ASTERISK_GPL_KEY, ast_channel_tech::capabilities, LOG_ERROR, and unload_module().
|
static |
Function called when we should prepare to call the multicast destination.
Definition at line 139 of file chan_rtp.c.
References ao2_cleanup, ao2_ref, args, AST_APP_ARG, AST_CAUSE_FAILURE, ast_channel_alloc, ast_channel_nativeformats_set(), ast_channel_set_rawreadformat(), ast_channel_set_rawwriteformat(), ast_channel_set_readformat(), ast_channel_set_writeformat(), ast_channel_tech_pvt_set(), ast_channel_tech_set(), ast_channel_uniqueid(), ast_channel_unlock, AST_DECLARE_APP_ARGS, ast_format_cap_alloc, ast_format_cap_append, AST_FORMAT_CAP_FLAG_DEFAULT, ast_log, ast_multicast_rtp_create_options(), ast_multicast_rtp_free_options(), ast_multicast_rtp_options_get_format(), AST_NONSTANDARD_APP_ARGS, ast_rtp_instance_destroy(), ast_rtp_instance_new(), ast_rtp_instance_set_channel_id(), ast_rtp_instance_set_remote_address, ast_sockaddr_parse(), ast_sockaddr_setnull(), AST_STATE_DOWN, ast_strdupa, ast_strlen_zero, derive_format_from_cap(), LOG_ERROR, NULL, options, parse(), and PARSE_PORT_REQUIRE.
|
static |
Function called when we should actually call the destination.
Definition at line 101 of file chan_rtp.c.
References ast_channel_tech_pvt(), AST_CONTROL_ANSWER, ast_queue_control(), and ast_rtp_instance_activate().
|
static |
Function called when we should hang the channel up.
Definition at line 111 of file chan_rtp.c.
References ast_channel_tech_pvt(), ast_channel_tech_pvt_set(), ast_rtp_instance_destroy(), and NULL.
|
static |
Function called when we should read a frame from the channel.
Definition at line 79 of file chan_rtp.c.
References ast_channel_fdno(), ast_channel_tech_pvt(), ast_null_frame, and ast_rtp_instance_read().
|
static |
Function called when we should write a frame to the channel.
Definition at line 93 of file chan_rtp.c.
References ast_channel_tech_pvt(), and ast_rtp_instance_write().
|
static |
Function called when we should prepare to call the unicast destination.
Definition at line 269 of file chan_rtp.c.
References ao2_cleanup, ao2_ref, args, AST_APP_ARG, ast_app_parse_options(), AST_CAUSE_FAILURE, ast_channel_alloc, ast_channel_nativeformats_set(), ast_channel_set_fd(), ast_channel_set_rawreadformat(), ast_channel_set_rawwriteformat(), ast_channel_set_readformat(), ast_channel_set_writeformat(), ast_channel_tech_pvt_set(), ast_channel_tech_set(), ast_channel_uniqueid(), ast_channel_unlock, AST_DECLARE_APP_ARGS, ast_dns_resolve_ipv6_and_ipv4(), ast_format_cache_get, ast_format_cap_alloc, ast_format_cap_append, AST_FORMAT_CAP_FLAG_DEFAULT, ast_log, AST_NONSTANDARD_APP_ARGS, ast_ouraddrfor(), ast_rtp_instance_destroy(), ast_rtp_instance_fd(), ast_rtp_instance_get_local_address(), ast_rtp_instance_new(), ast_rtp_instance_set_channel_id(), ast_rtp_instance_set_remote_address, ast_sockaddr_copy(), ast_sockaddr_parse(), ast_sockaddr_split_hostport(), ast_sockaddr_stringify_addr(), ast_sockaddr_stringify_port(), AST_STATE_DOWN, ast_strdupa, ast_strlen_zero, ast_test_flag, derive_format_from_cap(), host, LOG_ERROR, NULL, OPT_ARG_ARRAY_SIZE, OPT_ARG_RTP_CODEC, OPT_ARG_RTP_ENGINE, OPT_RTP_CODEC, OPT_RTP_ENGINE, options, parse(), PARSE_PORT_REQUIRE, pbx_builtin_setvar_helper(), S_COR, S_OR, and unicast_rtp_options.
|
static |
Function called when our module is unloaded.
Definition at line 405 of file chan_rtp.c.
References ao2_cleanup, ast_channel_unregister(), ast_channel_tech::capabilities, and NULL.
Referenced by load_module().
|
static |
Definition at line 451 of file chan_rtp.c.
|
static |
Definition at line 451 of file chan_rtp.c.
|
static |
Definition at line 57 of file chan_rtp.c.
|
static |
Definition at line 266 of file chan_rtp.c.
Referenced by unicast_rtp_request().
|
static |
Definition at line 68 of file chan_rtp.c.