Asterisk - The Open Source Telephony Project  21.4.1
Data Structures | Macros | Enumerations | Functions | Variables
chan_motif.c File Reference

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.
 
#define DEFAULT_MAX_PAYLOADS   "30"
 Default maximum number of payloads we will offer.
 
#define ENDPOINT_BUCKETS   37
 Number of buckets for endpoints.
 
#define GOOGLE_PHONE_NS   "http://www.google.com/session/phone"
 Namespace for Google Phone description.
 
#define GOOGLE_SESSION_NS   "http://www.google.com/session"
 Namespace for Google Session.
 
#define GOOGLE_TRANSPORT_NS   "http://www.google.com/transport/p2p"
 Namespace for Google Talk ICE-UDP.
 
#define GOOGLE_TRANSPORT_RAW_NS   "http://www.google.com/transport/raw-udp"
 Namespace for Google Talk Raw UDP.
 
#define GOOGLE_VIDEO_NS   "http://www.google.com/session/video"
 Namespace for Google Video description.
 
#define JINGLE_ICE_UDP_NS   "urn:xmpp:jingle:transports:ice-udp:1"
 Namespace for Jingle ICE-UDP.
 
#define JINGLE_NS   "urn:xmpp:jingle:1"
 Namespace for Jingle itself.
 
#define JINGLE_RTP_INFO_NS   "urn:xmpp:jingle:apps:rtp:info:1"
 Namespace for Jingle RTP info.
 
#define JINGLE_RTP_NS   "urn:xmpp:jingle:apps:rtp:1"
 Namespace for Jingle RTP sessions.
 
#define SESSION_BUCKETS   37
 Number of buckets for sessions, on a per-endpoint basis.
 
#define XMPP_STANZAS_NS   "urn:ietf:params:xml:ns:xmpp-stanzas"
 Namespace for XMPP stanzas.
 

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_moduleAST_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.
 
static int custom_group_handler (const struct aco_option *opt, struct ast_variable *var, void *obj)
 Custom handler for groups.
 
static int custom_transport_handler (const struct aco_option *opt, struct ast_variable *var, void *obj)
 Custom handler for transport.
 
static int jingle_action_hook (void *data, ikspak *pak)
 Callback for when a Jingle action is received from an endpoint.
 
static void jingle_action_session_accept (struct jingle_endpoint *endpoint, struct jingle_session *session, ikspak *pak)
 Handler function for the 'session-accept' action.
 
static void jingle_action_session_info (struct jingle_endpoint *endpoint, struct jingle_session *session, ikspak *pak)
 Handler function for the 'session-info' action.
 
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.
 
static void jingle_action_transport_info (struct jingle_endpoint *endpoint, struct jingle_session *session, ikspak *pak)
 Handler function for the 'transport-info' action.
 
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.
 
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.
 
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.
 
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.
 
static struct jingle_sessionjingle_alloc (struct jingle_endpoint *endpoint, const char *from, const char *sid)
 Internal helper function used to allocate Jingle session on an endpoint.
 
static int jingle_answer (struct ast_channel *ast)
 Function called by core when we should answer a Jingle session.
 
static int jingle_call (struct ast_channel *ast, const char *dest, int timeout)
 Function called by core to actually start calling a remote party.
 
static void * jingle_config_alloc (void)
 Allocator called when module configuration should appear.
 
static void jingle_config_destructor (void *obj)
 Destructor called when module configuration goes away.
 
static int jingle_digit_begin (struct ast_channel *chan, char digit)
 Function called by core to start a DTMF digit.
 
static int jingle_digit_end (struct ast_channel *ast, char digit, unsigned int duration)
 Function called by core to stop a DTMF digit.
 
static void jingle_enable_video (struct jingle_session *session)
 Internal helper function which enables video support on a sesson if possible.
 
static void * jingle_endpoint_alloc (const char *cat)
 Allocator function for Jingle endpoints.
 
static int jingle_endpoint_cmp (void *obj, void *arg, int flags)
 Comparator function for Jingle endpoints.
 
static void jingle_endpoint_destructor (void *obj)
 Destructor for Jingle endpoints.
 
static void * jingle_endpoint_find (struct ao2_container *tmp_container, const char *category)
 Find function for Jingle endpoints.
 
static int jingle_endpoint_hash (const void *obj, const int flags)
 Hashing function for Jingle endpoints.
 
static struct jingle_endpoint_statejingle_endpoint_state_create (void)
 Allocator function for Jingle endpoint state.
 
static void jingle_endpoint_state_destructor (void *obj)
 Destructor for Jingle endpoint state.
 
static struct jingle_endpoint_statejingle_endpoint_state_find_or_create (const char *category)
 State find/create function.
 
static int jingle_fixup (struct ast_channel *oldchan, struct ast_channel *newchan)
 Function called by core to change the underlying owner channel.
 
static void jingle_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 jingle_get_rtp_peer (struct ast_channel *chan, struct ast_rtp_instance **instance)
 Function called by RTP engine to get local RTP peer.
 
static int jingle_hangup (struct ast_channel *ast)
 Function called by core to hang up a Jingle session.
 
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.
 
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.
 
static int jingle_interpret_google_transport (struct jingle_session *session, iks *transport, struct ast_rtp_instance *rtp)
 Helper function which handles Google transport information.
 
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.
 
static struct ast_channeljingle_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.
 
static int jingle_outgoing_hook (void *data, ikspak *pak)
 Callback for when a response is received for an outgoing session-initiate message.
 
static void jingle_queue_hangup_with_cause (struct jingle_session *session, int cause)
 Helper function which queues a hangup frame with cause code.
 
static struct ast_framejingle_read (struct ast_channel *ast)
 Function called by core to read any waiting frames.
 
static struct ast_channeljingle_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)
 Asterisk core interaction functions. 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.
 
static void jingle_send_response (struct ast_xmpp_client *connection, ikspak *pak)
 Internal helper function which sends a response.
 
static void jingle_send_session_accept (struct jingle_session *session)
 Internal function which sends a session-accept message.
 
static void jingle_send_session_action (struct jingle_session *session, const char *action)
 Internal function which sends a complete session message.
 
static void jingle_send_session_info (struct jingle_session *session, const char *info)
 Internal function which sends a session-info message.
 
static void jingle_send_session_initiate (struct jingle_session *session)
 Internal function which sends a session-inititate message.
 
static void jingle_send_session_terminate (struct jingle_session *session, const char *reasontext)
 Internal function which sends a session-terminate message.
 
static void jingle_send_transport_info (struct jingle_session *session, const char *from)
 Internal function which sends a transport-info message.
 
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.
 
static int jingle_session_cmp (void *obj, void *arg, int flags)
 Comparator function for Jingle sessions.
 
static void jingle_session_destructor (void *obj)
 Destructor for Jingle sessions.
 
static int jingle_session_hash (const void *obj, const int flags)
 Hashing function for Jingle sessions.
 
static struct ast_channeljingle_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.
 
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.
 
static int jingle_write (struct ast_channel *ast, struct ast_frame *frame)
 Function called by core to write frames.
 
static int load_module (void)
 Load the module. More...
 
static int reload (void)
 Reload module.
 
static int unload_module (void)
 Unload the jingle channel from Asterisk.
 

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 = "da6642af068ee5e6490c5b1d2cc1d238" , .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_infoast_module_info = &__mod_info
 
static const char channel_type [] = "Motif"
 
static struct aco_type endpoint_option
 
struct aco_typeendpoint_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.
 
static struct ast_channel_tech jingle_tech
 PBX interface structure for channel registration.
 
static struct ast_sched_contextsched
 

Detailed Description

Motif Jingle Channel Driver.

Author
Joshua Colp jcolp.nosp@m.@dig.nosp@m.ium.c.nosp@m.om

Iksemel http://iksemel.jabberstudio.org/

Definition in file chan_motif.c.

Enumeration Type Documentation

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 

https://developers.google.com/talk/call_signaling

JINGLE_TRANSPORT_GOOGLE_V1 

Undocumented initial Google specification

JINGLE_TRANSPORT_NONE 

No transport specified

Definition at line 262 of file chan_motif.c.

262  {
263  JINGLE_TRANSPORT_ICE_UDP = 3, /*!< XEP-0176 */
264  JINGLE_TRANSPORT_GOOGLE_V2 = 2, /*!< https://developers.google.com/talk/call_signaling */
265  JINGLE_TRANSPORT_GOOGLE_V1 = 1, /*!< Undocumented initial Google specification */
266  JINGLE_TRANSPORT_NONE = 0, /*!< No transport specified */
267 };

Function Documentation

static void jingle_action_session_initiate ( struct jingle_endpoint endpoint,
struct jingle_session session,
ikspak *  pak 
)
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_hangup(), ast_pbx_start(), 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, jingle_endpoint_state::sessions, jingle_endpoint::state, and jingle_session::transport.

2391 {
2392  char *sid;
2393  enum jingle_transport transport = JINGLE_TRANSPORT_NONE;
2394  struct ast_channel *chan;
2395  int res;
2396 
2397  if (session) {
2398  /* This is a duplicate session setup, so respond accordingly */
2399  jingle_send_error_response(endpoint->connection, pak, "result", "out-of-order", NULL);
2400  return;
2401  }
2402 
2403  /* Retrieve the session identifier from the message, note that this may alter the transport */
2404  if ((sid = iks_find_attrib(pak->query, "id"))) {
2405  /* The presence of the session identifier in the 'id' attribute tells us that this is Google-V1 as everything else uses 'sid' */
2406  transport = JINGLE_TRANSPORT_GOOGLE_V1;
2407  } else if (!(sid = iks_find_attrib(pak->query, "sid"))) {
2408  jingle_send_error_response(endpoint->connection, pak, "bad-request", NULL, NULL);
2409  return;
2410  }
2411 
2412  /* Create a new local session */
2413  if (!(session = jingle_alloc(endpoint, pak->from->full, sid))) {
2414  jingle_send_error_response(endpoint->connection, pak, "cancel", "service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'", NULL);
2415  return;
2416  }
2417 
2418  /* If we determined that the transport should change as a result of how we got the SID change it */
2419  if (transport != JINGLE_TRANSPORT_NONE) {
2420  session->transport = transport;
2421  }
2422 
2423  /* Create a new Asterisk channel using the above local session */
2424  if (!(chan = jingle_new(endpoint, session, AST_STATE_DOWN, pak->from->user, NULL, NULL, pak->from->full))) {
2425  ao2_ref(session, -1);
2426  jingle_send_error_response(endpoint->connection, pak, "cancel", "service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'", NULL);
2427  return;
2428  }
2429 
2430  ao2_link(endpoint->state->sessions, session);
2431 
2432  ast_channel_lock(chan);
2434  ast_channel_unlock(chan);
2435  res = ast_pbx_start(chan);
2436 
2437  switch (res) {
2438  case AST_PBX_FAILED:
2439  ast_log(LOG_WARNING, "Failed to start PBX :(\n");
2440  jingle_send_error_response(endpoint->connection, pak, "cancel", "service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'", NULL);
2441  session->gone = 1;
2442  ast_hangup(chan);
2443  break;
2444  case AST_PBX_CALL_LIMIT:
2445  ast_log(LOG_WARNING, "Failed to start PBX (call limit reached) \n");
2446  jingle_send_error_response(endpoint->connection, pak, "wait", "resource-constraint xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'", NULL);
2447  ast_hangup(chan);
2448  break;
2449  case AST_PBX_SUCCESS:
2450  jingle_send_response(endpoint->connection, pak);
2451 
2452  /* Only send a transport-info message if we successfully interpreted the available content */
2453  if (!jingle_interpret_content(session, pak)) {
2454  jingle_send_transport_info(session, iks_find_attrib(pak->x, "from"));
2455  }
2456  break;
2457  }
2458 }
Main Channel structure associated with a channel.
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.
Definition: chan_motif.c:701
static void jingle_send_response(struct ast_xmpp_client *connection, ikspak *pak)
Internal helper function which sends a response.
Definition: chan_motif.c:864
enum ast_pbx_result ast_pbx_start(struct ast_channel *c)
Create a new thread and start the PBX.
Definition: pbx.c:4708
struct jingle_endpoint_state * state
Definition: chan_motif.c:292
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:459
jingle_transport
The various transport methods supported, from highest priority to lowest priority when doing fallback...
Definition: chan_motif.c:262
static int jingle_interpret_content(struct jingle_session *session, ikspak *pak)
Helper function which locates content stanzas and interprets them.
Definition: chan_motif.c:2279
unsigned int gone
Definition: chan_motif.c:317
void ast_hangup(struct ast_channel *chan)
Hang up a channel.
Definition: channel.c:2541
struct ast_xmpp_client * connection
Definition: chan_motif.c:284
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.
Definition: chan_motif.c:884
enum jingle_transport transport
Definition: chan_motif.c:304
int ast_setstate(struct ast_channel *chan, enum ast_channel_state)
Change the state of a channel.
Definition: channel.c:7386
static void jingle_send_transport_info(struct jingle_session *session, const char *from)
Internal function which sends a transport-info message.
Definition: chan_motif.c:1211
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.
Definition: chan_motif.c:768
struct ao2_container * sessions
Definition: chan_motif.c:271
#define ao2_link(container, obj)
Add an object to a container.
Definition: astobj2.h:1532
static int jingle_interpret_content ( struct jingle_session session,
ikspak *  pak 
)
static

Helper function which locates content stanzas and interprets them.

Note
The session must not be locked before calling this

Definition at line 2279 of file chan_motif.c.

References ao2_ref, ast_channel_unref, ast_format_cap_alloc, ast_format_cap_append_from_cap(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_format(), ast_set_read_format(), ast_set_write_format(), 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_TRANSPORT_GOOGLE_V1, jingle_session::jointcap, ast_channel::name, 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().

2280 {
2281  iks *content;
2282  unsigned int changed = 0;
2283  struct ast_channel *chan;
2284 
2285  /* Look at the content in the session initiation */
2286  for (content = iks_child(iks_child(pak->x)); content; content = iks_next(content)) {
2287  char *name;
2288  struct ast_rtp_instance *rtp = NULL;
2289  iks *description, *transport;
2290 
2291  /* Ignore specific parts if they are known not to be useful */
2292  if (!strcmp(iks_name(content), "conference-info")) {
2293  continue;
2294  }
2295 
2296  name = iks_find_attrib(content, "name");
2297 
2298  if (session->transport != JINGLE_TRANSPORT_GOOGLE_V1) {
2299  /* If this content stanza has no name consider it invalid and move on */
2300  if (ast_strlen_zero(name) && !(name = iks_find_attrib(content, "jin:name"))) {
2301  jingle_queue_hangup_with_cause(session, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
2302  ast_log(LOG_ERROR, "Received content without a name on session '%s'\n", session->sid);
2303  return -1;
2304  }
2305 
2306  /* Try to pre-populate which RTP instance this content is relevant to */
2307  if (!strcmp(session->audio_name, name)) {
2308  rtp = session->rtp;
2309  } else if (!strcmp(session->video_name, name)) {
2310  rtp = session->vrtp;
2311  }
2312  } else {
2313  /* Google-V1 has no concept of associating things like the above does, so since we only support audio over it assume they want audio */
2314  rtp = session->rtp;
2315  }
2316 
2317  /* If description information is available use it */
2318  if ((description = iks_find_with_attrib(content, "description", "xmlns", JINGLE_RTP_NS)) ||
2319  (description = iks_find_with_attrib(content, "rtp:description", "xmlns:rtp", JINGLE_RTP_NS)) ||
2320  (description = iks_find_with_attrib(content, "pho:description", "xmlns:pho", GOOGLE_PHONE_NS)) ||
2321  (description = iks_find_with_attrib(pak->query, "description", "xmlns", GOOGLE_PHONE_NS)) ||
2322  (description = iks_find_with_attrib(pak->query, "pho:description", "xmlns:pho", GOOGLE_PHONE_NS)) ||
2323  (description = iks_find_with_attrib(pak->query, "vid:description", "xmlns", GOOGLE_VIDEO_NS))) {
2324  /* If we failed to do something with the content description abort immediately */
2325  if (jingle_interpret_description(session, description, name, &rtp)) {
2326  return -1;
2327  }
2328 
2329  /* If we successfully interpret the description then the codecs need updating */
2330  changed = 1;
2331  }
2332 
2333  /* If we get past the description handling and we still don't know what RTP instance this is for... it is unknown content */
2334  if (!rtp) {
2335  ast_log(LOG_ERROR, "Received a content stanza but have no RTP instance for it on session '%s'\n", session->sid);
2336  jingle_queue_hangup_with_cause(session, AST_CAUSE_SWITCH_CONGESTION);
2337  return -1;
2338  }
2339 
2340  /* If ICE UDP transport information is available use it */
2341  if ((transport = iks_find_with_attrib(content, "transport", "xmlns", JINGLE_ICE_UDP_NS))) {
2342  if (jingle_interpret_ice_udp_transport(session, transport, rtp)) {
2343  return -1;
2344  }
2345  } else if ((transport = iks_find_with_attrib(content, "transport", "xmlns", GOOGLE_TRANSPORT_NS)) ||
2346  (transport = iks_find_with_attrib(content, "p:transport", "xmlns:p", GOOGLE_TRANSPORT_NS)) ||
2347  (transport = iks_find_with_attrib(pak->x, "session", "xmlns", GOOGLE_SESSION_NS)) ||
2348  (transport = iks_find_with_attrib(pak->x, "ses:session", "xmlns:ses", GOOGLE_SESSION_NS))) {
2349  /* If Google transport support is available use it */
2350  if (jingle_interpret_google_transport(session, transport, rtp)) {
2351  return -1;
2352  }
2353  } else if (iks_find(content, "transport")) {
2354  /* If this is a transport we do not support terminate the session as it probably won't work out in the end */
2355  jingle_queue_hangup_with_cause(session, AST_CAUSE_FACILITY_NOT_IMPLEMENTED);
2356  ast_log(LOG_ERROR, "Unsupported transport type received on session '%s'\n", session->sid);
2357  return -1;
2358  }
2359  }
2360 
2361  if (!changed) {
2362  return 0;
2363  }
2364 
2365  if ((chan = jingle_session_lock_full(session))) {
2366  struct ast_format_cap *caps;
2367  struct ast_format *fmt;
2368 
2370  if (caps) {
2371  ast_format_cap_append_from_cap(caps, session->jointcap, AST_MEDIA_TYPE_UNKNOWN);
2372  ast_channel_nativeformats_set(chan, caps);
2373  ao2_ref(caps, -1);
2374  }
2375 
2376  fmt = ast_format_cap_get_format(session->jointcap, 0);
2377  ast_set_read_format(chan, fmt);
2378  ast_set_write_format(chan, fmt);
2379  ao2_ref(fmt, -1);
2380 
2381  ast_channel_unlock(chan);
2382  ast_channel_unref(chan);
2383  }
2384  ao2_unlock(session);
2385 
2386  return 0;
2387 }
const ast_string_field audio_name
Definition: chan_motif.c:301
const ast_string_field sid
Definition: chan_motif.c:301
Main Channel structure associated with a channel.
static int jingle_interpret_google_transport(struct jingle_session *session, iks *transport, struct ast_rtp_instance *rtp)
Helper function which handles Google transport information.
Definition: chan_motif.c:2201
#define GOOGLE_TRANSPORT_NS
Namespace for Google Talk ICE-UDP.
Definition: chan_motif.c:244
#define ast_channel_unref(c)
Decrease channel reference count.
Definition: channel.h:2958
#define GOOGLE_PHONE_NS
Namespace for Google Phone description.
Definition: chan_motif.c:253
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.
Definition: chan_motif.c:2120
Definition of a media format.
Definition: format.c:43
struct ast_format_cap * jointcap
Definition: chan_motif.c:314
struct ast_rtp_instance * rtp
Definition: chan_motif.c:311
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.
Definition: chan_motif.c:2033
int ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
Definition: channel.c:5762
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:459
int ast_set_write_format(struct ast_channel *chan, struct ast_format *format)
Sets write format on channel chan.
Definition: channel.c:5803
#define ast_format_cap_alloc(flags)
Allocate a new ast_format_cap structure.
Definition: format_cap.h:49
static void jingle_queue_hangup_with_cause(struct jingle_session *session, int cause)
Helper function which queues a hangup frame with cause code.
Definition: chan_motif.c:1197
Format capabilities structure, holds formats + preference order + etc.
Definition: format_cap.c:54
struct ast_rtp_instance * vrtp
Definition: chan_motif.c:312
const ast_string_field name
#define JINGLE_RTP_NS
Namespace for Jingle RTP sessions.
Definition: chan_motif.c:235
#define GOOGLE_VIDEO_NS
Namespace for Google Video description.
Definition: chan_motif.c:256
enum jingle_transport transport
Definition: chan_motif.c:304
#define JINGLE_ICE_UDP_NS
Namespace for Jingle ICE-UDP.
Definition: chan_motif.c:241
int ast_format_cap_append_from_cap(struct ast_format_cap *dst, const struct ast_format_cap *src, enum ast_media_type type)
Append the formats of provided type in src to dst.
Definition: format_cap.c:269
#define GOOGLE_SESSION_NS
Namespace for Google Session.
Definition: chan_motif.c:250
struct ast_format * ast_format_cap_get_format(const struct ast_format_cap *cap, int position)
Get the format at a specific index.
Definition: format_cap.c:400
const ast_string_field video_name
Definition: chan_motif.c:301
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 
)
static

Asterisk core interaction functions.

Function called by core to create a new outgoing Jingle session.

Definition at line 1904 of file chan_motif.c.

References ao2_global_obj_ref, ao2_iterator_destroy(), ao2_iterator_init(), ao2_link, ao2_ref, AST_APP_ARG, ast_copy_string(), AST_DECLARE_APP_ARGS, ast_format_cap_has_type(), AST_NONSTANDARD_APP_ARGS, ast_rtp_instance_get_ice(), AST_STATE_DOWN, ast_strdupa, ast_xmpp_resource::caps, ast_channel::dialed, 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, OBJ_KEY, RAII_VAR, ast_xmpp_resource::resource, ast_xmpp_buddy::resources, jingle_session::rtp, jingle_session::transport, and jingle_session::vrtp.

1905 {
1906  RAII_VAR(struct jingle_config *, cfg, ao2_global_obj_ref(globals), ao2_cleanup);
1907  RAII_VAR(struct jingle_endpoint *, endpoint, NULL, ao2_cleanup);
1908  char *dialed, target[1024] = "";
1909  struct ast_xmpp_buddy *buddy;
1910  struct jingle_session *session;
1911  struct ast_channel *chan;
1912  enum jingle_transport transport = JINGLE_TRANSPORT_NONE;
1913  struct ast_rtp_engine_ice *ice;
1914  AST_DECLARE_APP_ARGS(args,
1915  AST_APP_ARG(name);
1916  AST_APP_ARG(target);
1917  );
1918 
1919  /* We require at a minimum one audio format to be requested */
1920  if (!ast_format_cap_has_type(cap, AST_MEDIA_TYPE_AUDIO)) {
1921  ast_log(LOG_ERROR, "Motif channel driver requires an audio format when dialing a destination\n");
1922  *cause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL;
1923  return NULL;
1924  }
1925 
1926  if (ast_strlen_zero(data) || !(dialed = ast_strdupa(data))) {
1927  ast_log(LOG_ERROR, "Unable to create channel with empty destination.\n");
1928  *cause = AST_CAUSE_CHANNEL_UNACCEPTABLE;
1929  return NULL;
1930  }
1931 
1932  /* Parse the given dial string and validate the results */
1933  AST_NONSTANDARD_APP_ARGS(args, dialed, '/');
1934 
1935  if (ast_strlen_zero(args.name) || ast_strlen_zero(args.target)) {
1936  ast_log(LOG_ERROR, "Unable to determine endpoint name and target.\n");
1937  *cause = AST_CAUSE_CHANNEL_UNACCEPTABLE;
1938  return NULL;
1939  }
1940 
1941  if (!(endpoint = jingle_endpoint_find(cfg->endpoints, args.name))) {
1942  ast_log(LOG_ERROR, "Endpoint '%s' does not exist.\n", args.name);
1943  *cause = AST_CAUSE_CHANNEL_UNACCEPTABLE;
1944  return NULL;
1945  }
1946 
1947  ao2_lock(endpoint->state);
1948 
1949  /* If we don't have a connection for the endpoint we can't exactly start a session on it */
1950  if (!endpoint->connection) {
1951  ast_log(LOG_ERROR, "Unable to create Jingle session on endpoint '%s' as no valid connection exists\n", args.name);
1952  *cause = AST_CAUSE_SWITCH_CONGESTION;
1953  ao2_unlock(endpoint->state);
1954  return NULL;
1955  }
1956 
1957  /* Find the target in the roster so we can choose a resource */
1958  if ((buddy = ao2_find(endpoint->connection->buddies, args.target, OBJ_KEY))) {
1959  struct ao2_iterator res;
1960  struct ast_xmpp_resource *resource;
1961 
1962  /* Iterate through finding the first viable Jingle capable resource */
1963  res = ao2_iterator_init(buddy->resources, 0);
1964  while ((resource = ao2_iterator_next(&res))) {
1965  if (resource->caps.jingle) {
1966  snprintf(target, sizeof(target), "%s/%s", args.target, resource->resource);
1967  transport = JINGLE_TRANSPORT_ICE_UDP;
1968  break;
1969  } else if (resource->caps.google) {
1970  snprintf(target, sizeof(target), "%s/%s", args.target, resource->resource);
1971  transport = JINGLE_TRANSPORT_GOOGLE_V2;
1972  break;
1973  }
1974  ao2_ref(resource, -1);
1975  }
1976  ao2_iterator_destroy(&res);
1977 
1978  ao2_ref(buddy, -1);
1979  } else {
1980  /* If the target is NOT in the roster use the provided target as-is */
1981  ast_copy_string(target, args.target, sizeof(target));
1982  }
1983 
1984  ao2_unlock(endpoint->state);
1985 
1986  /* If no target was found we can't set up a session */
1987  if (ast_strlen_zero(target)) {
1988  ast_log(LOG_ERROR, "Unable to create Jingle session on endpoint '%s' as no capable resource for target '%s' was found\n", args.name, args.target);
1989  *cause = AST_CAUSE_SWITCH_CONGESTION;
1990  return NULL;
1991  }
1992 
1993  if (!(session = jingle_alloc(endpoint, target, NULL))) {
1994  ast_log(LOG_ERROR, "Unable to create Jingle session on endpoint '%s'\n", args.name);
1995  *cause = AST_CAUSE_SWITCH_CONGESTION;
1996  return NULL;
1997  }
1998 
1999  /* Update the transport if we learned what we should actually use */
2000  if (transport != JINGLE_TRANSPORT_NONE) {
2001  session->transport = transport;
2002  /* Note that for Google-V1 and Google-V2 we don't stop built-in ICE support, this will happen in jingle_new */
2003  }
2004 
2005  if (!(chan = jingle_new(endpoint, session, AST_STATE_DOWN, target, assignedids, requestor, NULL))) {
2006  ast_log(LOG_ERROR, "Unable to create Jingle channel on endpoint '%s'\n", args.name);
2007  *cause = AST_CAUSE_SWITCH_CONGESTION;
2008  ao2_ref(session, -1);
2009  return NULL;
2010  }
2011 
2012  /* If video was requested try to enable it on the session */
2013  if (ast_format_cap_has_type(cap, AST_MEDIA_TYPE_VIDEO)) {
2014  jingle_enable_video(session);
2015  }
2016 
2017  /* As this is outgoing set ourselves as controlling */
2018  if (session->rtp && (ice = ast_rtp_instance_get_ice(session->rtp))) {
2019  ice->ice_lite(session->rtp);
2020  }
2021 
2022  if (session->vrtp && (ice = ast_rtp_instance_get_ice(session->vrtp))) {
2023  ice->ice_lite(session->vrtp);
2024  }
2025 
2026  /* We purposely don't decrement the session here as there is a reference on the channel */
2027  ao2_link(endpoint->state->sessions, session);
2028 
2029  return chan;
2030 }
Main Channel structure associated with a channel.
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.
Definition: chan_motif.c:701
static void jingle_enable_video(struct jingle_session *session)
Internal helper function which enables video support on a sesson if possible.
Definition: chan_motif.c:668
#define OBJ_KEY
Definition: astobj2.h:1151
struct ast_rtp_engine_ice * ast_rtp_instance_get_ice(struct ast_rtp_instance *instance)
Obtain a pointer to the ICE support present on an RTP instance.
Definition: rtp_engine.c:3039
char resource[XMPP_MAX_RESJIDLEN]
Definition: xmpp.h:93
#define ao2_global_obj_ref(holder)
Get a reference to the object stored in the global holder.
Definition: astobj2.h:918
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
Session which contains information about an active session.
Definition: chan_motif.c:296
struct ast_rtp_instance * rtp
Definition: chan_motif.c:311
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: astmm.h:298
unsigned int google
Definition: xmpp.h:88
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
Definition: astobj2.h:459
jingle_transport
The various transport methods supported, from highest priority to lowest priority when doing fallback...
Definition: chan_motif.c:262
XMPP Resource.
Definition: xmpp.h:92
Endpoint which contains configuration information and active sessions.
Definition: chan_motif.c:275
static void * jingle_endpoint_find(struct ao2_container *tmp_container, const char *category)
Find function for Jingle endpoints.
Definition: chan_motif.c:460
struct ast_rtp_instance * vrtp
Definition: chan_motif.c:312
unsigned int jingle
Definition: xmpp.h:87
#define AST_NONSTANDARD_APP_ARGS(args, parse, sep)
Performs the 'nonstandard' argument separation process for an application.
XMPP Buddy.
Definition: xmpp.h:112
struct ao2_container * resources
Definition: xmpp.h:114
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Definition: astobj2.h:1821
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:425
enum jingle_transport transport
Definition: chan_motif.c:304
Structure that represents the optional ICE support within an RTP engine.
Definition: rtp_engine.h:536
struct ast_xmpp_capabilities caps
Definition: xmpp.h:97
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.
Definition: chan_motif.c:768
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:941
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
int ast_format_cap_has_type(const struct ast_format_cap *cap, enum ast_media_type type)
Find out if the capabilities structure has any formats of a specific type.
Definition: format_cap.c:613
#define AST_APP_ARG(name)
Define an application argument.
void(* ice_lite)(struct ast_rtp_instance *instance)
Definition: rtp_engine.h:552
#define ao2_link(container, obj)
Add an object to a container.
Definition: astobj2.h:1532
static int load_module ( void  )
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 jingle_endpoint::accountcode, aco_info_destroy(), aco_info_init(), aco_option_register, aco_option_register_custom, aco_process_config(), ao2_global_obj_release, ast_channel_register(), ast_format_cap_alloc, ast_format_cap_append_by_type(), AST_FORMAT_CAP_FLAG_DEFAULT, AST_MODULE_LOAD_DECLINE, ast_rtp_glue_unregister(), ast_sched_context_create(), ast_sched_context_destroy(), ast_sched_start_thread(), jingle_endpoint::cap, ast_channel_tech::capabilities, jingle_endpoint::context, custom_connection_handler(), custom_group_handler(), custom_transport_handler(), DEFAULT_MAX_ICE_CANDIDATES, DEFAULT_MAX_PAYLOADS, FLDSET, jingle_endpoint::language, jingle_endpoint::maxicecandidates, jingle_endpoint::maxpayloads, jingle_endpoint::musicclass, OPT_CODEC_T, OPT_STRINGFIELD_T, OPT_UINT_T, jingle_endpoint::parkinglot, and STRFLDSET.

2728 {
2730  return AST_MODULE_LOAD_DECLINE;
2731  }
2732 
2733  if (aco_info_init(&cfg_info)) {
2734  ast_log(LOG_ERROR, "Unable to intialize configuration for chan_motif.\n");
2735  goto end;
2736  }
2737 
2738  aco_option_register(&cfg_info, "context", ACO_EXACT, endpoint_options, "default", OPT_STRINGFIELD_T, 0, STRFLDSET(struct jingle_endpoint, context));
2739  aco_option_register_custom(&cfg_info, "callgroup", ACO_EXACT, endpoint_options, NULL, custom_group_handler, 0);
2740  aco_option_register_custom(&cfg_info, "pickupgroup", ACO_EXACT, endpoint_options, NULL, custom_group_handler, 0);
2741  aco_option_register(&cfg_info, "language", ACO_EXACT, endpoint_options, NULL, OPT_STRINGFIELD_T, 0, STRFLDSET(struct jingle_endpoint, language));
2742  aco_option_register(&cfg_info, "musicclass", ACO_EXACT, endpoint_options, NULL, OPT_STRINGFIELD_T, 0, STRFLDSET(struct jingle_endpoint, musicclass));
2743  aco_option_register(&cfg_info, "parkinglot", ACO_EXACT, endpoint_options, NULL, OPT_STRINGFIELD_T, 0, STRFLDSET(struct jingle_endpoint, parkinglot));
2744  aco_option_register(&cfg_info, "accountcode", ACO_EXACT, endpoint_options, NULL, OPT_STRINGFIELD_T, 0, STRFLDSET(struct jingle_endpoint, accountcode));
2745  aco_option_register(&cfg_info, "allow", ACO_EXACT, endpoint_options, "ulaw,alaw", OPT_CODEC_T, 1, FLDSET(struct jingle_endpoint, cap));
2746  aco_option_register(&cfg_info, "disallow", ACO_EXACT, endpoint_options, "all", OPT_CODEC_T, 0, FLDSET(struct jingle_endpoint, cap));
2747  aco_option_register_custom(&cfg_info, "connection", ACO_EXACT, endpoint_options, NULL, custom_connection_handler, 0);
2748  aco_option_register_custom(&cfg_info, "transport", ACO_EXACT, endpoint_options, NULL, custom_transport_handler, 0);
2749  aco_option_register(&cfg_info, "maxicecandidates", ACO_EXACT, endpoint_options, DEFAULT_MAX_ICE_CANDIDATES, OPT_UINT_T, PARSE_DEFAULT,
2750  FLDSET(struct jingle_endpoint, maxicecandidates), DEFAULT_MAX_ICE_CANDIDATES);
2751  aco_option_register(&cfg_info, "maxpayloads", ACO_EXACT, endpoint_options, DEFAULT_MAX_PAYLOADS, OPT_UINT_T, PARSE_DEFAULT,
2752  FLDSET(struct jingle_endpoint, maxpayloads), DEFAULT_MAX_PAYLOADS);
2753 
2755 
2756  if (aco_process_config(&cfg_info, 0)) {
2757  ast_log(LOG_ERROR, "Unable to read config file motif.conf. Module loaded but not running.\n");
2758  aco_info_destroy(&cfg_info);
2759  ao2_cleanup(jingle_tech.capabilities);
2760  jingle_tech.capabilities = NULL;
2761  return AST_MODULE_LOAD_DECLINE;
2762  }
2763 
2764  if (!(sched = ast_sched_context_create())) {
2765  ast_log(LOG_ERROR, "Unable to create scheduler context.\n");
2766  goto end;
2767  }
2768 
2770  ast_log(LOG_ERROR, "Unable to create scheduler context thread.\n");
2771  goto end;
2772  }
2773 
2774  ast_rtp_glue_register(&jingle_rtp_glue);
2775 
2777  ast_log(LOG_ERROR, "Unable to register channel class %s\n", channel_type);
2778  goto end;
2779  }
2780 
2781  return 0;
2782 
2783 end:
2785 
2786  if (sched) {
2788  }
2789 
2790  aco_info_destroy(&cfg_info);
2791  ao2_global_obj_release(globals);
2792 
2793  ao2_cleanup(jingle_tech.capabilities);
2794  jingle_tech.capabilities = NULL;
2795 
2796  return AST_MODULE_LOAD_DECLINE;
2797 }
int ast_sched_start_thread(struct ast_sched_context *con)
Start a thread for processing scheduler entries.
Definition: sched.c:197
Type for default option handler for format capabilities.
static struct ast_channel_tech jingle_tech
PBX interface structure for channel registration.
Definition: chan_motif.c:353
#define aco_option_register_custom(info, name, matchtype, types, default_val, handler, flags)
Register a config option.
#define DEFAULT_MAX_ICE_CANDIDATES
Default maximum number of ICE candidates we will offer.
Definition: chan_motif.c:220
#define aco_option_register(info, name, matchtype, types, default_val, opt_type, flags,...)
Register a config option.
Definition: sched.c:76
enum aco_process_status aco_process_config(struct aco_info *info, int reload)
Process a config info via the options registered with an aco_info.
int ast_format_cap_append_by_type(struct ast_format_cap *cap, enum ast_media_type type)
Add all codecs Asterisk knows about for a specific type to the capabilities structure.
Definition: format_cap.c:216
int ast_channel_register(const struct ast_channel_tech *tech)
Register a channel technology (a new channel driver) Called by a channel module to register the kind ...
Definition: channel.c:539
#define FLDSET(type,...)
Convert a struct and list of fields to an argument list of field offsets.
int aco_info_init(struct aco_info *info)
Initialize an aco_info structure.
Type for default option handler for unsigned integers.
#define ast_format_cap_alloc(flags)
Allocate a new ast_format_cap structure.
Definition: format_cap.h:49
struct ast_sched_context * ast_sched_context_create(void)
Create a scheduler context.
Definition: sched.c:238
Endpoint which contains configuration information and active sessions.
Definition: chan_motif.c:275
void aco_info_destroy(struct aco_info *info)
Destroy an initialized aco_info struct.
#define ao2_global_obj_release(holder)
Release the ao2 object held in the global holder.
Definition: astobj2.h:859
static int custom_group_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
Custom handler for groups.
Definition: chan_motif.c:2658
struct ast_format_cap * capabilities
Definition: channel.h:632
#define STRFLDSET(type,...)
Convert a struct and a list of stringfield fields to an argument list of field offsets.
Module has failed to load, may be in an inconsistent state.
Definition: module.h:78
static struct ast_rtp_glue jingle_rtp_glue
Local glue for interacting with the RTP engine core.
Definition: chan_motif.c:648
#define DEFAULT_MAX_PAYLOADS
Default maximum number of payloads we will offer.
Definition: chan_motif.c:223
int ast_rtp_glue_unregister(struct ast_rtp_glue *glue)
Unregister RTP glue.
Definition: rtp_engine.c:408
Type for default option handler for stringfields.
static int custom_connection_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
Custom handler for connection.
Definition: chan_motif.c:2674
static int custom_transport_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
Custom handler for transport.
Definition: chan_motif.c:2699
void ast_sched_context_destroy(struct ast_sched_context *c)
destroys a schedule context
Definition: sched.c:271

Variable Documentation

struct aco_file jingle_conf
Initial value:
= {
.filename = "motif.conf",
.types = ACO_TYPES(&endpoint_option),
}
#define ACO_TYPES(...)
A helper macro to ensure that aco_info types always have a sentinel.

Definition at line 555 of file chan_motif.c.

struct ast_sched_context* sched
static

Scheduling context for RTCP

Definition at line 329 of file chan_motif.c.