Asterisk - The Open Source Telephony Project
18.5.0
|
Motif Jingle Channel Driver. More...
#include "asterisk.h"
#include <sys/socket.h>
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <signal.h>
#include <iksemel.h>
#include <pthread.h>
#include "asterisk/lock.h"
#include "asterisk/channel.h"
#include "asterisk/config_options.h"
#include "asterisk/module.h"
#include "asterisk/pbx.h"
#include "asterisk/sched.h"
#include "asterisk/io.h"
#include "asterisk/rtp_engine.h"
#include "asterisk/acl.h"
#include "asterisk/callerid.h"
#include "asterisk/file.h"
#include "asterisk/cli.h"
#include "asterisk/app.h"
#include "asterisk/musiconhold.h"
#include "asterisk/manager.h"
#include "asterisk/stringfields.h"
#include "asterisk/utils.h"
#include "asterisk/causes.h"
#include "asterisk/abstract_jb.h"
#include "asterisk/xmpp.h"
#include "asterisk/endpoints.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/format_cache.h"
Go to the source code of this file.
Data Structures | |
struct | jingle_action_handler |
Defined handlers for different Jingle actions. More... | |
struct | jingle_config |
struct | jingle_endpoint |
Endpoint which contains configuration information and active sessions. More... | |
struct | jingle_endpoint_state |
Endpoint state information. More... | |
struct | jingle_reason_mapping |
Reason text <-> cause code mapping. More... | |
struct | jingle_session |
Session which contains information about an active session. More... | |
Macros | |
#define | DEFAULT_MAX_ICE_CANDIDATES "10" |
Default maximum number of ICE candidates we will offer. More... | |
#define | DEFAULT_MAX_PAYLOADS "30" |
Default maximum number of payloads we will offer. More... | |
#define | ENDPOINT_BUCKETS 37 |
Number of buckets for endpoints. More... | |
#define | GOOGLE_PHONE_NS "http://www.google.com/session/phone" |
Namespace for Google Phone description. More... | |
#define | GOOGLE_SESSION_NS "http://www.google.com/session" |
Namespace for Google Session. More... | |
#define | GOOGLE_TRANSPORT_NS "http://www.google.com/transport/p2p" |
Namespace for Google Talk ICE-UDP. More... | |
#define | GOOGLE_TRANSPORT_RAW_NS "http://www.google.com/transport/raw-udp" |
Namespace for Google Talk Raw UDP. More... | |
#define | GOOGLE_VIDEO_NS "http://www.google.com/session/video" |
Namespace for Google Video description. More... | |
#define | JINGLE_ICE_UDP_NS "urn:xmpp:jingle:transports:ice-udp:1" |
Namespace for Jingle ICE-UDP. More... | |
#define | JINGLE_NS "urn:xmpp:jingle:1" |
Namespace for Jingle itself. More... | |
#define | JINGLE_RTP_INFO_NS "urn:xmpp:jingle:apps:rtp:info:1" |
Namespace for Jingle RTP info. More... | |
#define | JINGLE_RTP_NS "urn:xmpp:jingle:apps:rtp:1" |
Namespace for Jingle RTP sessions. More... | |
#define | SESSION_BUCKETS 37 |
Number of buckets for sessions, on a per-endpoint basis. More... | |
#define | XMPP_STANZAS_NS "urn:ietf:params:xml:ns:xmpp-stanzas" |
Namespace for XMPP stanzas. More... | |
Enumerations | |
enum | jingle_transport { JINGLE_TRANSPORT_ICE_UDP = 3, JINGLE_TRANSPORT_GOOGLE_V2 = 2, JINGLE_TRANSPORT_GOOGLE_V1 = 1, JINGLE_TRANSPORT_NONE = 0 } |
The various transport methods supported, from highest priority to lowest priority when doing fallback. More... | |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static | AO2_GLOBAL_OBJ_STATIC (globals) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
CONFIG_INFO_STANDARD (cfg_info, globals, jingle_config_alloc,.files=ACO_FILES(&jingle_conf),) | |
static int | custom_connection_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
Custom handler for connection. More... | |
static int | custom_group_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
Custom handler for groups. More... | |
static int | custom_transport_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
Custom handler for transport. More... | |
static int | jingle_action_hook (void *data, ikspak *pak) |
Callback for when a Jingle action is received from an endpoint. More... | |
static void | jingle_action_session_accept (struct jingle_endpoint *endpoint, struct jingle_session *session, ikspak *pak) |
Handler function for the 'session-accept' action. More... | |
static void | jingle_action_session_info (struct jingle_endpoint *endpoint, struct jingle_session *session, ikspak *pak) |
Handler function for the 'session-info' action. More... | |
static void | jingle_action_session_initiate (struct jingle_endpoint *endpoint, struct jingle_session *session, ikspak *pak) |
Action handlers. More... | |
static void | jingle_action_session_terminate (struct jingle_endpoint *endpoint, struct jingle_session *session, ikspak *pak) |
Handler function for the 'session-terminate' action. More... | |
static void | jingle_action_transport_info (struct jingle_endpoint *endpoint, struct jingle_session *session, ikspak *pak) |
Handler function for the 'transport-info' action. More... | |
static int | jingle_add_content (struct jingle_session *session, iks *jingle, iks *content, iks *description, iks *transport, const char *name, enum ast_media_type type, struct ast_rtp_instance *rtp, iks **payloads) |
Helper function which adds content to a description. More... | |
static int | jingle_add_google_candidates_to_transport (struct ast_rtp_instance *rtp, iks *transport, iks **candidates, unsigned int video, enum jingle_transport transport_type, unsigned int maximum) |
Internal helper function which adds Google candidates to a transport node. More... | |
static int | jingle_add_ice_udp_candidates_to_transport (struct ast_rtp_instance *rtp, iks *transport, iks **candidates, unsigned int maximum) |
Internal helper function which adds ICE-UDP candidates to a transport node. More... | |
static int | jingle_add_payloads_to_description (struct jingle_session *session, struct ast_rtp_instance *rtp, iks *description, iks **payloads, enum ast_media_type type) |
Internal helper function which adds payloads to a description. More... | |
static struct jingle_session * | jingle_alloc (struct jingle_endpoint *endpoint, const char *from, const char *sid) |
Internal helper function used to allocate Jingle session on an endpoint. More... | |
static int | jingle_answer (struct ast_channel *ast) |
Function called by core when we should answer a Jingle session. More... | |
static int | jingle_call (struct ast_channel *ast, const char *dest, int timeout) |
Function called by core to actually start calling a remote party. More... | |
static void * | jingle_config_alloc (void) |
Allocator called when module configuration should appear. More... | |
static void | jingle_config_destructor (void *obj) |
Destructor called when module configuration goes away. More... | |
static int | jingle_digit_begin (struct ast_channel *chan, char digit) |
Function called by core to start a DTMF digit. More... | |
static int | jingle_digit_end (struct ast_channel *ast, char digit, unsigned int duration) |
Function called by core to stop a DTMF digit. More... | |
static void | jingle_enable_video (struct jingle_session *session) |
Internal helper function which enables video support on a sesson if possible. More... | |
static void * | jingle_endpoint_alloc (const char *cat) |
Allocator function for Jingle endpoints. More... | |
static int | jingle_endpoint_cmp (void *obj, void *arg, int flags) |
Comparator function for Jingle endpoints. More... | |
static void | jingle_endpoint_destructor (void *obj) |
Destructor for Jingle endpoints. More... | |
static void * | jingle_endpoint_find (struct ao2_container *tmp_container, const char *category) |
Find function for Jingle endpoints. More... | |
static int | jingle_endpoint_hash (const void *obj, const int flags) |
Hashing function for Jingle endpoints. More... | |
static struct jingle_endpoint_state * | jingle_endpoint_state_create (void) |
Allocator function for Jingle endpoint state. More... | |
static void | jingle_endpoint_state_destructor (void *obj) |
Destructor for Jingle endpoint state. More... | |
static struct jingle_endpoint_state * | jingle_endpoint_state_find_or_create (const char *category) |
State find/create function. More... | |
static int | jingle_fixup (struct ast_channel *oldchan, struct ast_channel *newchan) |
Function called by core to change the underlying owner channel. More... | |
static void | jingle_get_codec (struct ast_channel *chan, struct ast_format_cap *result) |
Function called by RTP engine to get peer capabilities. More... | |
static enum ast_rtp_glue_result | jingle_get_rtp_peer (struct ast_channel *chan, struct ast_rtp_instance **instance) |
Function called by RTP engine to get local RTP peer. More... | |
static int | jingle_hangup (struct ast_channel *ast) |
Function called by core to hang up a Jingle session. More... | |
static int | jingle_indicate (struct ast_channel *ast, int condition, const void *data, size_t datalen) |
Function called by core to ask the channel to indicate some sort of condition. More... | |
static int | jingle_interpret_content (struct jingle_session *session, ikspak *pak) |
Helper function which locates content stanzas and interprets them. More... | |
static int | jingle_interpret_description (struct jingle_session *session, iks *description, const char *name, struct ast_rtp_instance **rtp) |
Helper function which handles content descriptions. More... | |
static int | jingle_interpret_google_transport (struct jingle_session *session, iks *transport, struct ast_rtp_instance *rtp) |
Helper function which handles Google transport information. More... | |
static int | jingle_interpret_ice_udp_transport (struct jingle_session *session, iks *transport, struct ast_rtp_instance *rtp) |
Helper function which handles ICE-UDP transport information. More... | |
static struct ast_channel * | jingle_new (struct jingle_endpoint *endpoint, struct jingle_session *session, int state, const char *title, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *cid_name) |
Function called to create a new Jingle Asterisk channel. More... | |
static int | jingle_outgoing_hook (void *data, ikspak *pak) |
Callback for when a response is received for an outgoing session-initiate message. More... | |
static void | jingle_queue_hangup_with_cause (struct jingle_session *session, int cause) |
Helper function which queues a hangup frame with cause code. More... | |
static struct ast_frame * | jingle_read (struct ast_channel *ast) |
Function called by core to read any waiting frames. More... | |
static struct ast_channel * | jingle_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 by core to create a new outgoing Jingle session. More... | |
static void | jingle_send_error_response (struct ast_xmpp_client *connection, ikspak *pak, const char *type, const char *reasonstr, const char *reasonstr2) |
Internal helper function which sends an error response. More... | |
static void | jingle_send_response (struct ast_xmpp_client *connection, ikspak *pak) |
Internal helper function which sends a response. More... | |
static void | jingle_send_session_accept (struct jingle_session *session) |
Internal function which sends a session-accept message. More... | |
static void | jingle_send_session_action (struct jingle_session *session, const char *action) |
Internal function which sends a complete session message. More... | |
static void | jingle_send_session_info (struct jingle_session *session, const char *info) |
Internal function which sends a session-info message. More... | |
static void | jingle_send_session_initiate (struct jingle_session *session) |
Internal function which sends a session-inititate message. More... | |
static void | jingle_send_session_terminate (struct jingle_session *session, const char *reasontext) |
Internal function which sends a session-terminate message. More... | |
static void | jingle_send_transport_info (struct jingle_session *session, const char *from) |
Internal function which sends a transport-info message. More... | |
static int | jingle_sendtext (struct ast_channel *chan, const char *text) |
Function called by core to send text to the remote party of the Jingle session. More... | |
static int | jingle_session_cmp (void *obj, void *arg, int flags) |
Comparator function for Jingle sessions. More... | |
static void | jingle_session_destructor (void *obj) |
Destructor for Jingle sessions. More... | |
static int | jingle_session_hash (const void *obj, const int flags) |
Hashing function for Jingle sessions. More... | |
static struct ast_channel * | jingle_session_lock_full (struct jingle_session *pvt) |
static void | jingle_set_owner (struct jingle_session *session, struct ast_channel *chan) |
Set the channel owner on the jingle_session object and related objects. More... | |
static int | jingle_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. More... | |
static int | jingle_write (struct ast_channel *ast, struct ast_frame *frame) |
Function called by core to write frames. More... | |
static int | load_module (void) |
Load the module. More... | |
static int | reload (void) |
Reload module. More... | |
static int | unload_module (void) |
Unload the jingle channel from Asterisk. More... | |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Motif Jingle Channel Driver" , .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, .reload = reload, .load_pri = AST_MODPRI_CHANNEL_DRIVER, .requires = "res_xmpp", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static const char | channel_type [] = "Motif" |
static struct aco_type | endpoint_option |
struct aco_type * | endpoint_options [] = ACO_TYPES(&endpoint_option) |
static const struct jingle_action_handler | jingle_action_handlers [] |
struct aco_file | jingle_conf |
static const struct jingle_reason_mapping | jingle_reason_mappings [] |
static struct ast_rtp_glue | jingle_rtp_glue |
Local glue for interacting with the RTP engine core. More... | |
static struct ast_channel_tech | jingle_tech |
PBX interface structure for channel registration. More... | |
static struct ast_sched_context * | sched |
Motif Jingle Channel Driver.
Iksemel http://iksemel.jabberstudio.org/
Definition in file chan_motif.c.
#define DEFAULT_MAX_ICE_CANDIDATES "10" |
Default maximum number of ICE candidates we will offer.
Definition at line 220 of file chan_motif.c.
Referenced by load_module().
#define DEFAULT_MAX_PAYLOADS "30" |
Default maximum number of payloads we will offer.
Definition at line 223 of file chan_motif.c.
Referenced by load_module().
#define ENDPOINT_BUCKETS 37 |
Number of buckets for endpoints.
Definition at line 226 of file chan_motif.c.
Referenced by jingle_config_alloc().
Namespace for Google Phone description.
Definition at line 253 of file chan_motif.c.
Referenced by jingle_add_content(), jingle_add_payloads_to_description(), and jingle_interpret_content().
#define GOOGLE_SESSION_NS "http://www.google.com/session" |
Namespace for Google Session.
Definition at line 250 of file chan_motif.c.
Referenced by custom_connection_handler(), jingle_interpret_content(), jingle_send_session_action(), jingle_send_session_terminate(), and jingle_send_transport_info().
#define GOOGLE_TRANSPORT_NS "http://www.google.com/transport/p2p" |
Namespace for Google Talk ICE-UDP.
Definition at line 244 of file chan_motif.c.
Referenced by jingle_add_content(), jingle_add_google_candidates_to_transport(), and jingle_interpret_content().
#define GOOGLE_TRANSPORT_RAW_NS "http://www.google.com/transport/raw-udp" |
Namespace for Google Talk Raw UDP.
Definition at line 247 of file chan_motif.c.
#define GOOGLE_VIDEO_NS "http://www.google.com/session/video" |
Namespace for Google Video description.
Definition at line 256 of file chan_motif.c.
Referenced by jingle_interpret_content().
#define JINGLE_ICE_UDP_NS "urn:xmpp:jingle:transports:ice-udp:1" |
Namespace for Jingle ICE-UDP.
Definition at line 241 of file chan_motif.c.
Referenced by jingle_add_content(), jingle_add_ice_udp_candidates_to_transport(), and jingle_interpret_content().
#define JINGLE_NS "urn:xmpp:jingle:1" |
Namespace for Jingle itself.
Definition at line 232 of file chan_motif.c.
Referenced by custom_connection_handler(), jingle_send_session_action(), jingle_send_session_info(), jingle_send_session_terminate(), and jingle_send_transport_info().
#define JINGLE_RTP_INFO_NS "urn:xmpp:jingle:apps:rtp:info:1" |
Namespace for Jingle RTP info.
Definition at line 238 of file chan_motif.c.
Referenced by jingle_action_session_info().
#define JINGLE_RTP_NS "urn:xmpp:jingle:apps:rtp:1" |
Namespace for Jingle RTP sessions.
Definition at line 235 of file chan_motif.c.
Referenced by jingle_add_content(), and jingle_interpret_content().
#define SESSION_BUCKETS 37 |
Number of buckets for sessions, on a per-endpoint basis.
Definition at line 229 of file chan_motif.c.
Referenced by jingle_endpoint_state_create().
#define XMPP_STANZAS_NS "urn:ietf:params:xml:ns:xmpp-stanzas" |
Namespace for XMPP stanzas.
Definition at line 259 of file chan_motif.c.
Referenced by jingle_outgoing_hook().
enum jingle_transport |
The various transport methods supported, from highest priority to lowest priority when doing fallback.
Enumerator | |
---|---|
JINGLE_TRANSPORT_ICE_UDP | XEP-0176 |
JINGLE_TRANSPORT_GOOGLE_V2 | |
JINGLE_TRANSPORT_GOOGLE_V1 | Undocumented initial Google specification |
JINGLE_TRANSPORT_NONE | No transport specified |
Definition at line 262 of file chan_motif.c.
|
static |
Definition at line 2830 of file chan_motif.c.
|
static |
Definition at line 2830 of file chan_motif.c.
|
static |
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 2830 of file chan_motif.c.
CONFIG_INFO_STANDARD | ( | cfg_info | , |
globals | , | ||
jingle_config_alloc | , | ||
. | files = ACO_FILES(&jingle_conf) |
||
) |
Referenced by jingle_config_alloc().
|
static |
Custom handler for connection.
Definition at line 2674 of file chan_motif.c.
References ast_log, ast_xmpp_client_find(), jingle_endpoint::connection, ast_xmpp_client::filter, GOOGLE_SESSION_NS, jingle_action_hook(), JINGLE_NS, LOG_ERROR, jingle_endpoint::name, jingle_endpoint::rule, and ast_variable::value.
Referenced by load_module().
|
static |
Custom handler for groups.
Definition at line 2658 of file chan_motif.c.
References ast_get_group(), jingle_endpoint::callgroup, ast_variable::name, jingle_endpoint::pickupgroup, and ast_variable::value.
Referenced by load_module().
|
static |
Custom handler for transport.
Definition at line 2699 of file chan_motif.c.
References ast_log, JINGLE_TRANSPORT_GOOGLE_V1, JINGLE_TRANSPORT_GOOGLE_V2, JINGLE_TRANSPORT_ICE_UDP, LOG_WARNING, jingle_endpoint::name, jingle_endpoint::transport, and ast_variable::value.
Referenced by load_module().
|
static |
Callback for when a Jingle action is received from an endpoint.
Definition at line 2595 of file chan_motif.c.
References ao2_find, ao2_ref, ARRAY_LEN, ast_callid_threadassoc_add(), ast_callid_threadassoc_remove(), ast_log, ast_strlen_zero, jingle_session::callid, jingle_action_handler::handler, jingle_action_handlers, LOG_NOTICE, NULL, OBJ_KEY, session, jingle_endpoint_state::sessions, and jingle_endpoint::state.
Referenced by custom_connection_handler().
|
static |
Handler function for the 'session-accept' action.
Definition at line 2474 of file chan_motif.c.
References ao2_unlock, ast_channel_unlock, ast_channel_unref, AST_CONTROL_ANSWER, ast_queue_control(), jingle_endpoint::connection, jingle_interpret_content(), jingle_send_error_response(), jingle_send_response(), and jingle_session_lock_full().
|
static |
Handler function for the 'session-info' action.
Definition at line 2498 of file chan_motif.c.
References ao2_unlock, ast_channel_unlock, ast_channel_unref, AST_CONTROL_RINGING, ast_queue_control(), ast_queue_hold(), ast_queue_unhold(), ast_setstate(), AST_STATE_RINGING, AST_STATE_UP, jingle_endpoint::connection, JINGLE_RTP_INFO_NS, jingle_send_error_response(), jingle_send_response(), jingle_session_lock_full(), and NULL.
|
static |
Action handlers.
Handler function for the 'session-initiate' action.
Definition at line 2390 of file chan_motif.c.
References ao2_link, ao2_ref, ast_channel_lock, ast_channel_unlock, ast_hangup(), ast_log, AST_PBX_CALL_LIMIT, AST_PBX_FAILED, ast_pbx_start(), AST_PBX_SUCCESS, ast_setstate(), AST_STATE_DOWN, AST_STATE_RING, jingle_endpoint::connection, jingle_session::gone, jingle_alloc(), jingle_interpret_content(), jingle_new(), jingle_send_error_response(), jingle_send_response(), jingle_send_transport_info(), JINGLE_TRANSPORT_GOOGLE_V1, JINGLE_TRANSPORT_NONE, LOG_WARNING, NULL, jingle_endpoint_state::sessions, jingle_endpoint::state, and jingle_session::transport.
|
static |
Handler function for the 'session-terminate' action.
Definition at line 2533 of file chan_motif.c.
References ao2_unlock, ARRAY_LEN, ast_alloca, ast_control_pvt_cause_code::ast_cause, AST_CAUSE_NORMAL, ast_channel_hangupcause_hash_set(), AST_CHANNEL_NAME, ast_channel_name(), ast_channel_unlock, ast_channel_unref, AST_CONTROL_PVT_CAUSE_CODE, ast_copy_string(), ast_debug, ast_queue_control_data(), ast_queue_hangup_with_cause(), jingle_reason_mapping::cause, ast_control_pvt_cause_code::chan_name, ast_control_pvt_cause_code::code, jingle_endpoint::connection, jingle_session::gone, jingle_reason_mappings, jingle_send_error_response(), jingle_send_response(), jingle_session_lock_full(), and text.
|
static |
Handler function for the 'transport-info' action.
Definition at line 2461 of file chan_motif.c.
References jingle_endpoint::connection, jingle_interpret_content(), jingle_send_error_response(), and jingle_send_response().
|
static |
Helper function which adds content to a description.
Definition at line 1392 of file chan_motif.c.
References AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_VIDEO, GOOGLE_PHONE_NS, GOOGLE_TRANSPORT_NS, jingle_add_payloads_to_description(), JINGLE_ICE_UDP_NS, JINGLE_RTP_NS, JINGLE_TRANSPORT_GOOGLE_V1, JINGLE_TRANSPORT_GOOGLE_V2, JINGLE_TRANSPORT_ICE_UDP, jingle_session::outgoing, and jingle_session::transport.
Referenced by jingle_send_session_action().
|
static |
Internal helper function which adds Google candidates to a transport node.
Definition at line 980 of file chan_motif.c.
References ast_rtp_engine_ice_candidate::address, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_log, AST_RTP_ICE_CANDIDATE_TYPE_HOST, AST_RTP_ICE_CANDIDATE_TYPE_SRFLX, ast_rtp_instance_get_ice(), ast_sockaddr_stringify_host(), ast_sockaddr_stringify_port(), ast_rtp_engine_ice::get_local_candidates, ast_rtp_engine_ice::get_password, ast_rtp_engine_ice::get_ufrag, GOOGLE_TRANSPORT_NS, ast_rtp_engine_ice_candidate::id, JINGLE_TRANSPORT_GOOGLE_V1, LOG_ERROR, and ast_rtp_engine_ice_candidate::type.
Referenced by jingle_send_transport_info().
|
static |
Internal helper function which adds ICE-UDP candidates to a transport node.
Definition at line 918 of file chan_motif.c.
References ast_rtp_engine_ice_candidate::address, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_log, ast_random(), AST_RTP_ICE_CANDIDATE_TYPE_HOST, AST_RTP_ICE_CANDIDATE_TYPE_RELAYED, AST_RTP_ICE_CANDIDATE_TYPE_SRFLX, ast_rtp_instance_get_ice(), ast_sockaddr_stringify_host(), ast_sockaddr_stringify_port(), ast_str_hash(), ast_rtp_engine_ice_candidate::foundation, ast_rtp_engine_ice::get_local_candidates, ast_rtp_engine_ice::get_password, ast_rtp_engine_ice::get_ufrag, ast_rtp_engine_ice_candidate::id, JINGLE_ICE_UDP_NS, LOG_ERROR, ast_rtp_engine_ice_candidate::priority, tmp(), and ast_rtp_engine_ice_candidate::type.
Referenced by jingle_send_transport_info().
|
static |
Internal helper function which adds payloads to a description.
Definition at line 1306 of file chan_motif.c.
References ao2_ref, ast_format_cap_count(), ast_format_cap_get_format(), ast_format_cmp(), AST_FORMAT_CMP_EQUAL, ast_format_g722, ast_format_get_type(), AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_VIDEO, ast_rtp_codecs_payload_code(), ast_rtp_instance_get_codecs(), ast_rtp_lookup_mime_subtype2(), ast_rtp_lookup_sample_rate2(), format, GOOGLE_PHONE_NS, JINGLE_TRANSPORT_GOOGLE_V1, JINGLE_TRANSPORT_GOOGLE_V2, jingle_session::jointcap, jingle_session::maxpayloads, tmp(), jingle_session::transport, and ast_channel::x.
Referenced by jingle_add_content().
|
static |
Internal helper function used to allocate Jingle session on an endpoint.
Definition at line 701 of file chan_motif.c.
References ao2_alloc, ao2_ref, ast_copy_string(), ast_create_callid(), ast_format_cap_alloc, ast_format_cap_append_from_cap(), AST_FORMAT_CAP_FLAG_DEFAULT, AST_MEDIA_TYPE_UNKNOWN, ast_random(), ast_read_threadstorage_callid(), ast_rtp_instance_new(), ast_rtp_instance_set_prop(), AST_RTP_PROPERTY_DTMF, AST_RTP_PROPERTY_RTCP, ast_sockaddr_parse(), ast_string_field_build, ast_string_field_init, ast_string_field_set, ast_strlen_zero, jingle_session::callid, jingle_endpoint::cap, jingle_session::cap, jingle_endpoint::connection, jingle_session::connection, jingle_session_destructor(), jingle_session::jointcap, jingle_endpoint::maxicecandidates, jingle_session::maxicecandidates, jingle_endpoint::maxpayloads, jingle_session::maxpayloads, NULL, jingle_session::outgoing, jingle_session::peercap, jingle_session::remote, jingle_session::remote_original, jingle_session::rtp, session, jingle_endpoint::state, jingle_session::state, jingle_endpoint::transport, and jingle_session::transport.
Referenced by jingle_action_session_initiate(), and jingle_request().
|
static |
Function called by core when we should answer a Jingle session.
Definition at line 1625 of file chan_motif.c.
References ast_channel_tech_pvt(), AST_STATE_UP, jingle_send_session_accept(), and session.
|
static |
Function called by core to actually start calling a remote party.
Definition at line 1850 of file chan_motif.c.
References ast_channel_tech_pvt(), ast_format_cap_append_from_cap(), AST_MEDIA_TYPE_UNKNOWN, ast_setstate(), AST_STATE_RING, jingle_session::cap, jingle_session::connection, ast_xmpp_client::filter, jingle_outgoing_hook(), jingle_send_session_initiate(), jingle_session::jointcap, ast_xmpp_client::mid, jingle_session::rule, and session.
|
static |
Allocator called when module configuration should appear.
Definition at line 598 of file chan_motif.c.
References ACO_FILES, ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_ref, CONFIG_INFO_STANDARD(), ENDPOINT_BUCKETS, jingle_config::endpoints, globals, jingle_config_destructor(), jingle_endpoint_cmp(), jingle_endpoint_hash(), and NULL.
|
static |
Destructor called when module configuration goes away.
Definition at line 591 of file chan_motif.c.
References ao2_cleanup, and jingle_config::endpoints.
Referenced by jingle_config_alloc().
|
static |
Function called by core to start a DTMF digit.
Definition at line 1826 of file chan_motif.c.
References ast_channel_tech_pvt(), ast_rtp_instance_dtmf_begin(), jingle_session::rtp, and session.
|
static |
Function called by core to stop a DTMF digit.
Definition at line 1838 of file chan_motif.c.
References ast_channel_tech_pvt(), ast_rtp_instance_dtmf_end_with_duration(), jingle_session::rtp, and session.
|
static |
Internal helper function which enables video support on a sesson if possible.
Definition at line 668 of file chan_motif.c.
References ast_channel_set_fd(), ast_channel_uniqueid(), ast_format_cap_get_framing(), ast_format_cap_has_type(), AST_MEDIA_TYPE_VIDEO, ast_rtp_codecs_set_framing(), ast_rtp_instance_fd(), ast_rtp_instance_get_codecs(), ast_rtp_instance_get_ice(), ast_rtp_instance_new(), ast_rtp_instance_set_channel_id(), ast_rtp_instance_set_prop(), AST_RTP_PROPERTY_RTCP, ast_sockaddr_parse(), jingle_session::cap, JINGLE_TRANSPORT_GOOGLE_V2, NULL, jingle_session::owner, ast_rtp_engine_ice::stop, jingle_session::transport, and jingle_session::vrtp.
Referenced by jingle_interpret_description(), and jingle_request().
|
static |
Allocator function for Jingle endpoints.
Definition at line 499 of file chan_motif.c.
References ao2_alloc, ao2_ref, ast_format_cap_alloc, AST_FORMAT_CAP_FLAG_DEFAULT, ast_string_field_init, ast_string_field_set, jingle_endpoint::cap, jingle_endpoint_destructor(), jingle_endpoint_state_find_or_create(), JINGLE_TRANSPORT_ICE_UDP, name, NULL, jingle_endpoint::state, and jingle_endpoint::transport.
|
static |
Comparator function for Jingle endpoints.
Definition at line 535 of file chan_motif.c.
References CMP_MATCH, CMP_STOP, name, jingle_endpoint::name, and OBJ_KEY.
Referenced by jingle_config_alloc().
|
static |
Destructor for Jingle endpoints.
Definition at line 441 of file chan_motif.c.
References ao2_cleanup, ao2_ref, ast_string_field_free_memory, ast_xmpp_client_unref(), jingle_endpoint::cap, jingle_endpoint::connection, ast_xmpp_client::filter, jingle_endpoint::rule, and jingle_endpoint::state.
Referenced by jingle_endpoint_alloc().
|
static |
Find function for Jingle endpoints.
Definition at line 460 of file chan_motif.c.
References ao2_find, and OBJ_KEY.
Referenced by jingle_endpoint_state_find_or_create(), and jingle_request().
|
static |
Hashing function for Jingle endpoints.
Definition at line 526 of file chan_motif.c.
References ast_str_hash(), name, jingle_endpoint::name, and OBJ_KEY.
Referenced by jingle_config_alloc().
|
static |
Allocator function for Jingle endpoint state.
Definition at line 466 of file chan_motif.c.
References ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_ref, jingle_endpoint_state_destructor(), jingle_session_cmp(), jingle_session_hash(), NULL, SESSION_BUCKETS, jingle_endpoint_state::sessions, and state.
Referenced by jingle_endpoint_state_find_or_create().
|
static |
Destructor for Jingle endpoint state.
Definition at line 433 of file chan_motif.c.
References ao2_ref, and jingle_endpoint_state::sessions.
Referenced by jingle_endpoint_state_create().
|
static |
State find/create function.
Definition at line 485 of file chan_motif.c.
References ao2_cleanup, ao2_global_obj_ref, ao2_ref, globals, jingle_endpoint_find(), jingle_endpoint_state_create(), NULL, and RAII_VAR.
Referenced by jingle_endpoint_alloc().
|
static |
Function called by core to change the underlying owner channel.
Definition at line 1735 of file chan_motif.c.
References ao2_lock, ao2_unlock, ast_channel_tech_pvt(), jingle_set_owner(), and session.
|
static |
Function called by RTP engine to get peer capabilities.
Definition at line 637 of file chan_motif.c.
|
static |
Function called by RTP engine to get local RTP peer.
Definition at line 621 of file chan_motif.c.
References ao2_ref, ast_channel_tech_pvt(), AST_RTP_GLUE_RESULT_FORBID, AST_RTP_GLUE_RESULT_LOCAL, jingle_session::rtp, and session.
|
static |
Function called by core to hang up a Jingle session.
Definition at line 1869 of file chan_motif.c.
References ao2_lock, ao2_ref, ao2_unlink, ao2_unlock, ARRAY_LEN, AST_CAUSE_CONGESTION, ast_channel_hangupcause(), ast_channel_tech_pvt(), ast_channel_tech_pvt_set(), AST_STATE_DOWN, jingle_session::gone, jingle_reason_mappings, jingle_send_session_terminate(), jingle_set_owner(), NULL, jingle_session::owner, jingle_reason_mapping::reason, session, jingle_endpoint_state::sessions, and jingle_session::state.
|
static |
Function called by core to ask the channel to indicate some sort of condition.
Definition at line 1749 of file chan_motif.c.
References AST_CAUSE_BUSY, AST_CAUSE_CONGESTION, ast_channel_hangupcause_set(), ast_channel_tech_pvt(), AST_CONTROL_BUSY, AST_CONTROL_CONGESTION, AST_CONTROL_CONNECTED_LINE, AST_CONTROL_HOLD, AST_CONTROL_INCOMPLETE, AST_CONTROL_MASQUERADE_NOTIFY, AST_CONTROL_PVT_CAUSE_CODE, AST_CONTROL_RINGING, AST_CONTROL_SRCCHANGE, AST_CONTROL_SRCUPDATE, AST_CONTROL_UNHOLD, AST_CONTROL_UPDATE_RTP_PEER, AST_CONTROL_VIDUPDATE, ast_log, ast_moh_start(), ast_moh_stop(), ast_rtp_instance_change_source(), ast_rtp_instance_update_source(), AST_SOFTHANGUP_DEV, ast_softhangup_nolock(), AST_STATE_RING, AST_STATE_UP, jingle_send_session_info(), LOG_NOTICE, NULL, jingle_session::rtp, and session.
|
static |
Helper function which locates content stanzas and interprets them.
Definition at line 2279 of file chan_motif.c.
References ao2_ref, ao2_unlock, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL, AST_CAUSE_FACILITY_NOT_IMPLEMENTED, AST_CAUSE_SWITCH_CONGESTION, ast_channel_nativeformats_set(), ast_channel_unlock, ast_channel_unref, ast_format_cap_alloc, ast_format_cap_append_from_cap(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_format(), ast_log, AST_MEDIA_TYPE_UNKNOWN, ast_set_read_format(), ast_set_write_format(), ast_strlen_zero, jingle_session::audio_name, GOOGLE_PHONE_NS, GOOGLE_SESSION_NS, GOOGLE_TRANSPORT_NS, GOOGLE_VIDEO_NS, JINGLE_ICE_UDP_NS, jingle_interpret_description(), jingle_interpret_google_transport(), jingle_interpret_ice_udp_transport(), jingle_queue_hangup_with_cause(), JINGLE_RTP_NS, jingle_session_lock_full(), JINGLE_TRANSPORT_GOOGLE_V1, jingle_session::jointcap, LOG_ERROR, name, NULL, jingle_session::rtp, jingle_session::sid, jingle_session::transport, jingle_session::video_name, and jingle_session::vrtp.
Referenced by jingle_action_session_accept(), jingle_action_session_initiate(), and jingle_action_transport_info().
|
static |
Helper function which handles content descriptions.
Definition at line 2033 of file chan_motif.c.
References AST_CAUSE_BEARERCAPABILITY_NOTAVAIL, ast_format_cap_count(), ast_format_cap_get_compatible(), ast_format_cap_remove_by_type(), ast_log, AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_VIDEO, ast_rtp_codecs_payload_formats(), ast_rtp_codecs_payloads_copy(), ast_rtp_codecs_payloads_destroy(), ast_rtp_codecs_payloads_initialize(), ast_rtp_codecs_payloads_set_rtpmap_type(), ast_rtp_codecs_payloads_set_rtpmap_type_rate(), ast_rtp_instance_get_codecs(), ast_string_field_set, ast_strlen_zero, jingle_session::cap, jingle_enable_video(), jingle_queue_hangup_with_cause(), JINGLE_TRANSPORT_GOOGLE_V1, jingle_session::jointcap, LOG_ERROR, NULL, jingle_session::peercap, jingle_session::rtp, jingle_session::sid, jingle_session::transport, and jingle_session::vrtp.
Referenced by jingle_interpret_content().
|
static |
Helper function which handles Google transport information.
Definition at line 2201 of file chan_motif.c.
References AST_CAUSE_PROTOCOL_ERROR, AST_CAUSE_SWITCH_CONGESTION, ast_log, ast_rtp_instance_get_ice(), ast_rtp_instance_stun_request(), ast_sockaddr_parse(), ast_sockaddr_set_port, ast_strlen_zero, ast_rtp_engine_ice::get_ufrag, jingle_queue_hangup_with_cause(), JINGLE_TRANSPORT_GOOGLE_V1, JINGLE_TRANSPORT_GOOGLE_V2, LOG_ERROR, name, PARSE_PORT_FORBID, jingle_session::sid, ast_rtp_engine_ice::stop, and jingle_session::transport.
Referenced by jingle_interpret_content().
|
static |
Helper function which handles ICE-UDP transport information.
Definition at line 2120 of file chan_motif.c.
References ast_rtp_engine_ice::add_remote_candidate, ast_rtp_engine_ice_candidate::address, AST_CAUSE_PROTOCOL_ERROR, AST_CAUSE_SWITCH_CONGESTION, ast_log, AST_RTP_ICE_CANDIDATE_TYPE_HOST, AST_RTP_ICE_CANDIDATE_TYPE_RELAYED, AST_RTP_ICE_CANDIDATE_TYPE_SRFLX, ast_rtp_instance_get_ice(), ast_rtp_instance_get_remote_address, ast_rtp_instance_set_remote_address, ast_sockaddr_is_ipv4(), ast_sockaddr_isnull(), ast_sockaddr_parse(), ast_sockaddr_set_port, ast_strlen_zero, ast_rtp_engine_ice_candidate::foundation, ast_rtp_engine_ice_candidate::id, jingle_queue_hangup_with_cause(), LOG_ERROR, PARSE_PORT_FORBID, priority, ast_rtp_engine_ice_candidate::priority, ast_rtp_engine_ice::set_authentication, jingle_session::sid, ast_rtp_engine_ice::start, ast_rtp_engine_ice_candidate::transport, type, and ast_rtp_engine_ice_candidate::type.
Referenced by jingle_interpret_content().
|
static |
Function called to create a new Jingle Asterisk channel.
Definition at line 768 of file chan_motif.c.
References jingle_endpoint::accountcode, ao2_lock, ao2_ref, ao2_unlock, AST_ADSI_UNAVAILABLE, ast_channel_adsicpe_set(), ast_channel_alloc_with_endpoint, ast_channel_callgroup_set(), ast_channel_callid_set(), ast_channel_context_set(), ast_channel_exten_set(), ast_channel_nativeformats_set(), ast_channel_pickupgroup_set(), ast_channel_priority_set(), ast_channel_rings_set(), ast_channel_set_fd(), ast_channel_set_rawreadformat(), ast_channel_set_rawwriteformat(), ast_channel_set_readformat(), ast_channel_set_writeformat(), ast_channel_stage_snapshot(), ast_channel_stage_snapshot_done(), ast_channel_tech_pvt_set(), ast_channel_tech_set(), ast_channel_unlock, ast_exists_extension(), ast_format_cap_alloc, ast_format_cap_append_from_cap(), ast_format_cap_count(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_format(), ast_format_cap_get_framing(), AST_MEDIA_TYPE_UNKNOWN, ast_random(), ast_rtp_codecs_set_framing(), ast_rtp_instance_fd(), ast_rtp_instance_get_codecs(), ast_rtp_instance_get_ice(), AST_STATE_RING, ast_strlen_zero, jingle_endpoint::callgroup, jingle_session::callid, jingle_session::cap, jingle_endpoint::connection, jingle_endpoint::context, ast_xmpp_client::endpoint, jingle_set_owner(), JINGLE_TRANSPORT_GOOGLE_V1, JINGLE_TRANSPORT_GOOGLE_V2, jingle_endpoint::language, jingle_endpoint::musicclass, jingle_endpoint::name, NULL, jingle_endpoint::pickupgroup, jingle_session::remote, jingle_session::rtp, S_OR, ast_rtp_engine_ice::stop, str, and jingle_session::transport.
Referenced by jingle_action_session_initiate(), and jingle_request().
|
static |
Callback for when a response is received for an outgoing session-initiate message.
Definition at line 1524 of file chan_motif.c.
References ao2_unlock, ast_callid_threadassoc_add(), ast_callid_threadassoc_remove(), AST_CAUSE_CONGESTION, AST_CAUSE_FACILITY_NOT_IMPLEMENTED, AST_CAUSE_NO_ROUTE_DESTINATION, AST_CAUSE_PROTOCOL_ERROR, AST_CAUSE_REQUESTED_CHAN_UNAVAIL, ast_channel_unlock, ast_channel_unref, AST_CONTROL_PROCEEDING, ast_copy_string(), ast_queue_control(), ast_rtp_instance_get_ice(), ast_strlen_zero, jingle_session::callid, jingle_session::connection, end, error(), ast_xmpp_client::filter, jingle_session::gone, jingle_queue_hangup_with_cause(), jingle_send_session_initiate(), jingle_send_transport_info(), jingle_session_lock_full(), JINGLE_TRANSPORT_GOOGLE_V1, JINGLE_TRANSPORT_GOOGLE_V2, JINGLE_TRANSPORT_NONE, ast_xmpp_client::mid, NULL, jingle_session::remote, jingle_session::remote_original, jingle_session::rtp, jingle_session::rule, session, ast_rtp_engine_ice::stop, jingle_session::transport, and XMPP_STANZAS_NS.
Referenced by jingle_call().
|
static |
Helper function which queues a hangup frame with cause code.
Definition at line 1197 of file chan_motif.c.
References ao2_unlock, ast_channel_name(), ast_channel_unlock, ast_channel_unref, ast_debug, ast_queue_hangup_with_cause(), and jingle_session_lock_full().
Referenced by jingle_interpret_content(), jingle_interpret_description(), jingle_interpret_google_transport(), jingle_interpret_ice_udp_transport(), jingle_outgoing_hook(), jingle_send_session_action(), and jingle_send_transport_info().
|
static |
Function called by core to read any waiting frames.
Definition at line 1640 of file chan_motif.c.
References ao2_ref, ast_channel_fdno(), ast_channel_name(), ast_channel_nativeformats(), ast_channel_nativeformats_set(), ast_channel_readformat(), ast_channel_tech_pvt(), ast_channel_writeformat(), ast_debug, ast_format_cap_alloc, ast_format_cap_append, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_iscompatible_format(), AST_FORMAT_CMP_NOT_EQUAL, ast_format_get_name(), AST_FRAME_VOICE, ast_frfree, ast_null_frame, ast_rtp_instance_read(), ast_set_read_format(), ast_set_write_format(), ast_frame_subclass::format, ast_frame::frametype, jingle_session::jointcap, jingle_session::rtp, session, ast_frame::subclass, and jingle_session::vrtp.
|
static |
Function called by core to create a new outgoing Jingle session.
Definition at line 1904 of file chan_motif.c.
References ao2_cleanup, ao2_find, ao2_global_obj_ref, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_link, ao2_lock, ao2_ref, ao2_unlock, args, AST_APP_ARG, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL, AST_CAUSE_CHANNEL_UNACCEPTABLE, AST_CAUSE_SWITCH_CONGESTION, ast_copy_string(), AST_DECLARE_APP_ARGS, ast_format_cap_has_type(), ast_log, AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_VIDEO, AST_NONSTANDARD_APP_ARGS, ast_rtp_instance_get_ice(), AST_STATE_DOWN, ast_strdupa, ast_strlen_zero, ast_xmpp_resource::caps, ast_channel::dialed, globals, ast_xmpp_capabilities::google, ast_rtp_engine_ice::ice_lite, ast_xmpp_capabilities::jingle, jingle_alloc(), jingle_enable_video(), jingle_endpoint_find(), jingle_new(), JINGLE_TRANSPORT_GOOGLE_V2, JINGLE_TRANSPORT_ICE_UDP, JINGLE_TRANSPORT_NONE, LOG_ERROR, name, NULL, OBJ_KEY, RAII_VAR, ast_xmpp_resource::resource, ast_xmpp_buddy::resources, jingle_session::rtp, session, jingle_session::transport, and jingle_session::vrtp.
|
static |
Internal helper function which sends an error response.
Definition at line 884 of file chan_motif.c.
References ast_log, ast_strlen_zero, ast_xmpp_client_send(), end, error(), ast_xmpp_client::jid, LOG_ERROR, and NULL.
Referenced by jingle_action_session_accept(), jingle_action_session_info(), jingle_action_session_initiate(), jingle_action_session_terminate(), and jingle_action_transport_info().
|
static |
Internal helper function which sends a response.
Definition at line 864 of file chan_motif.c.
References ast_log, ast_xmpp_client_send(), ast_xmpp_client::jid, and LOG_ERROR.
Referenced by jingle_action_session_accept(), jingle_action_session_info(), jingle_action_session_initiate(), jingle_action_session_terminate(), and jingle_action_transport_info().
|
static |
Internal function which sends a session-accept message.
Definition at line 1518 of file chan_motif.c.
References jingle_send_session_action(), JINGLE_TRANSPORT_GOOGLE_V1, and jingle_session::transport.
Referenced by jingle_answer().
|
static |
Internal function which sends a complete session message.
Definition at line 1430 of file chan_motif.c.
References AST_CAUSE_SWITCH_CONGESTION, ast_log, AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_VIDEO, ast_xmpp_client_send(), ast_xmpp_increment_mid(), jingle_session::audio_name, jingle_session::connection, GOOGLE_SESSION_NS, ast_xmpp_client::jid, jingle_add_content(), JINGLE_NS, jingle_queue_hangup_with_cause(), JINGLE_TRANSPORT_GOOGLE_V1, LOG_ERROR, jingle_session::maxpayloads, ast_xmpp_client::mid, NULL, jingle_session::outgoing, jingle_session::remote, jingle_session::rtp, jingle_session::sid, jingle_session::transport, jingle_session::video_name, and jingle_session::vrtp.
Referenced by jingle_send_session_accept(), and jingle_send_session_initiate().
|
static |
Internal function which sends a session-info message.
Definition at line 1098 of file chan_motif.c.
References ast_log, ast_xmpp_client_send(), ast_xmpp_increment_mid(), jingle_session::connection, end, JINGLE_NS, JINGLE_TRANSPORT_GOOGLE_V1, LOG_ERROR, ast_xmpp_client::mid, NULL, jingle_session::remote, jingle_session::sid, text, and jingle_session::transport.
Referenced by jingle_indicate().
|
static |
Internal function which sends a session-inititate message.
Definition at line 1512 of file chan_motif.c.
References jingle_send_session_action(), JINGLE_TRANSPORT_GOOGLE_V1, and jingle_session::transport.
Referenced by jingle_call(), and jingle_outgoing_hook().
|
static |
Internal function which sends a session-terminate message.
Definition at line 1058 of file chan_motif.c.
References ast_log, ast_xmpp_client_send(), ast_xmpp_increment_mid(), jingle_session::connection, end, GOOGLE_SESSION_NS, ast_xmpp_client::jid, JINGLE_NS, JINGLE_TRANSPORT_GOOGLE_V1, LOG_ERROR, ast_xmpp_client::mid, NULL, jingle_session::outgoing, jingle_session::remote, jingle_session::sid, text, and jingle_session::transport.
Referenced by jingle_hangup().
|
static |
Internal function which sends a transport-info message.
Definition at line 1211 of file chan_motif.c.
References AST_CAUSE_SWITCH_CONGESTION, ast_log, ast_xmpp_client_send(), ast_xmpp_increment_mid(), jingle_session::audio_name, jingle_session::connection, GOOGLE_SESSION_NS, ast_xmpp_client::jid, jingle_add_google_candidates_to_transport(), jingle_add_ice_udp_candidates_to_transport(), JINGLE_NS, jingle_queue_hangup_with_cause(), JINGLE_TRANSPORT_GOOGLE_V1, JINGLE_TRANSPORT_GOOGLE_V2, JINGLE_TRANSPORT_ICE_UDP, LOG_ERROR, jingle_session::maxicecandidates, ast_xmpp_client::mid, NULL, jingle_session::outgoing, jingle_session::rtp, jingle_session::sid, jingle_session::transport, jingle_session::video_name, and jingle_session::vrtp.
Referenced by jingle_action_session_initiate(), and jingle_outgoing_hook().
|
static |
Function called by core to send text to the remote party of the Jingle session.
Definition at line 1818 of file chan_motif.c.
References ast_channel_tech_pvt(), ast_xmpp_client_send_message(), jingle_session::connection, jingle_session::remote, and session.
|
static |
Comparator function for Jingle sessions.
Definition at line 424 of file chan_motif.c.
References CMP_MATCH, CMP_STOP, OBJ_KEY, and jingle_session::sid.
Referenced by jingle_endpoint_state_create().
|
static |
Destructor for Jingle sessions.
Definition at line 561 of file chan_motif.c.
References ao2_cleanup, ast_rtp_instance_destroy(), ast_rtp_instance_stop(), ast_string_field_free_memory, ast_xmpp_client_unref(), jingle_session::cap, jingle_session::connection, ast_xmpp_client::filter, jingle_session::jointcap, jingle_session::peercap, jingle_session::rtp, jingle_session::rule, session, and jingle_session::vrtp.
Referenced by jingle_alloc().
|
static |
Hashing function for Jingle sessions.
Definition at line 415 of file chan_motif.c.
References ast_str_hash(), OBJ_KEY, session, and jingle_session::sid.
Referenced by jingle_endpoint_state_create().
|
static |
Definition at line 1148 of file chan_motif.c.
References ao2_lock, ao2_unlock, ast_channel_lock, ast_channel_ref, ast_channel_unlock, ast_channel_unref, NULL, and jingle_session::owner.
Referenced by jingle_action_session_accept(), jingle_action_session_info(), jingle_action_session_terminate(), jingle_interpret_content(), jingle_outgoing_hook(), and jingle_queue_hangup_with_cause().
|
static |
Set the channel owner on the jingle_session object and related objects.
Definition at line 656 of file chan_motif.c.
References ast_channel_uniqueid(), ast_rtp_instance_set_channel_id(), jingle_session::owner, jingle_session::rtp, and jingle_session::vrtp.
Referenced by jingle_fixup(), jingle_hangup(), and jingle_new().
|
static |
Function called by RTP engine to change where the remote party should send media.
Definition at line 642 of file chan_motif.c.
|
static |
Function called by core to write frames.
Definition at line 1698 of file chan_motif.c.
References ast_channel_nativeformats(), ast_channel_readformat(), ast_channel_tech_pvt(), ast_channel_writeformat(), ast_format_cap_get_names(), ast_format_cap_iscompatible_format(), AST_FORMAT_CAP_NAMES_LEN, AST_FORMAT_CMP_NOT_EQUAL, ast_format_get_name(), AST_FRAME_VIDEO, AST_FRAME_VOICE, ast_log, ast_rtp_instance_write(), ast_str_alloca, ast_frame_subclass::format, ast_frame::frametype, LOG_WARNING, jingle_session::rtp, session, ast_frame::subclass, and jingle_session::vrtp.
|
static |
Load the module.
Module loading including tests for configuration or dependencies. This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails tests return AST_MODULE_LOAD_FAILURE. If the module can not load the configuration file or other non-critical problem return AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
Definition at line 2727 of file chan_motif.c.
References accountcode, ACO_EXACT, aco_info_destroy(), aco_info_init(), aco_option_register, aco_option_register_custom, aco_process_config(), ao2_cleanup, ao2_global_obj_release, ast_channel_register(), ast_format_cap_alloc, ast_format_cap_append_by_type(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_log, AST_MEDIA_TYPE_AUDIO, AST_MODULE_LOAD_DECLINE, ast_rtp_glue_register, ast_rtp_glue_unregister(), ast_sched_context_create(), ast_sched_context_destroy(), ast_sched_start_thread(), jingle_endpoint::cap, ast_channel_tech::capabilities, channel_type, context, custom_connection_handler(), custom_group_handler(), custom_transport_handler(), DEFAULT_MAX_ICE_CANDIDATES, DEFAULT_MAX_PAYLOADS, end, FLDSET, globals, language, LOG_ERROR, jingle_endpoint::maxicecandidates, jingle_endpoint::maxpayloads, musicclass, NULL, OPT_CODEC_T, OPT_STRINGFIELD_T, OPT_UINT_T, parkinglot, PARSE_DEFAULT, and STRFLDSET.
Referenced by unload_module().
|
static |
Reload module.
Definition at line 2800 of file chan_motif.c.
References aco_process_config(), and ACO_PROCESS_ERROR.
Referenced by unload_module().
|
static |
Unload the jingle channel from Asterisk.
Definition at line 2810 of file chan_motif.c.
References aco_info_destroy(), ao2_cleanup, ao2_global_obj_release, ast_channel_unregister(), AST_MODFLAG_LOAD_ORDER, AST_MODPRI_CHANNEL_DRIVER, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, ast_rtp_glue_unregister(), ast_sched_context_destroy(), ASTERISK_GPL_KEY, ast_channel_tech::capabilities, globals, load_module(), NULL, and reload().
|
static |
Definition at line 2830 of file chan_motif.c.
|
static |
Definition at line 2830 of file chan_motif.c.
|
static |
Definition at line 321 of file chan_motif.c.
Referenced by load_module(), and registry_message_cb().
|
static |
Definition at line 543 of file chan_motif.c.
struct aco_type* endpoint_options[] = ACO_TYPES(&endpoint_option) |
Definition at line 553 of file chan_motif.c.
|
static |
Referenced by jingle_action_hook().
struct aco_file jingle_conf |
Definition at line 555 of file chan_motif.c.
|
static |
Referenced by jingle_action_session_terminate(), and jingle_hangup().
|
static |
Local glue for interacting with the RTP engine core.
Definition at line 648 of file chan_motif.c.
|
static |
PBX interface structure for channel registration.
Definition at line 353 of file chan_motif.c.
|
static |
Scheduling context for RTCP
Definition at line 329 of file chan_motif.c.