43 #include <sys/socket.h> 44 #include <sys/ioctl.h> 49 #include <netinet/in.h> 50 #include <netinet/in_systm.h> 51 #include <netinet/ip.h> 52 #include <arpa/inet.h> 96 #define DEFAULT_EXPIRY 120 97 #define MAX_EXPIRY 3600 101 #define INADDR_NONE (in_addr_t)(-1) 110 .resync_threshold = 1000,
116 static const char tdesc[] =
"Media Gateway Control Protocol (MGCP)";
117 static const char config[] =
"mgcp.conf";
119 #define MGCP_DTMF_RFC2833 (1 << 0) 120 #define MGCP_DTMF_INBAND (1 << 1) 121 #define MGCP_DTMF_HYBRID (1 << 2) 123 #define DEFAULT_MGCP_GW_PORT 2427 124 #define DEFAULT_MGCP_CA_PORT 2727 125 #define MGCP_MAX_PACKET 1500 126 #define DEFAULT_RETRANS 1000 127 #define MAX_RETRANS 5 130 #define MGCP_CX_SENDONLY 0 131 #define MGCP_CX_RECVONLY 1 132 #define MGCP_CX_SENDRECV 2 133 #define MGCP_CX_CONF 3 134 #define MGCP_CX_CONFERENCE 3 135 #define MGCP_CX_MUTE 4 136 #define MGCP_CX_INACTIVE 4 181 }
qos = { 0, 0, 0, 0 };
250 #define MGCP_MAX_HEADERS 64 251 #define MGCP_MAX_LINES 64 281 #define RESPONSE_TIMEOUT 30 302 #define MGCP_SUBCHANNEL_MAGIC "!978!" 309 struct sockaddr_in tmpdest;
326 #define MGCP_ONHOOK 1 327 #define MGCP_OFFHOOK 2 403 struct sockaddr_in addr;
404 struct sockaddr_in defaddr;
405 struct in_addr ourip;
474 .description =
tdesc,
537 if (gw->
addr.sin_addr.s_addr)
538 res=sendto(
mgcpsock, data, len, 0, (
struct sockaddr *)&gw->
addr,
sizeof(
struct sockaddr_in));
540 res=sendto(
mgcpsock, data, len, 0, (
struct sockaddr *)&gw->
defaddr,
sizeof(
struct sockaddr_in));
575 for (prev =
NULL, cur = gw->
msgs; cur; prev = cur, cur = cur->
next) {
578 prev->next = cur->
next;
653 for (prev =
NULL, cur = gw->
msgs; cur; prev = cur, cur = cur->
next) {
656 ast_debug(1,
"Retransmitting #%d transaction %u on [%s]\n",
661 prev->next = cur->
next;
700 char *data,
int len,
unsigned int seqno)
707 if (!(msg =
ast_malloc(
sizeof(*msg) + len))) {
721 memcpy(msg->
buf, data, msg->
len);
724 for (cur = gw->
msgs; cur && cur->
next; cur = cur->
next);
800 memcpy(r, req,
sizeof(*r));
813 for (t = *queue; t && t->
next; t = t->
next);
842 snprintf(tone,
sizeof(tone),
"L/wt%s", distinctive_ring);
843 ast_debug(3,
"MGCP distinctive callwait %s\n", tone);
846 ast_debug(3,
"MGCP normal callwait %s\n", tone);
852 snprintf(tone,
sizeof(tone),
"L/r%s", distinctive_ring);
853 ast_debug(3,
"MGCP distinctive ring %s\n", tone);
909 ast_debug(1,
"Asked to hangup channel not connected\n");
913 ast_debug(1,
"Invalid magic. MGCP subchannel freed up already.\n");
1005 ast_debug(3,
"MGCP mgcp_hangup(%s) on %s@%s set vmwi(+)\n",
1009 ast_debug(3,
"MGCP mgcp_hangup(%s) on %s@%s set vmwi(-)\n",
1022 int hasendpoints = 0;
1027 e->
command =
"mgcp show endpoints";
1029 "Usage: mgcp show endpoints\n" 1030 " Lists all endpoints known to the MGCP (Media Gateway Control Protocol) subsystem.\n";
1052 if (!hasendpoints) {
1053 ast_cli(a->
fd,
" << No Endpoints Defined >> ");
1065 char *ename,*gname, *
c;
1069 e->
command =
"mgcp audit endpoint";
1071 "Usage: mgcp audit endpoint <endpointid>\n" 1072 " Lists the capabilities of an endpoint in the MGCP (Media Gateway Control Protocol) subsystem.\n" 1073 " mgcp debug MUST be on to see the results of this command.\n";
1086 for (gname = ename; *gname; gname++) {
1087 if (*gname ==
'@') {
1093 if (gname[0] ==
'[') {
1096 if ((c = strrchr(gname,
']'))) {
1101 if (!strcasecmp(mg->
name, gname)) {
1103 if (!strcasecmp(me->
name, ename)) {
1115 ast_cli(a->
fd,
" << Could not find endpoint >> ");
1125 e->
command =
"mgcp set debug {on|off}";
1127 "Usage: mgcp set debug {on|off}\n" 1128 " Enables/Disables dumping of MGCP packets for debugging purposes\n";
1137 if (!strncasecmp(a->
argv[e->
args - 1],
"on", 2)) {
1139 ast_cli(a->
fd,
"MGCP Debugging Enabled\n");
1140 }
else if (!strncasecmp(a->
argv[3],
"off", 3)) {
1142 ast_cli(a->
fd,
"MGCP Debugging Disabled\n");
1169 ast_verb(3,
"MGCP mgcp_answer(%s) on %s@%s-%d\n",
1256 ast_log(
LOG_WARNING,
"Asked to transmit frame type %s, while native formats is %s (read/write = %s/%s)\n",
1268 ast_debug(1,
"GATE ALLOCATED, sending sdp\n");
1288 if (sub->
owner != oldchan) {
1306 ast_debug(1,
"Sending DTMF using inband/hybrid\n");
1309 ast_debug(1,
"Sending DTMF using RFC2833\n");
1328 ast_debug(1,
"Stopping DTMF using inband/hybrid\n");
1331 ast_debug(1,
"Stopping DTMF using RFC2833\n");
1364 char *
tmp, *endpt, *gw;
1368 if ((tmp = strchr(endpt,
'@'))) {
1376 if (strcasecmp(g->
name, gw) == 0) {
1385 for (; e; e = e->
next) {
1386 if (strcasecmp(e->
name, endpt) == 0) {
1409 return "Other end has hungup";
1411 return "Local ring";
1413 return "Remote end is ringing";
1415 return "Remote end has answered";
1417 return "Remote end is busy";
1419 return "Make it go off hook";
1421 return "Line is off hook";
1423 return "Congestion (circuits busy)";
1425 return "Flash hook";
1429 return "Set a low-level option";
1433 return "Un-Key Radio";
1443 ast_debug(3,
"MGCP asked to indicate %d '%s' condition on channel %s\n",
1448 #ifdef DLINK_BUGGY_FIRMWARE 1507 tmp =
ast_channel_alloc(1, state, i->
cid_num, i->
cid_name, i->
accountcode, i->
exten, i->
context, assignedids, requestor, i->
amaflags,
"MGCP/%s@%s-%d", i->
name, i->
parent->
name, sub->
id);
1546 ast_channel_language_set(tmp, i->
language);
1572 char valuebuf[1024];
1590 ast_verb(3,
"MGCP mgcp_new(%s) created in state: %s\n",
1598 if (strncasecmp(line, name, nameLen) == 0 && line[nameLen] ==
'=') {
1599 char *r = line + nameLen + 1;
1600 while (*r && (*r < 33)) ++r;
1609 int len = strlen(name);
1612 for (x = 0; x < req->
lines; x++) {
1614 if (r[0] !=
'\0')
return r;
1626 int len = strlen(name);
1628 while (*iterator < req->
lines) {
1630 if (r[0] !=
'\0')
return r;
1638 int len = strlen(name);
1640 for (x = *start; x < req->
headers; x++) {
1641 if (!strncasecmp(req->
header[x], name, len) &&
1642 (req->
header[x][len] ==
':')) {
1643 r = req->
header[x] + len + 1;
1644 while (*r && (*r < 33)) {
1666 *next =
NULL, *len = 0;
1667 if (!c)
return NULL;
1669 while (*c && (*c < 33 || *c ==
',')) {
1674 while (*c && (*c >= 33 && *c !=
',')) {
1695 ast_debug(1,
"*** find Realtime MGCPGW\n");
1724 for (gwv = mgcpgwconfig; gwv; gwv = gwv->
next) {
1725 if (!strcasecmp(gwv->
name,
"lines")) {
1731 for (gwv = gwv && gwv->
next ? gwv : mgcpgwconfig; gwv->
next; gwv = gwv->
next);
1738 for (i = 0; i <
args.argc; i++) {
1743 if (!strcasecmp(gwv->
next->
name,
"line")) {
1757 for (gwv = mgcpgwconfig; gwv; gwv = gwv->
next) {
1783 char *at =
NULL, *
c;
1787 at = strchr(tmp,
'@');
1795 if (at && (at[0] ==
'[')) {
1797 c = strrchr(at,
']');
1803 if ((!name || !strcasecmp(g->
name, at)) &&
1804 (sin || g->
addr.sin_addr.s_addr || g->
defaddr.sin_addr.s_addr)) {
1806 if (sin && g->
dynamic && name) {
1807 if ((g->
addr.sin_addr.s_addr != sin->sin_addr.s_addr) ||
1808 (g->
addr.sin_port != sin->sin_port)) {
1809 memcpy(&g->
addr, sin,
sizeof(g->
addr));
1812 struct sockaddr_in tmp3 = {0,};
1814 tmp3.sin_addr = g->
ourip;
1821 g->
ourip = tmp3.sin_addr;
1827 if (strcasecmp(g->
name, at)) {
1831 }
else if (!name && sin) {
1832 if ((g->
addr.sin_addr.s_addr != sin->sin_addr.s_addr) ||
1833 (g->
addr.sin_port != sin->sin_port)) {
1845 }
else if (name && !strcasecmp(p->
name, tmp)) {
1846 ast_debug(1,
"Coundn't determine subchannel, assuming current master %s@%s-%d\n",
1865 ast_log(
LOG_NOTICE,
"Gateway '%s' (and thus its endpoint '%s') does not exist\n", at, tmp);
1897 }
else if (*c ==
'\r') {
1920 req->
line[f] = c + 1;
1921 }
else if (*c ==
'\r') {
1933 while (*c && *c < 33) c++;
1936 while (*c && (*c > 32)) c++;
1940 while (*c && (*c < 33)) c++;
1942 while (*c && (*c > 32)) c++;
1946 while (*c && (*c < 33)) c++;
1948 while (*c && (*c > 32)) c++;
1952 while (*c && (*c < 33)) c++;
1954 while (*c && (*c > 32)) c++;
1955 while (*c && (*c < 33)) c++;
1956 while (*c && (*c > 32)) c++;
1962 ast_debug(1,
"Verb: '%s', Identifier: '%s', Endpoint: '%s', Version: '%s'\n",
1979 int peerNonCodecCapability;
1980 struct sockaddr_in sin;
1984 int codec, codec_count=0;
1995 ast_log(
LOG_WARNING,
"Insufficient information for SDP (m = '%s', c = '%s')\n", m, c);
1998 if (sscanf(c,
"IN IP4 %256s", host) != 1) {
2008 if (sscanf(m,
"audio %30d RTP/AVP %n", &portno, &len) != 1 || !len) {
2012 sin.sin_family = AF_INET;
2013 memcpy(&sin.sin_addr, hp->h_addr,
sizeof(sin.sin_addr));
2014 sin.sin_port = htons(portno);
2021 if (sscanf(codecs,
"%30d%n", &codec, &len) != 1) {
2038 if (sscanf(a,
"rtpmap: %30d %127[^/]/", &codec, mimeSubtype) != 2)
2050 ast_debug(1,
"Capabilities: us - %s, them - %s, combined - %s\n",
2056 ast_debug(1,
"Non-codec capabilities: us - %d, them - %d, combined - %d\n",
2067 if (req->
len >=
sizeof(req->
data) - 4) {
2089 if (req->
len >=
sizeof(req->
data) - 4) {
2154 memset(resp, 0,
sizeof(*resp));
2184 respprep(&resp, p, msg, req, msgrest);
2193 mgr->
buf[resp.
len] =
'\0';
2206 struct sockaddr_in sin;
2216 struct sockaddr_in dest = { 0, };
2232 if (sub->
tmpdest.sin_addr.s_addr) {
2233 dest.sin_addr = sub->
tmpdest.sin_addr;
2234 dest.sin_port = sub->
tmpdest.sin_port;
2239 dest.sin_port = sin.sin_port;
2244 snprintf(o,
sizeof(o),
"o=root %d %d IN IP4 %s\r\n", (
int)getpid(), (
int)getpid(),
ast_inet_ntoa(dest.sin_addr));
2246 snprintf(c,
sizeof(c),
"c=IN IP4 %s\r\n",
ast_inet_ntoa(dest.sin_addr));
2248 snprintf(m,
sizeof(m),
"m=audio %d RTP/AVP", ntohs(dest.sin_port));
2261 snprintf(costr,
sizeof(costr),
" %d", codec);
2262 strncat(m, costr,
sizeof(m) - strlen(m) - 1);
2264 strncat(a, costr,
sizeof(a) - strlen(a) - 1);
2272 ast_debug(1,
"Answering with non-codec capability %d\n", (
int) x);
2275 snprintf(costr,
sizeof(costr),
" %d", codec);
2276 strncat(m, costr,
sizeof(m) - strlen(m) - 1);
2278 strncat(a, costr,
sizeof(a) - strlen(a) - 1);
2282 snprintf(costr,
sizeof costr,
"a=fmtp:%d 0-16\r\n", codec);
2283 strncat(a, costr,
sizeof(a) - strlen(a) - 1);
2288 strncat(m,
"\r\n",
sizeof(m) - strlen(m) - 1);
2289 len = strlen(v) + strlen(s) + strlen(o) + strlen(c) + strlen(t) + strlen(m) + strlen(a);
2290 snprintf(costr,
sizeof(costr),
"%d", len);
2329 strncat(local, tmp,
sizeof(local) - strlen(local) - 1);
2336 snprintf(tmp,
sizeof(tmp),
", dq-gi:%x", sub->
gate->
gateid);
2337 strncat(local, tmp,
sizeof(local) - strlen(local) - 1);
2341 ast_debug(1,
"Waiting for opened gate...\n");
2348 oseq =
reqprep(&resp, p,
"MDCX");
2372 ast_debug(3,
"Creating connection for %s@%s-%d in cxmode: %s callid: %s\n",
2386 strncat(local, tmp,
sizeof(local) - strlen(local) - 1);
2393 snprintf(tmp,
sizeof(tmp),
", dq-gi:%x", sub->
gate->
gateid);
2394 strncat(local, tmp,
sizeof(local) - strlen(local) - 1);
2398 oseq =
reqprep(&resp, p,
"CRCX");
2478 strncat(local, tmp,
sizeof(local) - strlen(local) - 1);
2483 ast_debug(3,
"Creating connection for %s@%s-%d in cxmode: %s callid: %s\n",
2486 oseq =
reqprep(&resp, p,
"CRCX");
2505 ast_debug(3,
"MGCP Asked to indicate tone: %s on %s@%s-%d in cxmode: %s\n",
2508 oseq =
reqprep(&resp, p,
"RQNT");
2548 snprintf(tone2,
sizeof(tone2),
"%s,L/ci(%02d/%02d/%02d/%02d,%s,%s)", tone,
2551 oseq =
reqprep(&resp, p,
"RQNT");
2564 ast_debug(3,
"MGCP Asked to indicate tone: %s on %s@%s-%d in cxmode: %s\n",
2587 ast_debug(3,
"Modified %s@%s-%d with new mode: %s on callid: %s\n",
2594 if (p->
ncs && !fc) {
2603 strncat(local, tmp,
sizeof(local) - strlen(local) - 1);
2611 snprintf(tmp,
sizeof(tmp),
", dq-gi:%x", sub->
gate->
gateid);
2612 strncat(local, tmp,
sizeof(local) - strlen(local) - 1);
2620 oseq =
reqprep(&resp, p,
"MDCX");
2651 char tone_indicate_end = 0;
2656 if (p && (!strcasecmp(tone, (p->
ncs ?
"L/ro" :
"G/cg")))) {
2657 tone_indicate_end = 1;
2665 }
else if (!tone_indicate_end){
2666 add_header(resp,
"R", (p->
ncs ?
"L/hu(N),L/hf(N),L/[0-9#*](N)" :
"L/hu(N),L/hf(N),D/[0-9#*](N)"));
2668 ast_debug(1,
"We don't want more digits if we will end the call\n");
2680 oseq =
reqprep(&resp, p,
"AUEP");
2696 ast_debug(3,
"Delete connection %s %s@%s-%d with new mode: %s on callid: %s\n",
2698 oseq =
reqprep(&resp, p,
"DLCX");
2718 ast_debug(3,
"Delete connection %s %s@%s on callid: %s\n",
2719 cxident ? cxident :
"", p->
name, p->
parent->
name, callid ? callid :
"");
2720 oseq =
reqprep(&resp, p,
"DLCX");
2722 if (callid && *callid)
2725 if (cxident && *cxident)
2774 for (prev =
NULL, req = *queue; req; prev = req, req = req->
next) {
2775 if (req->trid == ident) {
2784 ast_debug(1,
"Posting Queued Request:\n%s to %s:%d\n", (*queue)->data,
2817 ast_verb(3,
"No command found on [%s] for transaction %u. Ignoring...\n",
2822 if (p && (result >= 400) && (result <= 599)) {
2880 if (strcasecmp(c, sub->
cxident)) {
2885 if (sub->
tmpdest.sin_addr.s_addr) {
2904 while ((v =
get_csv(c, &len, &n))) {
2909 char cxident[80] =
"";
2911 if (len > (
sizeof(cxident) - 1))
2912 len =
sizeof(cxident) - 1;
2914 ast_verb(3,
"Non existing connection id %s on %s@%s \n",
2926 if (strstr(c,
"hu")) {
2939 }
else if (strstr(c,
"hd")) {
2953 if (resp && resp->
lines) {
2955 if (sub && sub->
owner) {
3010 int loop_pause = 100;
3012 const char *pickupexten;
3019 ast_log(
LOG_ERROR,
"Unable to retrieve pickup configuration options. Unable to detect call pickup extension\n");
3022 pickupexten =
ast_strdupa(pickup_cfg->pickupexten);
3029 while (strlen(p->
dtmf_buf) == len) {
3031 timeout -= loop_pause;
3055 ast_verb(3,
"Setting call forward to '%s' on channel %s\n",
3101 }
else if (res == 0) {
3102 ast_debug(1,
"not enough digits (and no ambiguous match)...\n");
3118 }
else if (!strcmp(p->
dtmf_buf, pickupexten)) {
3150 }
else if (!strcmp(p->
dtmf_buf,
"*78")) {
3159 }
else if (!strcmp(p->
dtmf_buf,
"*79")) {
3314 if (p->
sub != sub) {
3354 #ifdef DLINK_BUGGY_FIRMWARE 3386 ast_log(
LOG_WARNING,
"If we're onhook why are we here trying to handle a hd or hf?\n");
3412 if (!strcasecmp(req->
verb,
"RSIP")) {
3414 if (!strcasecmp(
get_header(req,
"RM"),
"X-keepalive")) {
3430 for (tmp_ep = g->
endpoints; tmp_ep; tmp_ep = tmp_ep->
next) {
3436 first_sub = tmp_ep->
sub;
3437 tmp_sub = tmp_ep->
sub;
3440 tmp_sub = tmp_sub->
next;
3441 if (tmp_sub == first_sub)
3446 }
else if (sub->
owner) {
3459 }
else if (!strcasecmp(req->
verb,
"NTFY")) {
3464 s = strchr(ev,
'/');
3468 if (strcasecmp(ev,
"hu") && strcasecmp(ev,
"hd") && strcasecmp(ev,
"ping")) {
3471 if (!strcasecmp(ev,
"hd")) {
3482 }
else if (!strcasecmp(ev,
"hf")) {
3514 ast_verb(3,
"MGCP Conferencing %d and %d on %s@%s\n",
3525 ast_verb(3,
"We didn't make one of the calls FLIPFLOP %d and %d on %s@%s\n",
3552 ast_log(
LOG_WARNING,
"Callwaiting, call transfer or threeway calling not enabled on endpoint %s@%s\n",
3555 }
else if (!strcasecmp(ev,
"hu")) {
3582 ast_verb(3,
"MGCP handle_request(%s@%s-%d) ast_channel already destroyed, resending DLCX.\n",
3604 }
else if ((strlen(ev) == 1) &&
3605 (((ev[0] >=
'0') && (ev[0] <=
'9')) ||
3606 ((ev[0] >=
'A') && (ev[0] <=
'D')) ||
3607 (ev[0] ==
'*') || (ev[0] ==
'#'))) {
3618 if (strstr(p->
curtone, (p->
ncs ?
"wt1" :
"wt")) && (ev[0] ==
'A')) {
3625 }
else if (!strcasecmp(ev,
"T")) {
3627 }
else if (!strcasecmp(ev,
"ping")) {
3645 if (sscanf(req->
identifier,
"%30d", &seqno) != 1) {
3657 if (seqno == cur->seqno)
3672 struct sockaddr_in sin;
3679 memset(&req, 0,
sizeof(req));
3680 res = recvfrom(
mgcpsock, req.
data,
sizeof(req.
data) - 1, 0, (
struct sockaddr *)&sin, &len);
3682 if (
errno != ECONNREFUSED)
3686 req.
data[res] =
'\0';
3699 if (sscanf(req.
verb,
"%30d", &result) && sscanf(req.
identifier,
"%30d", &ident)) {
3701 ast_debug(1,
"Ignoring provisional response on transaction %d\n", ident);
3712 for (prev =
NULL, cur = gw->
msgs; cur; prev = cur, cur = cur->
next) {
3713 if (cur->
seqno == ident) {
3714 ast_debug(1,
"Got response back on transaction %d\n", ident);
3735 ast_log(
LOG_NOTICE,
"Got response back on [%s] for transaction %d we aren't sending?\n",
3742 ast_log(
LOG_NOTICE,
"Message must have a verb, an idenitifier, version, and endpoint\n");
3779 for (i = 0; (i <
MAX_SUBS) && s; i++) {
3791 for (i = 0; (i <
MAX_SUBS) && sub; i++) {
3813 ast_debug(1,
"***** MGCP REALTIME PRUNE GW: %s\n", g->
name);
3861 lastpass = thispass;
3862 thispass = time(
NULL);
3865 if (thispass != lastpass) {
3870 if ((e->msgstate != res) && (e->hookstate ==
MGCP_ONHOOK) && (!e->rtp)){
3877 e->onhooktime = thispass;
3887 if(time(
NULL) > (lastrun + 60)) {
3912 lastrun = time(
NULL);
3918 pthread_testcancel();
3922 if ((res < 0) || (res > 1000)) {
3988 ast_verb(3,
"MGCP mgcp_request(%s)\n", tmp);
3989 ast_verb(3,
"MGCP cw: %d, dnd: %d, so: %d, sno: %d\n",
4031 if (!strcasecmp(cat, gw->
name)) {
4039 if (!gw && !(gw =
ast_calloc(1,
sizeof(*gw)))) {
4053 for (; v; v = v->
next) {
4054 if (!strcasecmp(v->
name,
"host")) {
4055 if (!strcasecmp(v->
value,
"dynamic")) {
4058 memset(&gw->
addr.sin_addr, 0, 4);
4059 if (gw->
addr.sin_port) {
4062 gw->
addr.sin_port = 0;
4082 }
else if (!strcasecmp(v->
name,
"defaultip")) {
4094 }
else if (!strcasecmp(v->
name,
"permit") ||
4095 !strcasecmp(v->
name,
"deny")) {
4099 ast_log(
LOG_ERROR,
"Invalid ACL '%s' specified for MGCP gateway '%s' on line %d. Not creating.\n",
4109 }
else if (!strcasecmp(v->
name,
"port")) {
4110 gw->
addr.sin_port = htons(atoi(v->
value));
4111 }
else if (!strcasecmp(v->
name,
"context")) {
4113 }
else if (!strcasecmp(v->
name,
"dtmfmode")) {
4114 if (!strcasecmp(v->
value,
"inband"))
4116 else if (!strcasecmp(v->
value,
"rfc2833"))
4118 else if (!strcasecmp(v->
value,
"hybrid"))
4120 else if (!strcasecmp(v->
value,
"none"))
4124 }
else if (!strcasecmp(v->
name,
"nat")) {
4126 }
else if (!strcasecmp(v->
name,
"ncs")) {
4128 }
else if (!strcasecmp(v->
name,
"hangupongateremove")) {
4130 }
else if (!strcasecmp(v->
name,
"pktcgatealloc")) {
4132 }
else if (!strcasecmp(v->
name,
"callerid")) {
4133 if (!strcasecmp(v->
value,
"asreceived")) {
4139 }
else if (!strcasecmp(v->
name,
"language")) {
4141 }
else if (!strcasecmp(v->
name,
"accountcode")) {
4143 }
else if (!strcasecmp(v->
name,
"amaflags")) {
4150 }
else if (!strcasecmp(v->
name,
"setvar")) {
4152 }
else if (!strcasecmp(v->
name,
"clearvars")) {
4157 }
else if (!strcasecmp(v->
name,
"musiconhold")) {
4159 }
else if (!strcasecmp(v->
name,
"parkinglot")) {
4161 }
else if (!strcasecmp(v->
name,
"callgroup")) {
4163 }
else if (!strcasecmp(v->
name,
"pickupgroup")) {
4165 }
else if (!strcasecmp(v->
name,
"immediate")) {
4167 }
else if (!strcasecmp(v->
name,
"cancallforward")) {
4169 }
else if (!strcasecmp(v->
name,
"singlepath")) {
4171 }
else if (!strcasecmp(v->
name,
"directmedia") || !strcasecmp(v->
name,
"canreinvite")) {
4173 }
else if (!strcasecmp(v->
name,
"mailbox")) {
4175 }
else if (!strcasecmp(v->
name,
"hasvoicemail")) {
4181 if (strchr(gw->
name,
'@')) {
4187 }
else if (!strcasecmp(v->
name,
"adsi")) {
4189 }
else if (!strcasecmp(v->
name,
"callreturn")) {
4191 }
else if (!strcasecmp(v->
name,
"callwaiting")) {
4193 }
else if (!strcasecmp(v->
name,
"slowsequence")) {
4195 }
else if (!strcasecmp(v->
name,
"transfer")) {
4197 }
else if (!strcasecmp(v->
name,
"threewaycalling")) {
4199 }
else if (!strcasecmp(v->
name,
"wcardep")) {
4250 if (!ep_reload && e->
sub && e->
sub->
rtp) {
4276 ast_verb(3,
"Allocating subchannel '%d' on %s@%s\n", i, e->
name, gw->
name);
4297 for (sub = e->
sub; sub && sub->
next; sub = sub->
next);
4305 }
else if (!strcasecmp(v->
name,
"trunk") ||
4306 !strcasecmp(v->
name,
"line")) {