47#include <sys/socket.h>
50#include <netinet/in.h>
220#define DEFAULT_MAX_ICE_CANDIDATES "10"
223#define DEFAULT_MAX_PAYLOADS "30"
226#define ENDPOINT_BUCKETS 37
229#define SESSION_BUCKETS 37
232#define JINGLE_NS "urn:xmpp:jingle:1"
235#define JINGLE_RTP_NS "urn:xmpp:jingle:apps:rtp:1"
238#define JINGLE_RTP_INFO_NS "urn:xmpp:jingle:apps:rtp:info:1"
241#define JINGLE_ICE_UDP_NS "urn:xmpp:jingle:transports:ice-udp:1"
244#define GOOGLE_TRANSPORT_NS "http://www.google.com/transport/p2p"
247#define GOOGLE_TRANSPORT_RAW_NS "http://www.google.com/transport/raw-udp"
250#define GOOGLE_SESSION_NS "http://www.google.com/session"
253#define GOOGLE_PHONE_NS "http://www.google.com/session/phone"
256#define GOOGLE_VIDEO_NS "http://www.google.com/session/video"
259#define XMPP_STANZAS_NS "urn:ietf:params:xml:ns:xmpp-stanzas"
355 .description =
"Motif Jingle Channel Driver",
418 const char *
sid = obj;
427 const char *
sid = arg;
445 if (endpoint->
rule) {
476 if (!
state->sessions) {
495 return endpoint->state;
529 const char *
name = obj;
538 const char *
name = arg;
547 .category =
"general",
566 iks_filter_remove_rule(
session->connection->filter,
session->rule);
784 if (!(chan =
ast_channel_alloc_with_endpoint(1,
state,
S_OR(title,
""),
S_OR(cid_name,
""),
"",
"",
"", assignedids, requestor, 0, endpoint->
connection->
endpoint,
"Motif/%s-%04lx",
str, (
unsigned long)(
ast_random() & 0xffff)))) {
836 ast_channel_accountcode_set(chan, endpoint->
accountcode);
840 ast_channel_language_set(chan, endpoint->
language);
844 ast_channel_musicclass_set(chan, endpoint->
musicclass);
868 if (!(response = iks_new(
"iq"))) {
873 iks_insert_attrib(response,
"type",
"result");
874 iks_insert_attrib(response,
"from", connection->
jid->full);
875 iks_insert_attrib(response,
"to", iks_find_attrib(pak->x,
"from"));
876 iks_insert_attrib(response,
"id", iks_find_attrib(pak->x,
"id"));
880 iks_delete(response);
888 if (!(response = iks_new(
"iq")) ||
889 !(
error = iks_new(
"error")) ||
890 !(reason = iks_new(reasonstr))) {
895 iks_insert_attrib(response,
"type",
"error");
896 iks_insert_attrib(response,
"from", connection->
jid->full);
897 iks_insert_attrib(response,
"to", iks_find_attrib(pak->x,
"from"));
898 iks_insert_attrib(response,
"id", iks_find_attrib(pak->x,
"id"));
901 iks_insert_node(
error, reason);
904 iks_insert_node(
error, reason2);
907 iks_insert_node(response,
error);
914 iks_delete(response);
927 ast_log(
LOG_ERROR,
"Unable to add ICE-UDP candidates as ICE support not available or no candidates available\n");
938 iks *local_candidate;
941 if (!(local_candidate = iks_new(
"candidate"))) {
943 ast_log(
LOG_ERROR,
"Unable to allocate IKS candidate stanza for ICE-UDP transport\n");
947 snprintf(
tmp,
sizeof(
tmp),
"%u", candidate->
id);
948 iks_insert_attrib(local_candidate,
"component",
tmp);
950 iks_insert_attrib(local_candidate,
"foundation",
tmp);
951 iks_insert_attrib(local_candidate,
"generation",
"0");
952 iks_insert_attrib(local_candidate,
"network",
"0");
953 snprintf(
tmp,
sizeof(
tmp),
"%04lx", (
unsigned long)(
ast_random() & 0xffff));
954 iks_insert_attrib(local_candidate,
"id",
tmp);
958 iks_insert_attrib(local_candidate,
"priority",
tmp);
959 iks_insert_attrib(local_candidate,
"protocol",
"udp");
962 iks_insert_attrib(local_candidate,
"type",
"host");
964 iks_insert_attrib(local_candidate,
"type",
"srflx");
966 iks_insert_attrib(local_candidate,
"type",
"relay");
969 iks_insert_node(
transport, local_candidate);
970 candidates[i++] = local_candidate;
989 ast_log(
LOG_ERROR,
"Unable to add Google ICE candidates as ICE support not available or no candidates available\n");
1000 iks *local_candidate;
1002 char ufrag[17] =
"";
1004 if (!(local_candidate = iks_new(
"candidate"))) {
1006 ast_log(
LOG_ERROR,
"Unable to allocate IKS candidate stanza for Google ICE transport\n");
1010 if (candidate->
id == 1) {
1011 iks_insert_attrib(local_candidate,
"name", !video ?
"rtp" :
"video_rtp");
1012 }
else if (candidate->
id == 2) {
1013 iks_insert_attrib(local_candidate,
"name", !video ?
"rtcp" :
"video_rtcp");
1015 iks_delete(local_candidate);
1023 iks_insert_attrib(local_candidate,
"preference",
"0.95");
1024 iks_insert_attrib(local_candidate,
"type",
"local");
1026 iks_insert_attrib(local_candidate,
"preference",
"0.9");
1027 iks_insert_attrib(local_candidate,
"type",
"stun");
1030 iks_insert_attrib(local_candidate,
"protocol",
"udp");
1031 iks_insert_attrib(local_candidate,
"network",
"0");
1032 snprintf(ufrag,
sizeof(ufrag),
"%s", ice->
get_ufrag(rtp));
1033 iks_insert_attrib(local_candidate,
"username", ufrag);
1034 iks_insert_attrib(local_candidate,
"generation",
"0");
1037 iks_insert_attrib(local_candidate,
"password",
"");
1038 iks_insert_attrib(local_candidate,
"foundation",
"0");
1039 iks_insert_attrib(local_candidate,
"component",
"1");
1041 iks_insert_attrib(local_candidate,
"password", ice->
get_password(rtp));
1047 iks_insert_node(
transport, local_candidate);
1048 candidates[i++] = local_candidate;
1052 ao2_ref(local_candidates, -1);
1063 !(reason = iks_new(
"reason")) || !(
text = iks_new(reasontext))) {
1064 ast_log(
LOG_ERROR,
"Failed to allocate stanzas for session-terminate message on session '%s'\n",
session->sid);
1068 iks_insert_attrib(iq,
"to",
session->remote);
1069 iks_insert_attrib(iq,
"type",
"set");
1070 iks_insert_attrib(iq,
"id",
session->connection->mid);
1074 iks_insert_attrib(jingle,
"type",
"terminate");
1075 iks_insert_attrib(jingle,
"id",
session->sid);
1077 iks_insert_attrib(jingle,
"initiator",
session->outgoing ?
session->connection->jid->full :
session->remote);
1079 iks_insert_attrib(jingle,
"action",
"session-terminate");
1080 iks_insert_attrib(jingle,
"sid",
session->sid);
1081 iks_insert_attrib(jingle,
"xmlns",
JINGLE_NS);
1084 iks_insert_node(iq, jingle);
1085 iks_insert_node(jingle, reason);
1086 iks_insert_node(reason,
text);
1107 if (!(iq = iks_new(
"iq")) || !(jingle = iks_new(
"jingle")) || !(
text = iks_new(
info))) {
1112 iks_insert_attrib(iq,
"to",
session->remote);
1113 iks_insert_attrib(iq,
"type",
"set");
1114 iks_insert_attrib(iq,
"id",
session->connection->mid);
1117 iks_insert_attrib(jingle,
"action",
"session-info");
1118 iks_insert_attrib(jingle,
"sid",
session->sid);
1119 iks_insert_attrib(jingle,
"xmlns",
JINGLE_NS);
1120 iks_insert_node(iq, jingle);
1121 iks_insert_node(jingle,
text);
1177 if (pvt->
owner == chan) {
1213 iks *iq, *jingle =
NULL, *audio =
NULL, *audio_transport =
NULL, *video =
NULL, *video_transport =
NULL;
1214 iks *audio_candidates[
session->maxicecandidates], *video_candidates[
session->maxicecandidates];
1217 if (!(iq = iks_new(
"iq")) ||
1221 ast_log(
LOG_ERROR,
"Failed to allocate stanzas for transport-info message, hanging up session '%s'\n",
session->sid);
1225 memset(audio_candidates, 0,
sizeof(audio_candidates));
1226 memset(video_candidates, 0,
sizeof(video_candidates));
1228 iks_insert_attrib(iq,
"from",
session->connection->jid->full);
1229 iks_insert_attrib(iq,
"to", from);
1230 iks_insert_attrib(iq,
"type",
"set");
1231 iks_insert_attrib(iq,
"id",
session->connection->mid);
1235 iks_insert_attrib(jingle,
"type",
"candidates");
1236 iks_insert_attrib(jingle,
"id",
session->sid);
1238 iks_insert_attrib(jingle,
"initiator",
session->outgoing ?
session->connection->jid->full : from);
1240 iks_insert_attrib(jingle,
"action",
"transport-info");
1241 iks_insert_attrib(jingle,
"sid",
session->sid);
1242 iks_insert_attrib(jingle,
"xmlns",
JINGLE_NS);
1244 iks_insert_node(iq, jingle);
1250 }
else if ((audio = iks_new(
"content")) && (audio_transport = iks_new(
"transport"))) {
1251 iks_insert_attrib(audio,
"creator",
session->outgoing ?
"initiator" :
"responder");
1252 iks_insert_attrib(audio,
"name",
session->audio_name);
1253 iks_insert_node(jingle, audio);
1254 iks_insert_node(audio, audio_transport);
1268 if ((video = iks_new(
"content")) && (video_transport = iks_new(
"transport"))) {
1269 iks_insert_attrib(video,
"creator",
session->outgoing ?
"initiator" :
"responder");
1270 iks_insert_attrib(video,
"name",
session->video_name);
1271 iks_insert_node(jingle, video);
1272 iks_insert_node(video, video_transport);
1292 for (i = 0; i <
session->maxicecandidates; i++) {
1293 iks_delete(video_candidates[i]);
1294 iks_delete(audio_candidates[i]);
1297 iks_delete(video_transport);
1299 iks_delete(audio_transport);
1308 int x = 0, i = 0, res = 0;
1322 (!(payload = iks_new(
"payload-type")))) {
1331 snprintf(
tmp,
sizeof(
tmp),
"%d", rtp_code);
1332 iks_insert_attrib(payload,
"id",
tmp);
1334 iks_insert_attrib(payload,
"channels",
"1");
1338 iks_insert_attrib(payload,
"clockrate",
"16000");
1341 iks_insert_attrib(payload,
"clockrate",
tmp);
1348 if ((parameter = iks_new(
"parameter"))) {
1349 iks_insert_attrib(parameter,
"name",
"width");
1350 iks_insert_attrib(parameter,
"value",
"640");
1351 iks_insert_node(payload, parameter);
1353 if ((parameter = iks_new(
"parameter"))) {
1354 iks_insert_attrib(parameter,
"name",
"height");
1355 iks_insert_attrib(parameter,
"value",
"480");
1356 iks_insert_node(payload, parameter);
1358 if ((parameter = iks_new(
"parameter"))) {
1359 iks_insert_attrib(parameter,
"name",
"framerate");
1360 iks_insert_attrib(parameter,
"value",
"30");
1361 iks_insert_node(payload, parameter);
1365 iks_insert_node(description, payload);
1366 payloads[i++] = payload;
1374 if ((payload = iks_new(
"payload-type"))) {
1379 iks_insert_attrib(payload,
"id",
"101");
1380 iks_insert_attrib(payload,
"name",
"telephone-event");
1381 iks_insert_attrib(payload,
"channels",
"1");
1382 iks_insert_attrib(payload,
"clockrate",
"8000");
1383 iks_insert_node(description, payload);
1384 payloads[i++] = payload;
1398 iks_insert_attrib(content,
"creator",
session->outgoing ?
"initiator" :
"responder");
1399 iks_insert_attrib(content,
"name",
name);
1400 iks_insert_node(jingle, content);
1404 iks_insert_attrib(description,
"media",
"audio");
1406 iks_insert_attrib(description,
"media",
"video");
1410 iks_insert_node(content, description);
1413 iks_insert_node(jingle, description);
1419 iks_insert_node(content, transport);
1422 iks_insert_node(content, transport);
1432 iks *iq, *jingle, *audio =
NULL, *audio_description =
NULL, *video =
NULL, *video_description =
NULL;
1433 iks *audio_payloads[
session->maxpayloads], *video_payloads[
session->maxpayloads];
1434 iks *audio_transport =
NULL, *video_transport =
NULL;
1437 if (!(iq = iks_new(
"iq")) ||
1444 memset(audio_payloads, 0,
sizeof(audio_payloads));
1445 memset(video_payloads, 0,
sizeof(video_payloads));
1447 iks_insert_attrib(iq,
"from",
session->connection->jid->full);
1448 iks_insert_attrib(iq,
"to",
session->remote);
1449 iks_insert_attrib(iq,
"type",
"set");
1450 iks_insert_attrib(iq,
"id",
session->connection->mid);
1454 iks_insert_attrib(jingle,
"type", action);
1455 iks_insert_attrib(jingle,
"id",
session->sid);
1458 iks_insert_attrib(jingle,
"action", action);
1459 iks_insert_attrib(jingle,
"sid",
session->sid);
1460 iks_insert_attrib(jingle,
"xmlns",
JINGLE_NS);
1463 if (!strcasecmp(action,
"session-initiate") || !strcasecmp(action,
"initiate") || !strcasecmp(action,
"accept")) {
1464 iks_insert_attrib(jingle,
"initiator",
session->outgoing ?
session->connection->jid->full :
session->remote);
1467 iks_insert_node(iq, jingle);
1469 if (
session->rtp && (audio = iks_new(
"content")) && (audio_description = iks_new(
"description")) &&
1470 (audio_transport = iks_new(
"transport"))) {
1479 if ((video = iks_new(
"content")) && (video_description = iks_new(
"description")) &&
1480 (video_transport = iks_new(
"transport"))) {
1495 iks_delete(video_transport);
1496 iks_delete(audio_transport);
1498 for (i = 0; i <
session->maxpayloads; i++) {
1499 iks_delete(video_payloads[i]);
1500 iks_delete(audio_payloads[i]);
1503 iks_delete(video_description);
1505 iks_delete(audio_description);
1527 iks *
error = iks_find(pak->x,
"error"), *redirect;
1530 iks_filter_remove_rule(
session->connection->filter,
session->rule);
1556 iks *to = iks_child(redirect);
1561 if (!strncmp(target,
"xmpp:", 5)) {
1570 IKS_RULE_ID,
session->connection->mid, IKS_RULE_DONE);
1605 IKS_RULE_ID,
session->connection->mid, IKS_RULE_DONE);
1621 return IKS_FILTER_EAT;
1673 ast_debug(1,
"Bogus frame of format '%s' received from '%s'!\n",
1680 ast_debug(1,
"Oooh, format changed to %s\n",
1709 "Asked to transmit frame type %s, while native formats is %s (read/write = %s/%s)\n",
1754 switch (condition) {
1861 IKS_RULE_ID,
session->connection->mid, IKS_RULE_DONE);
1877 const char *reason =
"success";
1908 char *
dialed, target[1024] =
"";
1921 ast_log(
LOG_ERROR,
"Motif channel driver requires an audio format when dialing a destination\n");
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);
1966 snprintf(target,
sizeof(target),
"%s/%s",
args.target,
resource->resource);
1969 }
else if (
resource->caps.google) {
1970 snprintf(target,
sizeof(target),
"%s/%s",
args.target,
resource->resource);
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);
2001 session->transport = transport;
2035 char *media = iks_find_attrib(
description,
"media");
2038 int othercapability = 0;
2050 if (!strcasecmp(media,
"audio")) {
2057 }
else if (!strcasecmp(media,
"video")) {
2068 ast_log(
LOG_ERROR,
"Received a video content description on session '%s' but could not enable video\n",
session->sid);
2077 ast_log(
LOG_ERROR,
"Unsupported media type '%s' received in content description on session '%s'\n", media,
session->sid);
2088 for (codec = iks_child(description); codec; codec = iks_next(codec)) {
2089 char *
id = iks_find_attrib(codec,
"id");
2090 char *attr_name = iks_find_attrib(codec,
"name");
2091 char *clockrate = iks_find_attrib(codec,
"clockrate");
2092 int rtp_id, rtp_clockrate;
2095 if (!
ast_strlen_zero(clockrate) && (sscanf(clockrate,
"%30d", &rtp_clockrate) == 1)) {
2123 char *ufrag = iks_find_attrib(transport,
"ufrag"), *pwd = iks_find_attrib(transport,
"pwd");
2128 ast_log(
LOG_ERROR,
"Received ICE-UDP transport information on session '%s' but ICE support not available\n",
session->sid);
2136 for (candidate = iks_child(transport); candidate; candidate = iks_next(candidate)) {
2137 char *component = iks_find_attrib(candidate,
"component"), *foundation = iks_find_attrib(candidate,
"foundation");
2138 char *generation = iks_find_attrib(candidate,
"generation"), *
id = iks_find_attrib(candidate,
"id");
2139 char *ip = iks_find_attrib(candidate,
"ip"), *port = iks_find_attrib(candidate,
"port");
2140 char *
priority = iks_find_attrib(candidate,
"priority"), *protocol = iks_find_attrib(candidate,
"protocol");
2141 char *
type = iks_find_attrib(candidate,
"type");
2155 if ((sscanf(component,
"%30u", &local_candidate.
id) != 1) ||
2157 (sscanf(port,
"%30d", &real_port) != 1)) {
2175 if (!strcasecmp(
type,
"host")) {
2177 }
else if (!strcasecmp(
type,
"srflx")) {
2179 }
else if (!strcasecmp(
type,
"relay")) {
2208 ast_log(
LOG_ERROR,
"Received Google transport information on session '%s' but ICE support not available\n",
session->sid);
2221 for (candidate = iks_child(transport); candidate; candidate = iks_next(candidate)) {
2222 char *
address = iks_find_attrib(candidate,
"address"), *port = iks_find_attrib(candidate,
"port");
2223 char *username = iks_find_attrib(candidate,
"username"), *
name = iks_find_attrib(candidate,
"name");
2224 char *protocol = iks_find_attrib(candidate,
"protocol");
2228 char combined[33] =
"";
2231 if (strcasecmp(iks_name(candidate),
"candidate") &&
2232 strcasecmp(iks_name(candidate),
"p:candidate") &&
2233 strcasecmp(iks_name(candidate),
"ses:candidate")) {
2251 if (strcasecmp(
name,
"rtp") && strcasecmp(
name,
"video_rtp")) {
2256 if (sscanf(port,
"%30d", &real_port) != 1) {
2265 snprintf(combined,
sizeof(combined),
"%s%s", username, ice->
get_ufrag(rtp));
2282 unsigned int changed = 0;
2286 for (content = iks_child(iks_child(pak->x)); content; content = iks_next(content)) {
2289 iks *description, *transport;
2292 if (!strcmp(iks_name(content),
"conference-info")) {
2296 name = iks_find_attrib(content,
"name");
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))) {
2335 ast_log(
LOG_ERROR,
"Received a content stanza but have no RTP instance for it on session '%s'\n",
session->sid);
2341 if ((transport = iks_find_with_attrib(content,
"transport",
"xmlns",
JINGLE_ICE_UDP_NS))) {
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))) {
2353 }
else if (iks_find(content,
"transport")) {
2404 if ((sid = iks_find_attrib(pak->query,
"id"))) {
2407 }
else if (!(sid = iks_find_attrib(pak->query,
"sid"))) {
2420 session->transport = transport;
2465 "unknown-session xmlns='urn:xmpp:jingle:errors:1'");
2480 "unknown-session xmlns='urn:xmpp:jingle:errors:1'");
2504 "unknown-session xmlns='urn:xmpp:jingle:errors:1'");
2521 }
else if (iks_find_with_attrib(pak->query,
"unhold",
"xmlns",
JINGLE_RTP_INFO_NS)) {
2539 int data_size =
sizeof(*cause_code);
2543 "unknown-session xmlns='urn:xmpp:jingle:errors:1'");
2554 if ((reason = iks_find(pak->query,
"reason")) && (
text = iks_child(reason))) {
2558 data_size += 6 + strlen(iks_name(
text));
2560 memset(cause_code, 0, data_size);
2571 snprintf(cause_code->
code, data_size -
sizeof(*cause_code) + 1,
"Motif %s", iks_name(
text));
2575 memset(cause_code, 0, data_size);
2583 ast_debug(3,
"Hanging up channel '%s' due to session terminate message with cause '%d'\n",
ast_channel_name(chan), cause);
2598 const char *sid =
NULL;
2604 if (!(action = iks_find_attrib(pak->query,
"action")) &&
2605 !(action = iks_find_attrib(pak->query,
"type"))) {
2608 return IKS_FILTER_EAT;
2616 if (!(sid = iks_find_attrib(pak->query,
"sid"))) {
2618 sid = iks_find_attrib(pak->query,
"id");
2643 ast_log(
LOG_NOTICE,
"Received action '%s' for session '%s' that has no handler\n", action, sid);
2654 return IKS_FILTER_EAT;
2662 if (!strcasecmp(
var->name,
"callgroup")) {
2664 }
else if (!strcasecmp(
var->name,
"pickupgroup")) {
2682 ast_log(
LOG_ERROR,
"Connection '%s' configured on endpoint '%s' could not be found\n",
var->value, endpoint->
name);
2687 IKS_RULE_TYPE, IKS_PAK_IQ,
2691 ast_log(
LOG_ERROR,
"Action hook could not be added to connection '%s' on endpoint '%s'\n",
var->value, endpoint->
name);
2703 if (!strcasecmp(
var->value,
"ice-udp")) {
2705 }
else if (!strcasecmp(
var->value,
"google")) {
2707 }
else if (!strcasecmp(
var->value,
"google-v1")) {
2710 ast_log(
LOG_WARNING,
"Unknown transport type '%s' on endpoint '%s', defaulting to 'ice-udp'\n",
var->value, endpoint->
name);
2757 ast_log(
LOG_ERROR,
"Unable to read config file motif.conf. Module loaded but not running.\n");
2829 .
requires =
"res_xmpp",
Common implementation-independent jitterbuffer stuff.
Access Control of various sorts.
Asterisk main include file. File version handling, generic pbx functions.
static struct ast_mansession session
#define ast_alloca(size)
call __builtin_alloca to ensure we get gcc builtin semantics
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ao2_iterator_next(iter)
#define ao2_link(container, obj)
Add an object to a container.
@ AO2_ALLOC_OPT_LOCK_MUTEX
#define ao2_unlink(container, obj)
Remove an object from a container.
#define ao2_global_obj_ref(holder)
Get a reference to the object stored in the global holder.
#define ao2_find(container, arg, flags)
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_global_obj_release(holder)
Release the ao2 object held in the global holder.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
#define ao2_alloc(data_size, destructor_fn)
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
Allocate and initialize a hash container with the desired number of buckets.
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
Internal Asterisk hangup causes.
#define AST_CAUSE_SWITCH_CONGESTION
#define AST_CAUSE_CONGESTION
#define AST_CAUSE_INTERWORKING
#define AST_CAUSE_PROTOCOL_ERROR
#define AST_CAUSE_BEARERCAPABILITY_NOTAVAIL
#define AST_CAUSE_NO_USER_RESPONSE
#define AST_CAUSE_REQUESTED_CHAN_UNAVAIL
#define AST_CAUSE_CHANNEL_UNACCEPTABLE
#define AST_CAUSE_CALL_REJECTED
#define AST_CAUSE_FACILITY_NOT_IMPLEMENTED
#define AST_CAUSE_RECOVERY_ON_TIMER_EXPIRE
#define AST_CAUSE_NO_ROUTE_DESTINATION
#define AST_CAUSE_NORMAL_CLEARING
static struct console_pvt globals
static char language[MAX_LANGUAGE]
static char accountcode[AST_MAX_ACCOUNT_CODE]
#define DEFAULT_MAX_PAYLOADS
Default maximum number of payloads we will offer.
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.
#define SESSION_BUCKETS
Number of buckets for sessions, on a per-endpoint basis.
static void * jingle_endpoint_alloc(const char *cat)
Allocator function for Jingle endpoints.
static int jingle_answer(struct ast_channel *ast)
Function called by core when we should answer a Jingle session.
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 void jingle_get_codec(struct ast_channel *chan, struct ast_format_cap *result)
Function called by RTP engine to get peer capabilities.
static void jingle_config_destructor(void *obj)
Destructor called when module configuration goes away.
static struct ast_channel * jingle_session_lock_full(struct jingle_session *pvt)
static void jingle_endpoint_destructor(void *obj)
Destructor for Jingle endpoints.
static void jingle_endpoint_state_destructor(void *obj)
Destructor for Jingle endpoint state.
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 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_action_hook(void *data, ikspak *pak)
Callback for when a Jingle action is received from an endpoint.
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_endpoint_cmp(void *obj, void *arg, int flags)
Comparator function for Jingle endpoints.
CONFIG_INFO_STANDARD(cfg_info, globals, jingle_config_alloc,.files=ACO_FILES(&jingle_conf),)
static int custom_group_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
Custom handler for groups.
static void jingle_send_session_action(struct jingle_session *session, const char *action)
Internal function which sends a complete session message.
static struct ast_sched_context * sched
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 void jingle_send_session_initiate(struct jingle_session *session)
Internal function which sends a session-inititate message.
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.
#define JINGLE_RTP_INFO_NS
Namespace for Jingle RTP info.
static void jingle_session_destructor(void *obj)
Destructor for Jingle sessions.
#define ENDPOINT_BUCKETS
Number of buckets for endpoints.
#define GOOGLE_VIDEO_NS
Namespace for Google Video description.
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.
static void * jingle_endpoint_find(struct ao2_container *tmp_container, const char *category)
Find function for Jingle endpoints.
static int jingle_interpret_content(struct jingle_session *session, ikspak *pak)
Helper function which locates content stanzas and interprets them.
#define DEFAULT_MAX_ICE_CANDIDATES
Default maximum number of ICE candidates we will offer.
static void jingle_send_session_accept(struct jingle_session *session)
Internal function which sends a session-accept message.
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 int jingle_outgoing_hook(void *data, ikspak *pak)
Callback for when a response is received for an outgoing session-initiate message.
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 AO2_GLOBAL_OBJ_STATIC(globals)
static int jingle_digit_begin(struct ast_channel *ast, char digit)
Function called by core to start a DTMF digit.
#define GOOGLE_PHONE_NS
Namespace for Google Phone description.
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_initiate(struct jingle_endpoint *endpoint, struct jingle_session *session, ikspak *pak)
Action handlers.
static const struct jingle_action_handler jingle_action_handlers[]
static void jingle_action_session_info(struct jingle_endpoint *endpoint, struct jingle_session *session, ikspak *pak)
Handler function for the 'session-info' action.
static struct jingle_endpoint_state * jingle_endpoint_state_find_or_create(const char *category)
State find/create function.
static int jingle_digit_end(struct ast_channel *ast, char digit, unsigned int duration)
Function called by core to stop a DTMF digit.
static int jingle_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
Function called by core to change the underlying owner channel.
static int jingle_endpoint_hash(const void *obj, const int flags)
Hashing function for Jingle endpoints.
struct aco_type * endpoint_options[]
static int custom_transport_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
Custom handler for transport.
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 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_session_hash(const void *obj, const int flags)
Hashing function for Jingle sessions.
static void jingle_send_session_terminate(struct jingle_session *session, const char *reasontext)
Internal function which sends a session-terminate message.
#define XMPP_STANZAS_NS
Namespace for XMPP stanzas.
static struct ast_frame * jingle_read(struct ast_channel *ast)
Function called by core to read any waiting frames.
static void jingle_send_session_info(struct jingle_session *session, const char *info)
Internal function which sends a session-info message.
static void jingle_enable_video(struct jingle_session *session)
Internal helper function which enables video support on a sesson if possible.
static int jingle_write(struct ast_channel *ast, struct ast_frame *f)
Function called by core to write frames.
static const char channel_type[]
struct aco_file jingle_conf
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 jingle_endpoint_state * jingle_endpoint_state_create(void)
Allocator function for Jingle endpoint state.
static void jingle_action_session_terminate(struct jingle_endpoint *endpoint, struct jingle_session *session, ikspak *pak)
Handler function for the 'session-terminate' action.
static const struct jingle_reason_mapping jingle_reason_mappings[]
static int load_module(void)
Load the module.
jingle_transport
The various transport methods supported, from highest priority to lowest priority when doing fallback...
@ JINGLE_TRANSPORT_ICE_UDP
@ JINGLE_TRANSPORT_GOOGLE_V1
@ JINGLE_TRANSPORT_GOOGLE_V2
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 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.
#define GOOGLE_SESSION_NS
Namespace for Google Session.
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 unload_module(void)
Unload the jingle channel from Asterisk.
static struct ast_rtp_glue jingle_rtp_glue
Local glue for interacting with the RTP engine core.
static int reload(void)
Reload module.
static int jingle_sendtext(struct ast_channel *ast, 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_send_response(struct ast_xmpp_client *connection, ikspak *pak)
Internal helper function which sends a response.
static int jingle_interpret_google_transport(struct jingle_session *session, iks *transport, struct ast_rtp_instance *rtp)
Helper function which handles Google transport information.
#define JINGLE_RTP_NS
Namespace for Jingle RTP sessions.
#define GOOGLE_TRANSPORT_NS
Namespace for Google Talk ICE-UDP.
static struct aco_type endpoint_option
static int custom_connection_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
Custom handler for connection.
#define JINGLE_NS
Namespace for Jingle itself.
static int jingle_hangup(struct ast_channel *ast)
Function called by core to hang up a Jingle session.
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)
Asterisk core interaction functions.
static void * jingle_config_alloc(void)
Allocator called when module configuration should appear.
static struct ast_channel_tech jingle_tech
PBX interface structure for channel registration.
static void jingle_send_transport_info(struct jingle_session *session, const char *from)
Internal function which sends a transport-info message.
#define JINGLE_ICE_UDP_NS
Namespace for Jingle ICE-UDP.
General Asterisk PBX channel definitions.
void ast_channel_exten_set(struct ast_channel *chan, const char *value)
const char * ast_channel_name(const struct ast_channel *chan)
void ast_channel_rings_set(struct ast_channel *chan, int value)
@ AST_CHAN_TP_WANTSJITTER
Channels have this property if they can accept input with jitter; i.e. most VoIP channels.
@ AST_CHAN_TP_CREATESJITTER
Channels have this property if they can create jitter; i.e. most VoIP channels.
#define ast_channel_alloc_with_endpoint(needqueue, state, cid_num, cid_name, acctcode, exten, context, assignedids, requestor, amaflag, endpoint,...)
void * ast_channel_tech_pvt(const struct ast_channel *chan)
void ast_hangup(struct ast_channel *chan)
Hang up a channel.
void ast_channel_nativeformats_set(struct ast_channel *chan, struct ast_format_cap *value)
int ast_channel_fdno(const struct ast_channel *chan)
#define ast_channel_lock(chan)
struct ast_format_cap * ast_channel_nativeformats(const struct ast_channel *chan)
void ast_channel_unregister(const struct ast_channel_tech *tech)
Unregister a channel technology.
int ast_queue_control(struct ast_channel *chan, enum ast_control_frame_type control)
Queue a control frame without payload.
unsigned long long ast_group_t
#define ast_channel_ref(c)
Increase channel reference count.
const char * ast_channel_uniqueid(const struct ast_channel *chan)
int ast_queue_control_data(struct ast_channel *chan, enum ast_control_frame_type control, const void *data, size_t datalen)
Queue a control frame with payload.
int ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
int ast_queue_hangup_with_cause(struct ast_channel *chan, int cause)
Queue a hangup frame with hangupcause set.
void ast_channel_set_rawreadformat(struct ast_channel *chan, struct ast_format *format)
void ast_channel_tech_pvt_set(struct ast_channel *chan, void *value)
void ast_channel_callgroup_set(struct ast_channel *chan, ast_group_t value)
int ast_channel_hangupcause(const struct ast_channel *chan)
void ast_channel_set_rawwriteformat(struct ast_channel *chan, struct ast_format *format)
void ast_channel_hangupcause_hash_set(struct ast_channel *chan, const struct ast_control_pvt_cause_code *cause_code, int datalen)
Sets the HANGUPCAUSE hash and optionally the SIP_CAUSE hash on the given channel.
int ast_queue_unhold(struct ast_channel *chan)
Queue an unhold frame.
int ast_queue_hold(struct ast_channel *chan, const char *musicclass)
Queue a hold frame.
void ast_channel_set_readformat(struct ast_channel *chan, struct ast_format *format)
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 ...
#define ast_channel_unref(c)
Decrease channel reference count.
struct ast_format * ast_channel_writeformat(struct ast_channel *chan)
int ast_set_write_format(struct ast_channel *chan, struct ast_format *format)
Sets write format on channel chan.
void ast_channel_context_set(struct ast_channel *chan, const char *value)
void ast_channel_set_fd(struct ast_channel *chan, int which, int fd)
int ast_softhangup_nolock(struct ast_channel *chan, int cause)
Softly hangup up a channel (no channel lock)
void ast_channel_callid_set(struct ast_channel *chan, ast_callid value)
void ast_channel_priority_set(struct ast_channel *chan, int value)
void ast_channel_hangupcause_set(struct ast_channel *chan, int value)
void ast_channel_pickupgroup_set(struct ast_channel *chan, ast_group_t value)
void ast_channel_adsicpe_set(struct ast_channel *chan, enum ast_channel_adsicpe value)
ast_group_t ast_get_group(const char *s)
void ast_channel_tech_set(struct ast_channel *chan, const struct ast_channel_tech *value)
#define ast_channel_unlock(chan)
void ast_channel_set_writeformat(struct ast_channel *chan, struct ast_format *format)
struct ast_format * ast_channel_readformat(struct ast_channel *chan)
ast_channel_state
ast_channel states
int ast_setstate(struct ast_channel *chan, enum ast_channel_state)
Change the state of a channel.
Standard Command Line Interface.
static struct ao2_container * codecs
Registered codecs.
ast_media_type
Types of media.
Configuration option-handling.
void aco_info_destroy(struct aco_info *info)
Destroy an initialized aco_info struct.
@ ACO_PROCESS_ERROR
Their was an error and no changes were applied.
#define STRFLDSET(type,...)
Convert a struct and a list of stringfield fields to an argument list of field offsets.
int aco_info_init(struct aco_info *info)
Initialize an aco_info structure.
#define FLDSET(type,...)
Convert a struct and list of fields to an argument list of field offsets.
#define aco_option_register(info, name, matchtype, types, default_val, opt_type, flags,...)
Register a config option.
@ OPT_UINT_T
Type for default option handler for unsigned integers.
@ OPT_CODEC_T
Type for default option handler for format capabilities.
@ OPT_STRINGFIELD_T
Type for default option handler for stringfields.
#define aco_option_register_custom(info, name, matchtype, types, default_val, handler, flags)
Register a config option.
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.
#define ACO_TYPES(...)
A helper macro to ensure that aco_info types always have a sentinel.
Generic File Format Support. Should be included by clients of the file handling routines....
void ast_channel_stage_snapshot_done(struct ast_channel *chan)
Clear flag to indicate channel snapshot is being staged, and publish snapshot.
void ast_channel_stage_snapshot(struct ast_channel *chan)
Set flag to indicate channel snapshot is being staged.
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
#define AST_APP_ARG(name)
Define an application argument.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_NONSTANDARD_APP_ARGS(args, parse, sep)
Performs the 'nonstandard' argument separation process for an application.
@ AST_CONTROL_CONNECTED_LINE
@ AST_CONTROL_MASQUERADE_NOTIFY
@ AST_CONTROL_PVT_CAUSE_CODE
@ AST_CONTROL_UPDATE_RTP_PEER
struct ast_frame ast_null_frame
#define ast_debug(level,...)
Log a DEBUG message.
ast_callid ast_read_threadstorage_callid(void)
extracts the callerid from the thread
int ast_callid_threadassoc_add(ast_callid callid)
Adds a known callid to thread storage of the calling thread.
ast_callid ast_create_callid(void)
factory function to create a new uniquely identifying callid.
int ast_callid_threadassoc_remove(void)
Removes callid from thread storage of the calling thread.
I/O Management (derived from Cheops-NG)
Asterisk locking-related definitions:
static struct ao2_container * endpoints
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODPRI_CHANNEL_DRIVER
@ AST_MODULE_SUPPORT_CORE
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass)
Turn on music on hold on a given channel.
void ast_moh_stop(struct ast_channel *chan)
Turn off music on hold on a given channel.
static char * ast_sockaddr_stringify_host(const struct ast_sockaddr *addr)
Wrapper around ast_sockaddr_stringify_fmt() to return an address only, suitable for a URL (with brack...
int ast_sockaddr_parse(struct ast_sockaddr *addr, const char *str, int flags)
Parse an IPv4 or IPv6 address string.
static int ast_sockaddr_isnull(const struct ast_sockaddr *addr)
Checks if the ast_sockaddr is null. "null" in this sense essentially means uninitialized,...
static char * ast_sockaddr_stringify_port(const struct ast_sockaddr *addr)
Wrapper around ast_sockaddr_stringify_fmt() to return a port only.
#define ast_sockaddr_set_port(addr, port)
Sets the port number of a socket address.
int ast_sockaddr_is_ipv4(const struct ast_sockaddr *addr)
Determine if the address is an IPv4 address.
Core PBX routines and definitions.
int ast_exists_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Determine whether an extension exists.
enum ast_pbx_result ast_pbx_start(struct ast_channel *c)
Create a new thread and start the PBX.
Pluggable RTP Architecture.
unsigned int ast_rtp_lookup_sample_rate2(int asterisk_format, const struct ast_format *format, int code)
Get the sample rate associated with known RTP payload types.
void ast_rtp_codecs_payloads_destroy(struct ast_rtp_codecs *codecs)
Destroy the contents of an RTP codecs structure (but not the structure itself)
int ast_rtp_instance_destroy(struct ast_rtp_instance *instance)
Destroy an RTP instance.
struct ast_rtp_instance * ast_rtp_instance_new(const char *engine_name, struct ast_sched_context *sched, const struct ast_sockaddr *sa, void *data)
Create a new RTP instance.
void ast_rtp_instance_stop(struct ast_rtp_instance *instance)
Stop an RTP instance.
void ast_rtp_codecs_payloads_copy(struct ast_rtp_codecs *src, struct ast_rtp_codecs *dest, struct ast_rtp_instance *instance)
Copy payload information from one RTP instance to another.
@ AST_RTP_GLUE_RESULT_LOCAL
@ AST_RTP_GLUE_RESULT_FORBID
#define ast_rtp_instance_get_remote_address(instance, address)
Get the address of the remote endpoint that we are sending RTP to.
void ast_rtp_codecs_payload_formats(struct ast_rtp_codecs *codecs, struct ast_format_cap *astformats, int *nonastformats)
Retrieve all formats that were found.
int ast_rtp_instance_dtmf_begin(struct ast_rtp_instance *instance, char digit)
Begin sending a DTMF digit.
struct ast_frame * ast_rtp_instance_read(struct ast_rtp_instance *instance, int rtcp)
Receive a frame over RTP.
void ast_rtp_instance_stun_request(struct ast_rtp_instance *instance, struct ast_sockaddr *suggestion, const char *username)
Request that the underlying RTP engine send a STUN BIND request.
void ast_rtp_codecs_set_framing(struct ast_rtp_codecs *codecs, unsigned int framing)
Set the framing used for a set of codecs.
void ast_rtp_instance_set_prop(struct ast_rtp_instance *instance, enum ast_rtp_property property, int value)
Set the value of an RTP instance property.
int ast_rtp_instance_dtmf_end_with_duration(struct ast_rtp_instance *instance, char digit, unsigned int duration)
@ AST_RTP_ICE_CANDIDATE_TYPE_RELAYED
@ AST_RTP_ICE_CANDIDATE_TYPE_SRFLX
@ AST_RTP_ICE_CANDIDATE_TYPE_HOST
int ast_rtp_instance_write(struct ast_rtp_instance *instance, struct ast_frame *frame)
Send a frame out over RTP.
#define ast_rtp_instance_set_remote_address(instance, address)
Set the address of the remote endpoint that we are sending RTP to.
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.
int ast_rtp_codecs_payloads_initialize(struct ast_rtp_codecs *codecs)
Initialize an RTP codecs structure.
const char * ast_rtp_lookup_mime_subtype2(const int asterisk_format, const struct ast_format *format, int code, enum ast_rtp_options options)
Retrieve mime subtype information on a payload.
int ast_rtp_codecs_payloads_set_rtpmap_type(struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance, int payload, char *mimetype, char *mimesubtype, enum ast_rtp_options options)
Record tx payload type information that was seen in an a=rtpmap: SDP line.
void ast_rtp_instance_set_channel_id(struct ast_rtp_instance *instance, const char *uniqueid)
Set the channel that owns this RTP instance.
#define ast_rtp_glue_register(glue)
int ast_rtp_codecs_payloads_set_rtpmap_type_rate(struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance, int pt, char *mimetype, char *mimesubtype, enum ast_rtp_options options, unsigned int sample_rate)
Set tx payload type to a known MIME media type for a codec with a specific sample rate.
void ast_rtp_instance_change_source(struct ast_rtp_instance *instance)
Indicate a new source of audio has dropped in and the ssrc should change.
struct ast_rtp_codecs * ast_rtp_instance_get_codecs(struct ast_rtp_instance *instance)
Get the codecs structure of an RTP instance.
int ast_rtp_instance_fd(struct ast_rtp_instance *instance, int rtcp)
Get the file descriptor for an RTP session (or RTCP)
void ast_rtp_instance_update_source(struct ast_rtp_instance *instance)
Indicate that the RTP marker bit should be set on an RTP stream.
int ast_rtp_codecs_payload_code(struct ast_rtp_codecs *codecs, int asterisk_format, struct ast_format *format, int code)
Retrieve a rx mapped payload type based on whether it is an Asterisk format and the code.
int ast_rtp_glue_unregister(struct ast_rtp_glue *glue)
Unregister RTP glue.
Scheduler Routines (derived from cheops)
void ast_sched_context_destroy(struct ast_sched_context *c)
destroys a schedule context
int ast_sched_start_thread(struct ast_sched_context *con)
Start a thread for processing scheduler entries.
struct ast_sched_context * ast_sched_context_create(void)
Create a scheduler context.
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
#define AST_STRING_FIELD(name)
Declare a string field.
#define ast_string_field_set(x, field, data)
Set a field to a simple string value.
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
#define ast_string_field_build(x, field, fmt, args...)
Set a field to a complex (built) value.
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
static force_inline int attribute_pure ast_str_hash(const char *str)
Compute a hash value on a string.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_str_alloca(init_len)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
The representation of a single configuration file to be processed.
Type information about a category-level configurable object.
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Structure to pass both assignedid values to channel drivers.
Structure to describe a channel "technology", ie a channel driver See for examples:
struct ast_format_cap * capabilities
Main Channel structure associated with a channel.
struct ast_party_dialed dialed
Dialed/Called information.
char chan_name[AST_CHANNEL_NAME]
struct ast_format * format
Data structure associated with a single frame of data.
struct ast_frame_subclass subclass
union ast_frame::@226 data
enum ast_frame_type frametype
Structure for an ICE candidate.
struct ast_sockaddr address
enum ast_rtp_ice_component_type id
enum ast_rtp_ice_candidate_type type
Structure that represents the optional ICE support within an RTP engine.
void(* ice_lite)(struct ast_rtp_instance *instance)
void(* stop)(struct ast_rtp_instance *instance)
void(* set_authentication)(struct ast_rtp_instance *instance, const char *ufrag, const char *password)
void(* start)(struct ast_rtp_instance *instance)
const char *(* get_ufrag)(struct ast_rtp_instance *instance)
void(* add_remote_candidate)(struct ast_rtp_instance *instance, const struct ast_rtp_engine_ice_candidate *candidate)
const char *(* get_password)(struct ast_rtp_instance *instance)
struct ao2_container *(* get_local_candidates)(struct ast_rtp_instance *instance)
Socket address structure.
Support for dynamic strings.
Structure for variables, used for configurations and for channel variables.
struct ao2_container * resources
struct ast_endpoint * endpoint
char resource[XMPP_MAX_RESJIDLEN]
Defined handlers for different Jingle actions.
void(* handler)(struct jingle_endpoint *endpoint, struct jingle_session *session, ikspak *pak)
struct ao2_container * endpoints
Endpoint state information.
struct ao2_container * sessions
Endpoint which contains configuration information and active sessions.
enum jingle_transport transport
const ast_string_field language
const ast_string_field musicclass
const ast_string_field accountcode
unsigned int maxicecandidates
const ast_string_field context
const ast_string_field parkinglot
struct ast_xmpp_client * connection
struct ast_format_cap * cap
struct jingle_endpoint_state * state
const ast_string_field name
Reason text <-> cause code mapping.
Session which contains information about an active session.
enum jingle_transport transport
const ast_string_field video_name
char remote[XMPP_MAX_JIDLEN]
const ast_string_field audio_name
struct ast_format_cap * jointcap
struct ast_rtp_instance * vrtp
unsigned int maxicecandidates
struct ast_xmpp_client * connection
struct ast_rtp_instance * rtp
struct ast_channel * owner
struct ast_format_cap * cap
struct ast_format_cap * peercap
struct jingle_endpoint_state * state
char remote_original[XMPP_MAX_JIDLEN]
const ast_string_field sid
int error(const char *format,...)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
long int ast_random(void)
int ast_xmpp_client_send(struct ast_xmpp_client *client, iks *stanza)
Send an XML stanza out using an established XMPP client connection.
void ast_xmpp_client_unref(struct ast_xmpp_client *client)
Release XMPP client connection reference.
int ast_xmpp_client_send_message(struct ast_xmpp_client *client, const char *user, const char *message)
Send a message to a given user using an established XMPP client connection.
void ast_xmpp_increment_mid(char *mid)
Helper function which increments the message identifier.
struct ast_xmpp_client * ast_xmpp_client_find(const char *name)
Find an XMPP client connection using a given name.