|
Asterisk - The Open Source Telephony Project GIT-master-35be64c
|
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/conversions.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) , OPT_RTP_GLUE = (1 << 2) , OPT_RTP_PAYLOAD = (1 << 3) } |
| enum | { OPT_ARG_RTP_CODEC , OPT_ARG_RTP_ENGINE , OPT_ARG_RTP_PAYLOAD , OPT_ARG_ARRAY_SIZE } |
Functions | |
| static void | __reg_module (void) |
| static void | __unreg_module (void) |
| struct ast_module * | AST_MODULE_SELF_SYM (void) |
| static void | chan_rtp_get_codec (struct ast_channel *chan, struct ast_format_cap *result) |
| Function called by RTP engine to get peer capabilities. | |
| static enum ast_rtp_glue_result | chan_rtp_get_rtp_peer (struct ast_channel *chan, struct ast_rtp_instance **instance) |
| Function called by RTP engine to get local audio RTP peer. | |
| static enum ast_rtp_glue_result | chan_rtp_get_vrtp_peer (struct ast_channel *chan, struct ast_rtp_instance **instance) |
| Function called by RTP engine to get local audio RTP peer. | |
| static int | chan_rtp_set_rtp_peer (struct ast_channel *chan, struct ast_rtp_instance *rtp, struct ast_rtp_instance *vrtp, struct ast_rtp_instance *tpeer, const struct ast_format_cap *cap, int nat_active) |
| Function called by RTP engine to change where the remote party should send media. | |
| 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. | |
| 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. | |
| static int | rtp_call (struct ast_channel *ast, const char *dest, int timeout) |
| Function called when we should actually call the destination. | |
| static int | rtp_hangup (struct ast_channel *ast) |
| Function called when we should hang the channel up. | |
| static struct ast_frame * | rtp_read (struct ast_channel *ast) |
| Function called when we should read a frame from the channel. | |
| static int | rtp_write (struct ast_channel *ast, struct ast_frame *f) |
| Function called when we should write a frame to the channel. | |
| 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. | |
| static int | unload_module (void) |
| Function called when our module is unloaded. | |
Variables | |
| static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "RTP Media Channel" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .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 const struct ast_datastore_info | chan_rtp_datastore_info |
| static struct ast_channel_tech | multicast_rtp_tech |
| static struct ast_rtp_glue | unicast_rtp_glue |
| Local glue for interacting with the RTP engine core. | |
| 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 }, [ 'g' ] = { .flag = OPT_RTP_GLUE }, [ 'p' ] = { .flag = OPT_RTP_PAYLOAD , .arg_index = OPT_ARG_RTP_PAYLOAD + 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 | |
| OPT_RTP_GLUE | |
| OPT_RTP_PAYLOAD | |
Definition at line 253 of file chan_rtp.c.
| anonymous enum |
| Enumerator | |
|---|---|
| OPT_ARG_RTP_CODEC | |
| OPT_ARG_RTP_ENGINE | |
| OPT_ARG_RTP_PAYLOAD | |
| OPT_ARG_ARRAY_SIZE | |
Definition at line 260 of file chan_rtp.c.
|
static |
Definition at line 555 of file chan_rtp.c.
|
static |
Definition at line 555 of file chan_rtp.c.
| struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 555 of file chan_rtp.c.
|
static |
Function called by RTP engine to get peer capabilities.
Definition at line 449 of file chan_rtp.c.
References ast_channel_name(), ast_channel_nativeformats(), ast_format_cap_append_from_cap(), ast_format_cap_get_names(), AST_FORMAT_CAP_NAMES_LEN, AST_MEDIA_TYPE_UNKNOWN, ast_str_tmp, result, SCOPE_ENTER, and SCOPE_EXIT_RTN.
|
static |
Function called by RTP engine to get local audio RTP peer.
Definition at line 473 of file chan_rtp.c.
References ao2_ref, ast_channel_datastore_find(), ast_channel_tech_pvt(), AST_RTP_GLUE_RESULT_FORBID, AST_RTP_GLUE_RESULT_LOCAL, chan_rtp_datastore_info, and NULL.
|
static |
Function called by RTP engine to get local audio RTP peer.
Definition at line 467 of file chan_rtp.c.
References AST_RTP_GLUE_RESULT_FORBID.
|
static |
Function called by RTP engine to change where the remote party should send media.
chan_rtp is not able to actually update the peer, so this function has no effect.
Definition at line 461 of file chan_rtp.c.
|
static |
Definition at line 123 of file chan_rtp.c.
References ao2_bump, ao2_ref, 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 520 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_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_rtp_glue_register, ast_channel_tech::capabilities, LOG_ERROR, multicast_rtp_tech, unicast_rtp_glue, unicast_rtp_tech, and unload_module().
|
static |
Function called when we should prepare to call the multicast destination.
Definition at line 141 of file chan_rtp.c.
References ao2_cleanup, ao2_ref, args, AST_APP_ARG, AST_CAUSE_FAILURE, ast_channel_alloc, ast_channel_flags(), 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_FLAG_DISABLE_DEVSTATE_CACHE, 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_set_flag, ast_sockaddr_parse(), ast_sockaddr_setnull(), AST_STATE_DOWN, ast_strdupa, ast_strlen_zero(), derive_format_from_cap(), ast_multicast_rtp_options::fmt, LOG_ERROR, multicast_rtp_tech, NULL, options, PARSE_PORT_REQUIRE, and type.
|
static |
Function called when we should actually call the destination.
Definition at line 102 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 112 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 80 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 94 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 284 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_datastore_add(), ast_channel_flags(), 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_datastore_alloc, AST_DECLARE_APP_ARGS, ast_dns_resolve_ipv6_and_ipv4(), AST_FLAG_DISABLE_DEVSTATE_CACHE, 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_codecs_payload_replace_format(), ast_rtp_codecs_payload_set_rx(), ast_rtp_instance_destroy(), ast_rtp_instance_fd(), ast_rtp_instance_get_codecs(), ast_rtp_instance_get_local_address(), ast_rtp_instance_new(), ast_rtp_instance_set_channel_id(), ast_rtp_instance_set_remote_address, AST_RTP_MAX_PT, AST_RTP_PT_FIRST_DYNAMIC, ast_set_flag, ast_sockaddr_copy(), ast_sockaddr_parse(), ast_sockaddr_split_hostport(), ast_sockaddr_stringify_addr(), ast_sockaddr_stringify_port(), AST_STATE_DOWN, ast_str_to_int(), ast_strdupa, ast_strlen_zero(), ast_test_flag, chan_rtp_datastore_info, codecs, derive_format_from_cap(), LOG_ERROR, NULL, OPT_ARG_ARRAY_SIZE, OPT_ARG_RTP_CODEC, OPT_ARG_RTP_ENGINE, OPT_ARG_RTP_PAYLOAD, OPT_RTP_CODEC, OPT_RTP_ENGINE, OPT_RTP_GLUE, OPT_RTP_PAYLOAD, options, PARSE_PORT_REQUIRE, pbx_builtin_setvar_helper(), S_COR, S_OR, unicast_rtp_options, and unicast_rtp_tech.
|
static |
Function called when our module is unloaded.
Definition at line 504 of file chan_rtp.c.
References ao2_cleanup, ast_channel_unregister(), ast_rtp_glue_unregister(), ast_channel_tech::capabilities, multicast_rtp_tech, NULL, unicast_rtp_glue, and unicast_rtp_tech.
Referenced by load_module().
|
static |
Definition at line 555 of file chan_rtp.c.
|
static |
Definition at line 555 of file chan_rtp.c.
|
static |
Definition at line 279 of file chan_rtp.c.
Referenced by chan_rtp_get_rtp_peer(), and unicast_rtp_request().
|
static |
Definition at line 58 of file chan_rtp.c.
Referenced by load_module(), multicast_rtp_request(), and unload_module().
|
static |
Local glue for interacting with the RTP engine core.
Definition at line 495 of file chan_rtp.c.
Referenced by load_module(), and unload_module().
|
static |
Set the codec to be used for unicast RTP
Set the RTP engine to use for unicast RTP
Provide RTP glue for the channel
Set the dynamic payload type (96-127) to send and receive with
Definition at line 277 of file chan_rtp.c.
Referenced by unicast_rtp_request().
|
static |
Definition at line 69 of file chan_rtp.c.
Referenced by load_module(), unicast_rtp_request(), and unload_module().