77 #define IPTOS_MINCOST 0x02 80 #define FORMAT_STRING_SIZE 512 83 #define DEFAULT_CONTEXT "default" 84 #define DEFAULT_H323ID "Asterisk PBX" 85 #define DEFAULT_LOGFILE "h323_log" 86 #define DEFAULT_H323ACCNT "ast_h323" 89 #define H323_SILENCESUPPRESSION (1<<0) 90 #define H323_GKROUTED (1<<1) 91 #define H323_TUNNELING (1<<2) 92 #define H323_FASTSTART (1<<3) 93 #define H323_OUTGOING (1<<4) 94 #define H323_ALREADYGONE (1<<5) 95 #define H323_NEEDDESTROY (1<<6) 96 #define H323_DISABLEGK (1<<7) 97 #define H323_NEEDSTART (1<<8) 100 #define T38TOAUDIOTIMEOUT 30 101 #define T38_DISABLED 0 102 #define T38_ENABLED 1 105 #define FAXDETECT_CNG 1 106 #define FAXDETECT_T38 2 109 static const char type[] =
"OOH323";
110 static const char tdesc[] =
"Objective Systems H323 Channel Driver";
111 static const char config[] =
"ooh323.conf";
119 .resync_threshold = -1,
152 .description =
tdesc,
423 ast_verb(0,
"--- ooh323_new - %s\n", host);
660 dest = strchr(tmp,
'/');
667 }
else if ((dest = strchr(tmp,
'@'))) {
677 if ((sport = strchr(dest,
':'))) {
739 }
else if (!
gH323ep.gkClient || (
gH323ep.gkClient &&
gH323ep.gkClient->state != GkClientRegistered)) {
772 assignedids, requestor);
803 ast_verb(0,
"+++ ooh323_request\n");
837 ast_verb(0,
"--- find_user: %s, %s\n",name,ip);
842 if (ip && user->
mUseIP && !strcmp(user->
mIP, ip)) {
845 if (name && !strcmp(user->
name, name)) {
863 ast_verb(0,
"--- find_friend \"%s\"\n", name);
869 ast_verb(0,
" comparing with \"%s\"\n", peer->
ip);
871 if (!strcmp(peer->
ip, name)) {
872 if (port <= 0 || (port > 0 && peer->
port == port)) {
881 ast_verb(0,
" found matching friend\n");
883 ast_verb(0,
"+++ find_friend \"%s\"\n", name);
895 ast_verb(0,
"--- find_peer \"%s\"\n", name);
901 ast_verb(0,
" comparing with \"%s\"\n", peer->
ip);
903 if (!strcasecmp(peer->
name, name))
907 if (peer->
e164 && !strcasecmp(peer->
e164, name))
920 ast_verb(0,
" found matching peer\n");
922 ast_verb(0,
"+++ find_peer \"%s\"\n", name);
935 ast_verb(0,
"--- ooh323_digit_begin\n");
957 ast_verb(0,
"+++ ooh323_digit_begin, res = %d\n", res);
968 ast_verb(0,
"--- ooh323_digit_end\n");
984 ast_verb(0,
"+++ ooh323_digit_end, res = %d\n", res);
993 char destination[256];
996 ooCallOptions opts = {
1000 .callMode = OO_CALLMODE_AUDIOCALL,
1005 ast_verb(0,
"--- ooh323_call- %s\n", dest);
1056 snprintf(destination,
sizeof(destination),
"%s:%d", p->
host, p->
port);
1058 snprintf(destination,
sizeof(destination),
"%s", p->
host);
1062 destination[
sizeof(destination)-1]=
'\0';
1068 for (i=0;i<480 && !isRunning(p->
callToken);i++) usleep(12000);
1093 ast_verb(0,
"--- ooh323_hangup\n");
1103 if (!strcmp(cause,
"CONGESTION")) {
1105 }
else if (!strcmp(cause,
"BUSY")) {
1107 }
else if (!strcmp(cause,
"CHANISUNVAIL")) {
1109 }
else if (!strcmp(cause,
"NOANSWER")) {
1111 }
else if (!strcmp(cause,
"CANCEL")) {
1149 ast_verb(0,
"+++ ooh323_hangup\n");
1160 ast_verb(0,
"--- ooh323_answer\n");
1170 ast_debug(1,
"Sending forced ringback for %s, res = %u\n",
1171 callToken, ooManualRingback(callToken));
1173 ooManualRingback(callToken);
1189 ast_verb(0,
"+++ ooh323_answer\n");
1200 if (!p)
return &null_frame;
1223 ast_debug(1,
"Send UDPTL %u/%d len %d for %s\n",
1245 "Asked to transmit frame type %s, while native formats is %s (read/write = %s/%s)\n",
1295 ast_verb(0,
" ooh323_indicate - No callToken\n");
1304 ast_verb(0,
"----- ooh323_indicate %d on call %s\n", condition, callToken);
1308 switch (condition) {
1332 rres = ooManualProgress(callToken);
1334 ast_debug(1,
"Sending manual progress for %s, res = %u\n", callToken, rres);
1343 rres = ooManualRingback(callToken);
1345 ast_debug(1,
"Sending manual ringback for %s, res = %u\n", callToken, rres);
1368 ast_debug(1,
"Sending connected line info for %s (%s)\n",
1379 ¶meters,
sizeof(parameters));
1384 "Expected %d, got %d\n",
1447 condition, callToken);
1453 ast_verb(0,
"++++ ooh323_indicate %d on %s is %d\n", condition, callToken, res);
1481 " Expected %d, got %d\n", (
int)
sizeof(
enum ast_t38_state), *datalen);
1501 *cp = p->
vad ? 1 : 0;
1502 ast_debug(1,
"Reporting digit detection %sabled on %s\n",
1529 ast_verb(0,
"--- ooh323c ooh323_fixup\n");
1532 if (p->
owner != oldchan) {
1538 if (p->
owner == oldchan) {
1547 ast_verb(0,
"+++ ooh323c ooh323_fixup \n");
1558 ast_verb(0,
"--- ooh323_update_writeformat %s/%d\n",
1581 ast_debug(1,
"Failed to grab lock, trying again\n");
1592 ast_verb(0,
"Writeformat before update %s/%s\n",
1603 p->
rtp, p->
dtmfcodec,
"audio",
"cisco-telephone-event", 0);
1622 ast_verb(0,
"+++ ooh323_update_writeformat\n");
1630 ast_verb(0,
"--- ooh323_update_readformat %s\n",
1653 ast_debug(1,
"Failed to grab lock, trying again\n");
1664 ast_verb(0,
"Readformat before update %s\n",
1678 ast_verb(0,
"+++ ooh323_update_readformat\n");
1688 ast_verb(0,
"--- onAlerting %s\n", call->callToken);
1703 ast_debug(1,
"Failed to grab lock, trying again\n");
1713 if (call->remoteDisplayName) {
1717 memset(&update_connected, 0,
sizeof(update_connected));
1718 update_connected.
id.
name = 1;
1721 connected.
id.
name.
str = (
char *) call->remoteDisplayName;
1733 ast_verb(0,
"+++ onAlerting %s\n", call->callToken);
1744 ast_verb(0,
"--- onProgress %s\n", call->callToken);
1759 ast_debug(1,
"Failed to grab lock, trying again\n");
1769 if (call->remoteDisplayName) {
1773 memset(&update_connected, 0,
sizeof(update_connected));
1774 update_connected.
id.
name = 1;
1777 connected.
id.
name.
str = (
char *) call->remoteDisplayName;
1789 ast_verb(0,
"+++ onProgress %s\n", call->callToken);
1804 ast_debug(1,
"Received Digit: %c\n", digit[0]);
1815 memset(&f, 0,
sizeof(f));
1823 f.
src =
"SEND_DIGIT";
1826 ast_debug(1,
"Failed to grab lock, trying again\n");
1845 ooAliases *alias =
NULL;
1847 char number [OO_MAX_NUMBER_LENGTH];
1850 ast_verb(0,
"--- ooh323_onReceivedSetup %s\n", call->callToken);
1853 if (!(p =
ooh323_alloc(call->callReference, call->callToken))) {
1861 if (call->remoteDisplayName) {
1865 if (ooCallGetCallingPartyNumber(call, number, OO_MAX_NUMBER_LENGTH) == OO_OK) {
1869 if (call->remoteAliases) {
1870 for (alias = call->remoteAliases; alias; alias = alias->next) {
1871 if (alias->type == T_H225AliasAddress_h323_ID) {
1877 else if(alias->type == T_H225AliasAddress_dialedDigits)
1884 else if(alias->type == T_H225AliasAddress_email_ID)
1888 else if(alias->type == T_H225AliasAddress_url_ID)
1896 if(ooCallGetCalledPartyNumber(call, number, OO_MAX_NUMBER_LENGTH)== OO_OK) {
1906 if ((at = strchr(p->
exten,
'@'))) {
1941 OO_SETFLAG(call->flags, OO_M_FASTSTART);
1943 OO_CLRFLAG(call->flags, OO_M_FASTSTART);
1949 OO_CLRFLAG(call->flags, OO_M_TUNNELING);
1975 call->callEndReason = OO_REASON_REMOTE_REJECTED;
1979 call->callEndReason = OO_REASON_REMOTE_REJECTED;
1997 ooCallSetCallerId(call, p->
exten);
2008 ast_verb(0,
"+++ ooh323_onReceivedSetup - Determined context %s, " 2022 ast_verb(0,
"--- onOutgoingCall %lx: %s\n", (
long unsigned int) call, call->callToken);
2024 if (!strcmp(call->callType,
"outgoing")) {
2070 call->rtpMask->inuse++;
2084 ast_verb(0,
"+++ onOutgoingCall %s\n", call->callToken);
2095 ast_verb(0,
"--- onNewCallCreated %lx: %s\n", (
long unsigned int) call, call->callToken);
2104 if (!strcmp(call->callType,
"outgoing")) {
2151 if (ooIsDailedDigit(p->
exten)) {
2152 ooCallSetCalledPartyNumber(call, p->
exten);
2153 ooCallAddRemoteAliasDialedDigits(call, p->
exten);
2155 ooCallAddRemoteAliasH323ID(call, p->
exten);
2162 ast_verb(0,
" Outgoing call %s(%s) - Codec prefs - %s\n",
2177 ast_verb(0,
"+++ onNewCallCreated %s\n", call->callToken);
2186 ast_verb(0,
"--- onCallEstablished %s\n", call->callToken);
2203 ast_debug(1,
"Failed to grab lock, trying again\n");
2209 if (call->remoteDisplayName) {
2213 memset(&update_connected, 0,
sizeof(update_connected));
2214 update_connected.
id.
name = 1;
2217 connected.
id.
name.
str = (
char *) call->remoteDisplayName;
2231 ast_verb(0,
"+++ onCallEstablished %s\n", call->callToken);
2242 ast_verb(0,
"--- onCallCleared %s \n", call->callToken);
2250 ooTrace(OOTRCLVLINFO,
"Failed to grab lock, trying again\n");
2251 ast_debug(1,
"Failed to grab lock, trying again\n");
2254 ownerLock = 1;
break;
2291 ast_verb(0,
"+++ onCallCleared\n");
2333 ast_verb(0,
"--- ooh323_delete_peer\n");
2339 if(cur==peer)
break;
2362 ast_verb(0,
"+++ ooh323_delete_peer\n");
2402 if (!strcasecmp(v->
name,
"context")) {
2404 }
else if (!strcasecmp(v->
name,
"incominglimit")) {
2408 }
else if (!strcasecmp(v->
name,
"accountcode")) {
2410 }
else if (!strcasecmp(v->
name,
"roundtrip")) {
2412 }
else if (!strcasecmp(v->
name,
"faststart")) {
2414 }
else if (!strcasecmp(v->
name,
"h245tunneling")) {
2416 }
else if (!strcasecmp(v->
name,
"directrtp") || !strcasecmp(v->
name,
"directmedia")) {
2419 }
else if (!strcasecmp(v->
name,
"earlydirect") || !strcasecmp(v->
name,
"directrtpsetup")) {
2421 }
else if (!strcasecmp(v->
name,
"g729onlyA")) {
2423 }
else if (!strcasecmp(v->
name,
"nat")) {
2425 }
else if (!strcasecmp(v->
name,
"rtptimeout")) {
2429 }
else if (!strcasecmp(v->
name,
"rtpmask")) {
2431 (regcomp(&user->
rtpmask->regex, v->
value, REG_EXTENDED)
2438 }
else if (!strcasecmp(v->
name,
"disallow")) {
2440 }
else if (!strcasecmp(v->
name,
"allow")) {
2441 const char* tcodecs = v->
value;
2442 if (!strcasecmp(v->
value,
"all")) {
2443 tcodecs =
"ulaw,alaw,g729,g723,gsm";
2446 }
else if (!strcasecmp(v->
name,
"amaflags")) {
2448 }
else if (!strcasecmp(v->
name,
"ip") || !strcasecmp(v->
name,
"host")) {
2456 }
else if (!strcasecmp(v->
name,
"dtmfmode")) {
2457 if (!strcasecmp(v->
value,
"rfc2833"))
2459 if (!strcasecmp(v->
value,
"cisco"))
2461 else if (!strcasecmp(v->
value,
"q931keypad"))
2463 else if (!strcasecmp(v->
value,
"h245alphanumeric"))
2465 else if (!strcasecmp(v->
value,
"h245signal"))
2467 else if (!strcasecmp(v->
value,
"inband"))
2469 }
else if (!strcasecmp(v->
name,
"relaxdtmf")) {
2471 }
else if (!strcasecmp(v->
name,
"dtmfcodec") && atoi(v->
value)) {
2473 }
else if (!strcasecmp(v->
name,
"faxdetect")) {
2482 while ((word =
strsep(&next,
","))) {
2483 if (!strcasecmp(word,
"cng")) {
2485 }
else if (!strcasecmp(word,
"t38")) {
2493 }
else if (!strcasecmp(v->
name,
"t38support")) {
2494 if (!strcasecmp(v->
value,
"disabled"))
2496 if (!strcasecmp(v->
value,
"no"))
2498 else if (!strcasecmp(v->
value,
"faxgw"))
2500 else if (!strcasecmp(v->
value,
"yes"))
2502 }
else if (!strcasecmp(v->
name,
"aniasdni")) {
2546 if (0 == friend_type) {
2551 if (!strcasecmp(v->
name,
"h323id")) {
2558 }
else if (!strcasecmp(v->
name,
"e164")) {
2561 for(tmp = v->
value; *tmp; tmp++) {
2562 if (!isdigit(*tmp)) {
2577 }
else if (!strcasecmp(v->
name,
"email")) {
2584 }
else if (!strcasecmp(v->
name,
"url")) {
2591 }
else if (!strcasecmp(v->
name,
"port")) {
2593 }
else if (!strcasecmp(v->
name,
"host") || !strcasecmp(v->
name,
"ip")) {
2601 }
else if (!strcasecmp(v->
name,
"outgoinglimit")) {
2608 }
else if (!strcasecmp(v->
name,
"accountcode")) {
2610 }
else if (!strcasecmp(v->
name,
"faststart")) {
2612 }
else if (!strcasecmp(v->
name,
"h245tunneling")) {
2614 }
else if (!strcasecmp(v->
name,
"directrtp") || !strcasecmp(v->
name,
"directmedia")) {
2617 }
else if (!strcasecmp(v->
name,
"earlydirect") || !strcasecmp(v->
name,
"directrtpsetup")) {
2619 }
else if (!strcasecmp(v->
name,
"g729onlyA")) {
2621 }
else if (!strcasecmp(v->
name,
"nat")) {
2623 }
else if (!strcasecmp(v->
name,
"rtptimeout")) {
2627 }
else if (!strcasecmp(v->
name,
"rtpmask")) {
2629 (regcomp(&peer->
rtpmask->regex, v->
value, REG_EXTENDED)
2636 }
else if (!strcasecmp(v->
name,
"disallow")) {
2638 }
else if (!strcasecmp(v->
name,
"allow")) {
2639 const char* tcodecs = v->
value;
2640 if (!strcasecmp(v->
value,
"all")) {
2641 tcodecs =
"ulaw,alaw,g729,g723,gsm";
2644 }
else if (!strcasecmp(v->
name,
"amaflags")) {
2646 }
else if (!strcasecmp(v->
name,
"roundtrip")) {
2648 }
else if (!strcasecmp(v->
name,
"dtmfmode")) {
2649 if (!strcasecmp(v->
value,
"rfc2833"))
2651 if (!strcasecmp(v->
value,
"cisco"))
2653 else if (!strcasecmp(v->
value,
"q931keypad"))
2655 else if (!strcasecmp(v->
value,
"h245alphanumeric"))
2657 else if (!strcasecmp(v->
value,
"h245signal"))
2659 else if (!strcasecmp(v->
value,
"inband"))
2661 }
else if (!strcasecmp(v->
name,
"relaxdtmf")) {
2663 }
else if (!strcasecmp(v->
name,
"dtmfcodec") && atoi(v->
value)) {
2665 }
else if (!strcasecmp(v->
name,
"faxdetect")) {
2674 while ((word =
strsep(&next,
","))) {
2675 if (!strcasecmp(word,
"cng")) {
2677 }
else if (!strcasecmp(word,
"t38")) {
2685 }
else if (!strcasecmp(v->
name,
"t38support")) {
2686 if (!strcasecmp(v->
value,
"disabled"))
2688 if (!strcasecmp(v->
value,
"no"))
2690 else if (!strcasecmp(v->
value,
"faxgw"))
2692 else if (!strcasecmp(v->
value,
"yes"))
2707 struct ooAliases * pNewAlias =
NULL;
2711 ast_verb(0,
"--- ooh323_do_reload\n");
2716 ooGkClientDestroy();
2722 if (
gRasGkMode == RasUseSpecificGatekeeper ||
2726 ooGkClientStart(
gH323ep.gkClient);
2731 ast_verb(0,
"updating local aliases\n");
2734 for (pNewAlias =
gAliasList; pNewAlias; pNewAlias = pNewAlias->next) {
2735 switch (pNewAlias->type) {
2736 case T_H225AliasAddress_h323_ID:
2737 ooH323EpAddAliasH323ID(pNewAlias->value);
2739 case T_H225AliasAddress_dialedDigits:
2740 ooH323EpAddAliasDialedDigits(pNewAlias->value);
2742 case T_H225AliasAddress_email_ID:
2743 ooH323EpAddAliasEmailID(pNewAlias->value);
2754 ooH323EpAddAliasH323ID(peer->
h323id);
2757 ooH323EpAddAliasEmailID(peer->
email);
2760 ooH323EpAddAliasDialedDigits(peer->
e164);
2763 ooH323EpAddAliasURLID(peer->
url);
2770 ast_verb(0,
"+++ ooh323_do_reload\n");
2785 "Usage: ooh323 reload\n" 2786 " Reload OOH323 config.\n";
2796 ast_verb(0,
"--- ooh323_reload\n");
2800 ast_verb(0,
"Previous OOH323 reload not yet done\n");
2808 ast_verb(0,
"+++ ooh323_reload\n");
2816 struct ooAliases *pNewAlias =
NULL, *cur, *prev;
2826 ast_verb(0,
"--- reload_config\n");
2841 ast_verb(0,
" reload_config - Freeing up alias list\n");
2851 ooH323EpClearAllAliases();
2892 if (!strcasecmp(v->
name,
"port")) {
2894 }
else if (!strcasecmp(v->
name,
"bindaddr")) {
2904 }
else if (!strcasecmp(v->
name,
"h225portrange")) {
2908 endlimit = strchr(temp,
',');
2916 ast_log(
LOG_ERROR,
"h225portrange: Invalid format, separate port range with \",\"\n");
2918 }
else if (!strcasecmp(v->
name,
"gateway")) {
2920 }
else if (!strcasecmp(v->
name,
"faststart")) {
2923 ooH323EpEnableFastStart();
2925 ooH323EpDisableFastStart();
2926 }
else if (!strcasecmp(v->
name,
"mediawaitforconnect")) {
2929 ooH323EpEnableMediaWaitForConnect();
2931 ooH323EpDisableMediaWaitForConnect();
2932 }
else if (!strcasecmp(v->
name,
"h245tunneling")) {
2935 ooH323EpEnableH245Tunneling();
2937 ooH323EpDisableH245Tunneling();
2938 }
else if (!strcasecmp(v->
name,
"directrtp") || !strcasecmp(v->
name,
"directmedia")) {
2941 }
else if (!strcasecmp(v->
name,
"earlydirect") || !strcasecmp(v->
name,
"directrtpsetup")) {
2943 }
else if (!strcasecmp(v->
name,
"g729onlyA")) {
2945 }
else if (!strcasecmp(v->
name,
"roundtrip")) {
2947 }
else if (!strcasecmp(v->
name,
"trybemaster")) {
2950 ooH323EpTryBeMaster(1);
2952 ooH323EpTryBeMaster(0);
2953 }
else if (!strcasecmp(v->
name,
"h323id")) {
2954 pNewAlias =
ast_calloc(1,
sizeof(
struct ooAliases));
2963 pNewAlias->type = T_H225AliasAddress_h323_ID;
2968 }
else if (!strcasecmp(v->
name,
"e164")) {
2971 for(tmp = v->
value; *tmp; tmp++) {
2972 if (!isdigit(*tmp)) {
2978 pNewAlias =
ast_calloc(1,
sizeof(
struct ooAliases));
2984 pNewAlias->type = T_H225AliasAddress_dialedDigits;
2992 }
else if (!strcasecmp(v->
name,
"email")) {
2993 pNewAlias =
ast_calloc(1,
sizeof(
struct ooAliases));
2999 pNewAlias->type = T_H225AliasAddress_email_ID;
3004 }
else if (!strcasecmp(v->
name,
"t35country")) {
3006 }
else if (!strcasecmp(v->
name,
"t35extensions")) {
3008 }
else if (!strcasecmp(v->
name,
"manufacturer")) {
3010 }
else if (!strcasecmp(v->
name,
"vendorid")) {
3012 }
else if (!strcasecmp(v->
name,
"versionid")) {
3014 }
else if (!strcasecmp(v->
name,
"callerid")) {
3016 }
else if (!strcasecmp(v->
name,
"incominglimit")) {
3018 }
else if (!strcasecmp(v->
name,
"outgoinglimit")) {
3020 }
else if (!strcasecmp(v->
name,
"gatekeeper")) {
3021 if (!strcasecmp(v->
value,
"DISABLE")) {
3023 }
else if (!strcasecmp(v->
value,
"DISCOVER")) {
3029 }
else if (!strcasecmp(v->
name,
"localras")) {
3032 }
else if (!strcasecmp(v->
name,
"logfile")) {
3033 if (v->
value[0] ==
'/') {
3038 }
else if (!strcasecmp(v->
name,
"context")) {
3041 }
else if (!strcasecmp(v->
name,
"nat")) {
3043 }
else if (!strcasecmp(v->
name,
"rtptimeout")) {
3047 }
else if (!strcasecmp(v->
name,
"tos")) {
3048 if (sscanf(v->
value,
"%30i", &format) == 1)
3049 gTOS = format & 0xff;
3050 else if (!strcasecmp(v->
value,
"lowdelay"))
3051 gTOS = IPTOS_LOWDELAY;
3052 else if (!strcasecmp(v->
value,
"throughput"))
3053 gTOS = IPTOS_THROUGHPUT;
3054 else if (!strcasecmp(v->
value,
"reliability"))
3055 gTOS = IPTOS_RELIABILITY;
3056 else if (!strcasecmp(v->
value,
"mincost"))
3058 else if (!strcasecmp(v->
value,
"none"))
3062 "'lowdelay', 'throughput', 'reliability', " 3063 "'mincost', or 'none'\n", v->
lineno);
3064 }
else if (!strcasecmp(v->
name,
"amaflags")) {
3066 }
else if (!strcasecmp(v->
name,
"accountcode")) {
3068 }
else if (!strcasecmp(v->
name,
"disallow")) {
3070 }
else if (!strcasecmp(v->
name,
"allow")) {
3071 const char* tcodecs = v->
value;
3072 if (!strcasecmp(v->
value,
"all")) {
3073 tcodecs =
"ulaw,alaw,g729,g723,gsm";
3076 }
else if (!strcasecmp(v->
name,
"dtmfmode")) {
3077 if (!strcasecmp(v->
value,
"inband"))
3079 else if (!strcasecmp(v->
value,
"rfc2833"))
3081 else if (!strcasecmp(v->
value,
"cisco"))
3083 else if (!strcasecmp(v->
value,
"q931keypad"))
3085 else if (!strcasecmp(v->
value,
"h245alphanumeric"))
3087 else if (!strcasecmp(v->
value,
"h245signal"))
3094 }
else if (!strcasecmp(v->
name,
"relaxdtmf")) {
3096 }
else if (!strcasecmp(v->
name,
"dtmfcodec") && atoi(v->
value)) {
3098 }
else if (!strcasecmp(v->
name,
"faxdetect")) {
3107 while ((word =
strsep(&next,
","))) {
3108 if (!strcasecmp(word,
"cng")) {
3110 }
else if (!strcasecmp(word,
"t38")) {
3118 }
else if (!strcasecmp(v->
name,
"t38support")) {
3119 if (!strcasecmp(v->
value,
"disabled"))
3121 if (!strcasecmp(v->
value,
"no"))
3123 else if (!strcasecmp(v->
value,
"faxgw"))
3125 else if (!strcasecmp(v->
value,
"yes"))
3127 }
else if (!strcasecmp(v->
name,
"tracelevel")) {
3129 ooH323EpSetTraceLevel(
gTRCLVL);
3130 }
else if (!strcasecmp(v->
name,
"aniasdni")) {
3137 if (strcasecmp(cat,
"general")) {
3138 int friend_type = 0;
3141 friend_type = strcasecmp(utype,
"friend");
3142 if (!strcmp(utype,
"user") || 0 == friend_type) {
3153 if (!strcasecmp(utype,
"peer") || 0 == friend_type) {
3172 ooGetLocalIPAddress(
gIP);
3173 if (!strcmp(
gIP,
"127.0.0.1") || !strcmp(
gIP,
"::1")) {
3175 "specify it in ooh323.conf. OOH323 Disabled\n");
3181 ast_verb(0,
"+++ reload_config\n");
3195 e->
command =
"ooh323 show peer";
3197 "Usage: ooh323 show peer <name>\n" 3198 " List details of specific OOH323 peer.\n";
3211 if (!strcmp(peer->name, a->
argv[3])) {
3221 sprintf(ip_port,
"%s:%d", peer->ip, peer->port);
3222 ast_cli(a->
fd,
"%-15.15s%s\n",
"Name: ", peer->name);
3223 ast_cli(a->
fd,
"%s:%s,%s\n",
"FastStart/H.245 Tunneling", peer->faststart?
"yes":
"no",
3224 peer->h245tunneling?
"yes":
"no");
3225 ast_cli(a->
fd,
"%-15s%s\n",
"DirectRTP", peer->directrtp ?
"yes" :
"no");
3226 ast_cli(a->
fd,
"%-15s%s\n",
"EarlyDirectRTP", peer->earlydirect ?
"yes" :
"no");
3227 ast_cli(a->
fd,
"%-15.15s",
"DTMF Mode: ");
3230 ast_cli(a->
fd,
"%-15.15s%d\n",
"DTMF Codec: ", peer->dtmfcodec);
3233 ast_cli(a->
fd,
"%-15.15s%d\n",
"DTMF Codec: ", peer->dtmfcodec);
3237 ast_cli(a->
fd,
"%s\n",
"h245alphanumeric");
3241 ast_cli(a->
fd,
"%s\n",
"inband-relaxed");
3250 }
else if (peer->t38support ==
T38_FAXGW) {
3251 ast_cli(a->
fd,
"%s\n",
"faxgw/chan_sip compatible");
3254 ast_cli(a->
fd,
"%-20s%s\n",
"FAX Detect:",
"Yes");
3256 ast_cli(a->
fd,
"%-20s%s\n",
"FAX Detect:",
"Cng");
3258 ast_cli(a->
fd,
"%-20s%s\n",
"FAX Detect:",
"T.38");
3260 ast_cli(a->
fd,
"%-20s%s\n",
"FAX Detect:",
"No");
3263 ast_cli(a->
fd,
"%-15.15s%s\n",
"AccountCode: ", peer->accountcode);
3265 ast_cli(a->
fd,
"%-15.15s%s\n",
"IP:Port: ", ip_port);
3266 ast_cli(a->
fd,
"%-15.15s%u\n",
"OutgoingLimit: ", peer->outgoinglimit);
3267 ast_cli(a->
fd,
"%-15.15s%d\n",
"rtptimeout: ", peer->rtptimeout);
3268 ast_cli(a->
fd,
"%-15.15s%s\n",
"nat: ", peer->nat?
"yes":
"no");
3269 if (peer->rtpmaskstr[0]) {
3270 ast_cli(a->
fd,
"%-15.15s%s\n",
"rtpmask: ", peer->rtpmaskstr);
3272 if (peer->rtdrcount && peer->rtdrinterval) {
3273 ast_cli(a->
fd,
"%-15.15s%d,%d\n",
"RoundTrip: ", peer->rtdrcount, peer->rtdrinterval);
3290 #define FORMAT "%-15.15s %-15.15s %-23.23s %-s\n" 3294 e->
command =
"ooh323 show peers";
3296 "Usage: ooh323 show peers\n" 3297 " Lists all known OOH323 peers.\n";
3312 snprintf(ip_port,
sizeof(ip_port),
"%s:%d", peer->ip, peer->port);
3333 e->
command =
"ooh323 show user";
3335 "Usage: ooh323 show user <name>\n" 3336 " List details of specific OOH323 user.\n";
3350 if (!strcmp(user->name, a->
argv[3])) {
3360 ast_cli(a->
fd,
"%-15.15s%s\n",
"Name: ", user->name);
3361 ast_cli(a->
fd,
"%s:%s,%s\n",
"FastStart/H.245 Tunneling", user->faststart?
"yes":
"no",
3362 user->h245tunneling?
"yes":
"no");
3363 ast_cli(a->
fd,
"%-15s%s\n",
"DirectRTP", user->directrtp ?
"yes" :
"no");
3364 ast_cli(a->
fd,
"%-15s%s\n",
"EarlyDirectRTP", user->earlydirect ?
"yes" :
"no");
3365 ast_cli(a->
fd,
"%-15.15s",
"DTMF Mode: ");
3368 ast_cli(a->
fd,
"%-15.15s%d\n",
"DTMF Codec: ", user->dtmfcodec);
3371 ast_cli(a->
fd,
"%-15.15s%d\n",
"DTMF Codec: ", user->dtmfcodec);
3375 ast_cli(a->
fd,
"%s\n",
"h245alphanumeric");
3379 ast_cli(a->
fd,
"%s\n",
"inband-relaxed");
3388 }
else if (user->t38support ==
T38_FAXGW) {
3389 ast_cli(a->
fd,
"%s\n",
"faxgw/chan_sip compatible");
3392 ast_cli(a->
fd,
"%-20s%s\n",
"FAX Detect:",
"Yes");
3394 ast_cli(a->
fd,
"%-20s%s\n",
"FAX Detect:",
"Cng");
3396 ast_cli(a->
fd,
"%-20s%s\n",
"FAX Detect:",
"T.38");
3398 ast_cli(a->
fd,
"%-20s%s\n",
"FAX Detect:",
"No");
3401 ast_cli(a->
fd,
"%-15.15s%s\n",
"AccountCode: ", user->accountcode);
3403 ast_cli(a->
fd,
"%-15.15s%s\n",
"Context: ", user->context);
3404 ast_cli(a->
fd,
"%-15.15s%d\n",
"IncomingLimit: ", user->incominglimit);
3405 ast_cli(a->
fd,
"%-15.15s%u\n",
"InUse: ", user->inUse);
3406 ast_cli(a->
fd,
"%-15.15s%d\n",
"rtptimeout: ", user->rtptimeout);
3407 ast_cli(a->
fd,
"%-15.15s%s\n",
"nat: ", user->nat?
"yes":
"no");
3408 if (user->rtpmaskstr[0]) {
3409 ast_cli(a->
fd,
"%-15.15s%s\n",
"rtpmask: ", user->rtpmaskstr);
3412 if (user->rtdrcount && user->rtdrinterval) {
3413 ast_cli(a->
fd,
"%-15.15s%d,%d\n",
"RoundTrip: ", user->rtdrcount, user->rtdrinterval);
3428 #define FORMAT1 "%-15.15s %-15.15s %-15.15s %-s\n" 3432 e->
command =
"ooh323 show users";
3434 "Usage: ooh323 show users \n" 3435 " Lists all known OOH323 users.\n";
3453 user->accountcode, user->context,
3470 e->
command =
"ooh323 set debug [off]";
3472 "Usage: ooh323 set debug [off]\n" 3473 " Enables/Disables debugging of OOH323 channel driver\n";
3481 if (a->
argc == 4 && strcasecmp(a->
argv[3],
"off"))
3491 static int ooh323_show_channels(
int fd,
int argc,
char *argv[])
3503 e->
command =
"ooh323 show gk";
3505 "Usage: ooh323 show gk\n" 3506 " Shows Gatekeeper connection state\n";
3515 ast_cli(a->
fd,
"\nGateKeeper connection state:\n");
3517 ast_cli(a->
fd,
"No Gatekeeper is configured\n");
3522 snprintf(value,
sizeof(value),
"%s",
"No Gatekeeper");
3523 }
else if (
gRasGkMode == RasDiscoverGatekeeper) {
3524 snprintf(value,
sizeof(value),
"%s",
"Discover");
3526 snprintf(value,
sizeof(value),
"%s",
gGatekeeper);
3528 ast_cli(a->
fd,
"%-20s%s\n",
"Gatekeeper:", value);
3529 switch(
gH323ep.gkClient->state) {
3531 ast_cli(a->
fd,
"%-20s%s\n",
"GK state:",
"Idle");
3533 case GkClientDiscovered:
3534 ast_cli(a->
fd,
"%-20s%s\n",
"GK state:",
"Discovered");
3536 case GkClientRegistered:
3537 ast_cli(a->
fd,
"%-20s%s\n",
"GK state:",
"Registered");
3539 case GkClientUnregistered:
3540 ast_cli(a->
fd,
"%-20s%s\n",
"GK state:",
"Unregistered");
3543 ast_cli(a->
fd,
"%-20s%s\n",
"GK state:",
"Error");
3545 case GkClientFailed:
3546 ast_cli(a->
fd,
"%-20s%s\n",
"GK state:",
"Failed");
3548 case GkClientStopped:
3549 ast_cli(a->
fd,
"%-20s%s\n",
"GK state:",
"Shutdown");
3562 ooAliases *pAlias =
NULL, *pAliasNext =
NULL;;
3566 e->
command =
"ooh323 show config";
3568 "Usage: ooh323 show config\n" 3569 " Shows global configuration of H.323 channel driver\n";
3578 ast_cli(a->
fd,
"\nObjective Open H.323 Channel Driver's Config:\n");
3579 snprintf(value,
sizeof(value),
"%s:%d",
gIP,
gPort);
3580 ast_cli(a->
fd,
"%-20s%s\n",
"IP:Port: ", value);
3590 extern OOH323EndPoint
gH323ep;
3591 ast_cli(a->
fd,
"%-20s%s\n",
"FASTSTART",
3592 (OO_TESTFLAG(gH323ep.flags, OO_M_FASTSTART) != 0) ?
"yes" :
"no");
3593 ast_cli(a->
fd,
"%-20s%s\n",
"TUNNELING",
3594 (OO_TESTFLAG(gH323ep.flags, OO_M_TUNNELING) != 0) ?
"yes" :
"no");
3595 ast_cli(a->
fd,
"%-20s%s\n",
"MEDIAWAITFORCONN",
3596 (OO_TESTFLAG(gH323ep.flags, OO_M_MEDIAWAITFORCONN) != 0) ?
"yes" :
"no");
3600 snprintf(value,
sizeof(value),
"%s",
"No Gatekeeper");
3601 }
else if (
gRasGkMode == RasDiscoverGatekeeper) {
3602 snprintf(value,
sizeof(value),
"%s",
"Discover");
3604 snprintf(value,
sizeof(value),
"%s",
gGatekeeper);
3606 ast_cli(a->
fd,
"%-20s%s\n",
"Gatekeeper:", value);
3609 ast_cli(a->
fd,
"%-20s%s\n",
"Capability:",
3621 ast_cli(a->
fd,
"%s\n",
"h245alphanumeric");
3625 ast_cli(a->
fd,
"%s\n",
"inband-relaxed");
3636 ast_cli(a->
fd,
"%s\n",
"faxgw/chan_sip compatible");
3639 ast_cli(a->
fd,
"%-20s%s\n",
"FAX Detect:",
"Yes");
3641 ast_cli(a->
fd,
"%-20s%s\n",
"FAX Detect:",
"Cng");
3643 ast_cli(a->
fd,
"%-20s%s\n",
"FAX Detect:",
"T.38");
3645 ast_cli(a->
fd,
"%-20s%s\n",
"FAX Detect:",
"No");
3661 pAliasNext = pAlias->next;
3663 ast_cli(a->
fd,
"\t%-30s\t%-30s\n",pAlias->value, pAliasNext->value);
3664 pAlias = pAliasNext->next;
3666 ast_cli(a->
fd,
"\t%-30s\n",pAlias->value);
3667 pAlias = pAlias->next;
3702 if (!strcasecmp(data,
"faxdetect")) {
3704 }
else if (!strcasecmp(data,
"t38support")) {
3706 }
else if (!strcasecmp(data,
"caller_h323id")) {
3708 }
else if (!strcasecmp(data,
"caller_dialeddigits")) {
3710 }
else if (!strcasecmp(data,
"caller_email")) {
3712 }
else if (!strcasecmp(data,
"h323id_url")) {
3714 }
else if (!strcasecmp(data,
"callee_h323id")) {
3716 }
else if (!strcasecmp(data,
"callee_dialeddigits")) {
3718 }
else if (!strcasecmp(data,
"callee_email")) {
3720 }
else if (!strcasecmp(data,
"callee_url")) {
3748 if (!strcasecmp(data,
"faxdetect")) {
3760 while ((word =
strsep(&next,
","))) {
3761 if (!strcasecmp(word,
"cng")) {
3763 }
else if (!strcasecmp(word,
"t38")) {
3772 }
else if (!strcasecmp(data,
"t38support")) {
3789 struct ooAliases * pNewAlias =
NULL;
3791 OOH225MsgCallbacks h225Callbacks = {0, 0, 0, 0};
3793 OOH323CALLBACKS h323Callbacks = {
3797 .onIncomingCall =
NULL,
3801 .openLogicalChannels =
NULL,
3864 ooH323EpSetAsGateway();
3868 ooH323EpDisableAutoAnswer();
3869 ooH323EpSetH225MsgCallbacks(h225Callbacks);
3870 ooH323EpSetTraceLevel(
gTRCLVL);
3871 ooH323EpSetLocalAddress(
gIP,
gPort);
3873 ast_debug(1,
"OOH323 channel is in IP6 mode\n");
3882 for (pNewAlias =
gAliasList; pNewAlias; pNewAlias = pNewAlias->next) {
3883 switch (pNewAlias->type) {
3884 case T_H225AliasAddress_h323_ID:
3885 ooH323EpAddAliasH323ID(pNewAlias->value);
3887 case T_H225AliasAddress_dialedDigits:
3888 ooH323EpAddAliasDialedDigits(pNewAlias->value);
3890 case T_H225AliasAddress_email_ID:
3891 ooH323EpAddAliasEmailID(pNewAlias->value);
3902 if(peer->
email) ooH323EpAddAliasEmailID(peer->
email);
3903 if(peer->
e164) ooH323EpAddAliasDialedDigits(peer->
e164);
3904 if(peer->
url) ooH323EpAddAliasURLID(peer->
url);
3911 ooH323EpEnableMediaWaitForConnect();
3913 ooH323EpDisableMediaWaitForConnect();
3917 ooH323EpEnableFastStart();
3919 ooH323EpDisableFastStart();
3922 ooH323EpDisableH245Tunneling();
3925 ooH323EpTryBeMaster(1);
3927 ooH323EpEnableManualRingback();
3932 else if (
gRasGkMode == RasDiscoverGatekeeper)
3936 ooH323EpSetH323Callbacks(h323Callbacks);
3949 if (ooCreateH323Listener() != OO_OK) {
3951 "OOH323 DISABLED\n");
3963 "OOH323 DISABLED\n");
3985 ast_verb(0,
"Previous OOH323 reload not yet done\n");
3993 ast_verb(0,
"+++ ooh323_reload\n");
4016 if (
gH323ep.gkClient &&
gH323ep.gkClient->state == GkClientStopped) {
4017 ooGkClientDestroy();
4018 ast_verb(0,
"Restart stopped gatekeeper client\n");
4021 ooGkClientStart(
gH323ep.gkClient);
4029 h323_next = h323->
next;
4063 pthread_testcancel();
4067 if ((res < 0) || (res > 1000)) {
4071 pthread_testcancel();
4084 pthread_attr_t attr;
4102 pthread_attr_init(&attr);
4103 pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
4124 ast_verb(0,
"--- ooh323_destroy \n");
4132 if (cur == p) {
break; }
4144 if (cur->callToken) {
4146 ast_verb(0,
" Destroying %s\n", cur->callToken);
4151 if (cur->username) {
4161 if (cur->callerid_name) {
4163 cur->callerid_name = 0;
4166 if (cur->callerid_num) {
4168 cur->callerid_num = 0;
4185 ast_debug(1,
"Failed to grab lock, trying again\n");
4203 if (cur->neighbor.user) {
4205 if(user && user->
inUse > 0) {
4225 ast_verb(0,
"+++ ooh323_destroy\n");
4246 prev->rtpmask->inuse--;
4248 if (prev->rtpmask->inuse == 0) {
4249 regfree(&prev->rtpmask->regex);
4277 prev->rtpmask->inuse--;
4279 if (prev->rtpmask->inuse == 0) {
4280 regfree(&prev->rtpmask->regex);
4299 struct ooAliases *cur =
NULL, *prev =
NULL;
4302 ast_verb(0,
"--- ooh323 unload_module \n");
4313 ast_verb(0,
" unload_module - hanging up all interfaces\n");
4333 ast_verb(0,
" unload_module - stopping monitor thread\n");
4352 ast_verb(0,
" unload_module - stopping stack thread\n");
4358 ast_verb(0,
" unload_module - freeing up memory used by interfaces\n");
4380 ast_verb(0,
" unload_module - deleting users\n");
4386 ast_verb(0,
" unload_module - deleting peers\n");
4392 ast_verb(0,
" unload_module - Freeing up alias list\n");
4405 ast_verb(0,
" unload_module- destroying OOH323 endpoint \n");
4410 ast_verb(0,
"+++ ooh323 unload_module \n");
4449 ast_verb(0,
"+++ ooh323 get_rtp_peer \n");
4479 ast_verb(0,
"--- ooh323 get_rtp_peer, res = %d\n", (
int) res);
4509 return OO_G711ULAW64K;
4511 return OO_G711ALAW64K;
4513 return OO_GSMFULLRATE;
4525 return OO_H263VIDEO;
4567 ast_verb(0,
" set_rtp_peer - No callToken\n");
4584 ast_verb(0,
"ooh323_set_rtp_peer return back to local\n");
4586 ooUpdateLogChannels(callToken,
"0.0.0.0" , 0);
4601 char lhost[INET6_ADDRSTRLEN];
4604 ooMediaInfo mediaInfo;
4608 ast_verb(0,
"--- configure_local_rtp\n");
4610 memset(&mediaInfo, 0,
sizeof(mediaInfo));
4631 ast_debug(1,
"Failed to grab lock, trying again\n");
4666 p->
rtp, p->
dtmfcodec,
"audio",
"cisco-telephone-event", 0);
4688 ast_copy_string(mediaInfo.lMediaIP, lhost,
sizeof(mediaInfo.lMediaIP));
4689 mediaInfo.lMediaPort = lport;
4690 mediaInfo.lMediaCntrlPort = mediaInfo.lMediaPort + 1;
4694 strcpy(mediaInfo.dir,
"transmit");
4696 ooAddMediaInfo(call, mediaInfo);
4697 strcpy(mediaInfo.dir,
"receive");
4698 ooAddMediaInfo(call, mediaInfo);
4699 if (mediaInfo.cap == OO_G729A) {
4700 strcpy(mediaInfo.dir,
"transmit");
4701 mediaInfo.cap = OO_G729;
4702 ooAddMediaInfo(call, mediaInfo);
4703 strcpy(mediaInfo.dir,
"receive");
4704 ooAddMediaInfo(call, mediaInfo);
4706 strcpy(mediaInfo.dir,
"transmit");
4707 mediaInfo.cap = OO_G729B;
4708 ooAddMediaInfo(call, mediaInfo);
4709 strcpy(mediaInfo.dir,
"receive");
4710 ooAddMediaInfo(call, mediaInfo);
4720 ast_copy_string(mediaInfo.lMediaIP, lhost,
sizeof(mediaInfo.lMediaIP));
4721 mediaInfo.lMediaPort = lport;
4722 mediaInfo.lMediaCntrlPort = mediaInfo.lMediaPort +1;
4723 mediaInfo.cap = OO_T38;
4724 strcpy(mediaInfo.dir,
"transmit");
4725 ooAddMediaInfo(call, mediaInfo);
4726 strcpy(mediaInfo.dir,
"receive");
4727 ooAddMediaInfo(call, mediaInfo);
4731 ast_verb(0,
"+++ configure_local_rtp\n");
4742 ast_verb(0,
"--- setup_rtp_remote %s:%d\n", remoteIp, remotePort);
4744 if (!remoteIp || !remoteIp[0] || !remotePort) {
4746 ast_verb(0,
"+++ setup_rtp_remote no data\n");
4754 if (!p || !p->
rtp) {
4768 ast_verb(0,
"+++ setup_rtp_remote\n");
4781 ast_verb(0,
"--- setup_rtp_connection %s:%d\n", remoteIp, remotePort);
4786 if (!p || !p->
rtp) {
4805 ast_verb(0,
"+++ setup_rtp_connection\n");
4815 ast_verb(0,
"--- close_rtp_connection\n");
4830 ast_verb(0,
"+++ close_rtp_connection\n");
4846 ast_verb(0,
"--- setup_udptl_connection\n");
4859 ast_debug(1,
"Failed to grab lock, trying again\n");
4896 ast_verb(0,
"+++ setup_udptl_connection\n");
4906 ast_verb(0,
"--- close_udptl_connection\n");
4917 ast_debug(1,
"Failed to grab lock, trying again\n");
4942 ast_verb(0,
"+++ close_udptl_connection\n");
4952 ooAliases *psAlias =
NULL;
4954 if (!call->ourAliases)
4956 for (psAlias = call->ourAliases; psAlias; psAlias = psAlias->next) {
4957 if (psAlias->type == T_H225AliasAddress_h323_ID) {
4961 if (psAlias->type == T_H225AliasAddress_dialedDigits) {
4966 if (psAlias->type == T_H225AliasAddress_url_ID) {
4970 if (psAlias->type == T_H225AliasAddress_email_ID) {
5002 ast_debug(1,
"Got UDPTL %u/%d len %d for %s\n",
5088 ast_debug(1,
"change mode to %d for %s\n", t38mode, call->callToken);
5092 ast_debug(1,
"mode for %s is already %d\n", call->callToken,
5101 ast_debug(1,
"Failed to grab lock, trying again\n");
5124 const char *target_context;
5125 ast_debug(1,
"* Detected T.38 Request\n");
5142 if (call->T38FarMaxDatagram) {
5147 if (call->T38Version) {
5148 parameters.
version = call->T38Version;
5153 ¶meters,
sizeof(parameters));
5165 ¶meters,
sizeof(parameters));
5183 return OO_REASON_REMOTE_REJECTED;
5185 return OO_REASON_NOUSER;
5187 return OO_REASON_REMOTE_BUSY;
5189 return OO_REASON_NOCOMMON_CAPABILITIES;
5191 return OO_REASON_REMOTE_BUSY;
5193 return OO_REASON_REMOTE_NOANSWER;
5195 return OO_REASON_REMOTE_CLEARED;
5198 return OO_REASON_UNKNOWN;
5209 case OO_REASON_REMOTE_REJECTED:
5211 case OO_REASON_NOUSER:
5213 case OO_REASON_REMOTE_BUSY:
5214 case OO_REASON_LOCAL_BUSY:
5216 case OO_REASON_NOCOMMON_CAPABILITIES:
5218 case OO_REASON_REMOTE_CONGESTED:
5219 case OO_REASON_LOCAL_CONGESTED:
5221 case OO_REASON_REMOTE_NOANSWER:
5223 case OO_REASON_UNKNOWN:
5224 case OO_REASON_INVALIDMESSAGE:
5225 case OO_REASON_TRANSPORTFAILURE:
5227 case OO_REASON_REMOTE_CLEARED:
5237 void ast_ooh323c_exit()
5239 ooGkClientDestroy();
5249 .requires =
"udptl",
static char * ast_sockaddr_stringify_addr(const struct ast_sockaddr *addr)
Wrapper around ast_sockaddr_stringify_fmt() to return an address only.
int ast_io_wait(struct io_context *ioc, int howlong)
Waits for IO.
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
static int ooh323_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen)
struct ast_variable * next
enum sip_cc_notify_state state
void ast_party_connected_line_init(struct ast_party_connected_line *init)
Initialize the given connected line structure.
#define ast_channel_lock(chan)
struct ast_frame * ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp, struct ast_frame *inf)
Return AST_FRAME_NULL frames when there is silence, AST_FRAME_BUSY on busies, and call progress...
static struct ast_frame * ooh323_read(struct ast_channel *ast)
Main Channel structure associated with a channel.
static char gContext[AST_MAX_EXTENSION]
static struct ooAliases * gAliasList
#define AST_CLI_DEFINE(fn, txt,...)
#define ast_frdup(fr)
Copies a frame.
char * str
Subscriber phone number (Malloced)
static int ooh323_answer(struct ast_channel *ast)
int ast_queue_control(struct ast_channel *chan, enum ast_control_frame_type control)
Queue a control frame without payload.
static struct ast_cli_entry cli_ooh323[]
static int ooh323_digit_begin(struct ast_channel *ast, char digit)
static struct ast_sched_context * sched
unsigned short ast_channel_transfercapability(const struct ast_channel *chan)
static char * handle_cli_ooh323_show_peers(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
struct ooh323_peer * find_peer(const char *name, int port)
void close_udptl_connection(ooCallData *call)
static struct ast_peer_list peerl
Channels have this property if they can accept input with jitter; i.e. most VoIP channels.
static const char config[]
static pthread_t monitor_thread
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.
static int ooh323_queryoption(struct ast_channel *ast, int option, void *data, int *datalen)
int ast_sched_runq(struct ast_sched_context *con)
Runs the queue.
static char gIP[2+8 *4+7]
struct ast_party_id id
Connected party ID.
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
void * ast_channel_tech_pvt(const struct ast_channel *chan)
#define AST_CAUSE_NORMAL_TEMPORARY_FAILURE
struct ooh323_peer * next
#define ast_test_flag(p, flag)
#define AST_CAUSE_SWITCH_CONGESTION
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category_name)
static int h323_reloading
static void ast_sockaddr_copy(struct ast_sockaddr *dst, const struct ast_sockaddr *src)
Copies the data from one ast_sockaddr to another.
char context[AST_MAX_EXTENSION]
struct ast_party_name name
Subscriber name.
#define DSP_DIGITMODE_DTMF
void ast_channel_unregister(const struct ast_channel_tech *tech)
Unregister a channel technology.
int onNewCallCreated(ooCallData *call)
void ast_dsp_free(struct ast_dsp *dsp)
struct ast_module * myself
#define DSP_FEATURE_DIGIT_DETECT
#define AST_CAUSE_UNALLOCATED
void ast_channel_hangupcause_set(struct ast_channel *chan, int value)
static int ooh323_call(struct ast_channel *ast, const char *dest, int timeout)
static int unload_module(void)
static enum ast_rtp_glue_result ooh323_get_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance **rtp)
char callee_dialedDigits[AST_MAX_EXTENSION]
void ast_channel_set_rawwriteformat(struct ast_channel *chan, struct ast_format *format)
#define ast_set_flag(p, flag)
struct ast_rtp_codecs * ast_rtp_instance_get_codecs(struct ast_rtp_instance *instance)
Get the codecs structure of an RTP instance.
#define DEADLOCK_AVOIDANCE(lock)
descriptor for a cli entry.
struct ast_sockaddr redirip
enum ast_pbx_result ast_pbx_start(struct ast_channel *c)
Create a new thread and start the PBX.
char caller_h323id[AST_MAX_EXTENSION]
int ast_jb_read_conf(struct ast_jb_conf *conf, const char *varname, const char *value)
Sets jitterbuffer configuration property.
struct ast_dsp * ast_dsp_new(void)
Allocates a new dsp, assumes 8khz for internal sample rate.
int ooh323c_start_call_thread(ooCallData *call)
char callee_h323id[AST_MAX_EXTENSION]
int ast_rtp_instance_early_bridge(struct ast_channel *c0, struct ast_channel *c1)
Early bridge two channels that use RTP instances.
struct ooh323_user * next
Structure for variables, used for configurations and for channel variables.
int ast_rtp_instance_set_qos(struct ast_rtp_instance *instance, int tos, int cos, const char *desc)
Set QoS parameters on an RTP session.
int ast_rtp_instance_write(struct ast_rtp_instance *instance, struct ast_frame *frame)
Send a frame out over RTP.
#define ast_rtp_glue_register(glue)
static void ooh323_get_codec(struct ast_channel *chan, struct ast_format_cap *result)
struct ooh323_peer * peers
enum ast_control_t38 request_response
struct ast_frame * ooh323_rtp_read(struct ast_channel *ast, struct ooh323_pvt *p)
Structure to pass both assignedid values to channel drivers.
Structure for an UDPTL session.
ast_channel_state
ast_channel states
char * str
Subscriber name (Malloced)
int ooh323c_stop_call_thread(ooCallData *call)
const char * ast_channel_amaflags2string(enum ama_flags flags)
Convert the enum representation of an AMA flag to a string representation.
ast_t38_state
Possible T38 states on channels.
#define ast_cond_wait(cond, mutex)
#define ast_cond_init(cond, attr)
#define ast_cli_register_multiple(e, len)
Register multiple commands.
int onOutgoingCall(ooCallData *call)
void ast_rtp_instance_set_timeout(struct ast_rtp_instance *instance, int timeout)
Set the RTP timeout value.
void ast_udptl_set_far_max_datagram(struct ast_udptl *udptl, unsigned int max_datagram)
sets far max datagram size. If max_datagram is = 0, the far max datagram size is set to a default val...
#define ast_mutex_lock(a)
static int ooh323_write(struct ast_channel *ast, struct ast_frame *f)
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_str_alloca(init_len)
#define ast_strdup(str)
A wrapper for strdup()
static int call(void *data)
void ast_rtp_codecs_set_framing(struct ast_rtp_codecs *codecs, unsigned int framing)
Set the framing used for a set of codecs.
char * ast_category_browse(struct ast_config *config, const char *prev_name)
Browse categories.
static struct ooh323_pvt * ooh323_alloc(int callref, char *callToken)
void ast_udptl_destroy(struct ast_udptl *udptl)
void setup_udptl_connection(ooCallData *call, const char *remoteIp, int remotePort)
#define AST_CAUSE_NORMAL_CIRCUIT_CONGESTION
void ast_cli(int fd, const char *fmt,...)
void ast_update_use_count(void)
Notify when usecount has been changed.
#define AST_CAUSE_INVALID_NUMBER_FORMAT
void ooh323_set_read_format(ooCallData *call, struct ast_format *fmt)
void ast_moh_stop(struct ast_channel *chan)
Turn off music on hold on a given channel.
Socket address structure.
#define ast_cond_signal(cond)
#define ast_verb(level,...)
static int ooh323_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
struct ast_frame_subclass subclass
int ast_queue_hangup_with_cause(struct ast_channel *chan, int cause)
Queue a hangup frame with hangupcause set.
#define ast_module_unref(mod)
Release a reference to the module.
pthread_cond_t ast_cond_t
#define ast_strlen_zero(foo)
struct ast_format * ast_channel_readformat(struct ast_channel *chan)
struct ooh323_peer * find_friend(const char *name, int port)
void ast_channel_tech_set(struct ast_channel *chan, const struct ast_channel_tech *value)
char context[AST_MAX_EXTENSION]
static int ast_sockaddr_isnull(const struct ast_sockaddr *addr)
Checks if the ast_sockaddr is null. "null" in this sense essentially means uninitialized, or having a 0 length.
void ast_udptl_get_us(const struct ast_udptl *udptl, struct ast_sockaddr *us)
enum ama_flags ast_channel_string2amaflag(const char *flag)
Convert a string to a detail record AMA flag.
#define ast_sockaddr_port(addr)
Get the port number of a socket address.
int onAlerting(ooCallData *call)
struct ast_party_id id
Caller party ID.
#define DSP_DIGITMODE_RELAXDTMF
#define ast_debug(level,...)
Log a DEBUG message.
int restart_monitor(void)
Start the channel monitor thread.
struct ast_format_cap * cap
char callee_email[AST_MAX_EXTENSION]
void ast_channel_set_rawreadformat(struct ast_channel *chan, struct ast_format *format)
static char gCallerID[AST_MAX_EXTENSION]
int onCallCleared(ooCallData *call)
void ast_rtp_instance_stop(struct ast_rtp_instance *instance)
Stop an RTP instance.
#define ast_config_load(filename, flags)
Load a config file.
static int ooh323_do_reload(void)
void ast_channel_queue_connected_line_update(struct ast_channel *chan, const struct ast_party_connected_line *connected, const struct ast_set_party_connected_line *update)
Queue a connected line update frame on a channel.
static int ooh323_hangup(struct ast_channel *ast)
void ast_channel_rings_set(struct ast_channel *chan, int value)
void ast_unregister_atexit(void(*func)(void))
Unregister a function registered with ast_register_atexit().
int ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
static int reload_module(void)
void ast_channel_nativeformats_set(struct ast_channel *chan, struct ast_format_cap *value)
static ast_mutex_t monlock
struct ast_party_connected_line * ast_channel_connected(struct ast_channel *chan)
static struct io_context * io
#define DEFAULT_H323ACCNT
#define AST_PTHREADT_NULL
static struct ao2_container * codecs
Registered codecs.
static int gIncomingLimit
Global IO variables are now in a struct in order to be made threadsafe.
#define AST_MAX_EXTENSION
#define AST_CAUSE_NORMAL_CLEARING
#define ao2_ref(o, delta)
int ooh323_convert_hangupcause_asteriskToH323(int cause)
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
int ast_softhangup(struct ast_channel *chan, int reason)
Softly hangup up a channel.
static char * handle_cli_ooh323_show_gk(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
enum ast_control_t38_rate rate
void ast_config_destroy(struct ast_config *config)
Destroys a config.
#define DSP_FEATURE_FAX_DETECT
int ast_register_atexit(void(*func)(void))
Register a function to be executed before Asterisk exits.
#define ast_strdupa(s)
duplicate a string in memory from the stack
int ast_dsp_set_faxmode(struct ast_dsp *dsp, int faxmode)
Set fax mode.
struct ast_format * writeformat
void ast_channel_amaflags_set(struct ast_channel *chan, enum ama_flags value)
void ooh323_delete_peer(struct ooh323_peer *peer)
int ooh323c_stop_stack_thread(void)
int ast_set_write_format(struct ast_channel *chan, struct ast_format *format)
Sets write format on channel chan.
#define AST_CAUSE_NO_ANSWER
static struct ast_jb_conf default_jbconf
static struct ast_user_list userl
int ast_exists_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid)
Determine whether an extension exists.
struct ast_format_cap * cap
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.
Structure to describe a channel "technology", ie a channel driver See for examples: ...
void ast_channel_adsicpe_set(struct ast_channel *chan, enum ast_channel_adsicpe value)
const char * ast_channel_exten(const struct ast_channel *chan)
struct OOH323Regex * rtpmask
static enum ast_rtp_glue_result ooh323_get_vrtp_peer(struct ast_channel *chan, struct ast_rtp_instance **rtp)
int ast_queue_frame(struct ast_channel *chan, struct ast_frame *f)
Queue one or more frames to a channel's frame queue.
char exten[AST_MAX_EXTENSION]
static struct ast_channel * ooh323_new(struct ooh323_pvt *i, int state, const char *host, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor)
int ooh323c_start_stack_thread()
#define CONFIG_STATUS_FILEUNCHANGED
char caller_email[AST_MAX_EXTENSION]
struct ast_sched_context * ast_sched_context_create(void)
Create a scheduler context.
static char * handle_cli_ooh323_show_users(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
static struct ast_rtp_glue ooh323_rtp
int ast_channel_fdno(const struct ast_channel *chan)
#define AST_CAUSE_FAILURE
int onProgress(ooCallData *call)
#define AST_OPTION_DIGIT_DETECT
unsigned int ast_udptl_get_far_max_ifp(struct ast_udptl *udptl)
retrieves far max ifp
int update_our_aliases(ooCallData *call, struct ooh323_pvt *p)
static ast_mutex_t ooh323c_cn_lock
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true". This function checks to see whether a string passed to it is an indication of an "true" value. It checks to see if the string is "yes", "true", "y", "t", "on" or "1".
#define H323_DTMF_H245ALPHANUMERIC
static struct ast_channel * ooh323_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)
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
int onCallEstablished(ooCallData *call)
void onModeChanged(ooCallData *call, int t38mode)
static int ooh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance *rtp, struct ast_rtp_instance *vrtp, struct ast_rtp_instance *trtp, const struct ast_format_cap *codecs, int nat_active)
void ast_udptl_set_peer(struct ast_udptl *udptl, const struct ast_sockaddr *them)
static int gMediaWaitForConnect
#define ast_sockaddr_set_port(addr, port)
Sets the port number of a socket address.
int ast_rtp_instance_sendcng(struct ast_rtp_instance *instance, int level)
Send a comfort noise packet to the RTP instance.
static int function_ooh323_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
OOH323 Dialplan function - writes ooh323 settings.
#define DSP_FAXMODE_DETECT_CED
#define ast_rtp_instance_set_remote_address(instance, address)
Set the address of the remote endpoint that we are sending RTP to.
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static int load_module(void)
static char gRASIP[2+8 *4+7]
Connected Line/Party information.
int ast_rtp_instance_dtmf_begin(struct ast_rtp_instance *instance, char digit)
Begin sending a DTMF digit.
static ast_mutex_t h323_reload_lock
int ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass)
Turn on music on hold on a given channel.
int configure_local_rtp(struct ooh323_pvt *p, ooCallData *call)
#define ast_cond_destroy(cond)
const char * ast_config_AST_LOG_DIR
struct ast_format_cap * capabilities
struct ast_format * readformat
int ast_softhangup_nolock(struct ast_channel *chan, int reason)
Softly hangup up a channel (no channel lock)
int ooh323_onReceivedDigit(OOH323CallData *call, const char *digit)
#define ast_channel_unlock(chan)
static void * do_monitor(void *data)
char * handle_cli_ooh323_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
static char version[AST_MAX_EXTENSION]
void ast_dsp_set_features(struct ast_dsp *dsp, int features)
Select feature set.
int source
Information about the source of an update.
struct ast_sockaddr udptlredirip
#define ast_calloc(num, len)
A wrapper for calloc()
#define ast_pthread_create(a, b, c, d)
struct ooh323_user * find_user(const char *name, const char *ip)
void ast_hangup(struct ast_channel *chan)
Hang up a channel.
int ast_udptl_fd(const struct ast_udptl *udptl)
int ast_parse_arg(const char *arg, enum ast_parse_flags flags, void *result,...)
The argument parsing routine.
int ast_rtp_instance_fd(struct ast_rtp_instance *instance, int rtcp)
Get the file descriptor for an RTP session (or RTCP)
Module has failed to load, may be in an inconsistent state.
struct ast_format_cap * cap
static const char tdesc[]
unsigned int flags
Combination of the AST_JB_ENABLED, AST_JB_FORCED and AST_JB_LOG flags.
char callee_url[AST_MAX_EXTENSION]
void setup_rtp_connection(ooCallData *call, const char *remoteIp, int remotePort)
structure to hold users read from users.conf
void ast_rtp_instance_get_local_address(struct ast_rtp_instance *instance, struct ast_sockaddr *address)
Get the local address that we are expecting RTP on.
Structure used to handle boolean flags.
int ast_rtp_instance_destroy(struct ast_rtp_instance *instance)
Destroy an RTP instance.
#define ast_clear_flag(p, flag)
void ast_channel_set_fd(struct ast_channel *chan, int which, int fd)
static char vendor[AST_MAX_EXTENSION]
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
int reload_config(int reload)
static int gOutgoingLimit
Indicate what information in ast_party_connected_line should be set.
void ast_jb_configure(struct ast_channel *chan, const struct ast_jb_conf *conf)
Configures a jitterbuffer on a channel.
struct ast_udptl * ast_udptl_new_with_bindaddr(struct ast_sched_context *sched, struct io_context *io, int callbackmode, struct ast_sockaddr *in)
void ast_channel_exten_set(struct ast_channel *chan, const char *value)
struct ast_format_cap * ast_channel_nativeformats(const struct ast_channel *chan)
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name...
struct ast_frame * ast_udptl_read(struct ast_udptl *udptl)
static char * handle_cli_ooh323_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
struct ast_frame ast_null_frame
const char * ast_variable_retrieve(struct ast_config *config, const char *category, const char *variable)
struct ast_set_party_id id
#define H323_DTMF_H245SIGNAL
char caller_dialedDigits[AST_MAX_EXTENSION]
void close_rtp_connection(ooCallData *call)
#define AST_CAUSE_REQUESTED_CHAN_UNAVAIL
static char gInitError[256]
char * strsep(char **str, const char *delims)
static struct ast_channel_tech ooh323_tech
#define ao2_replace(dst, src)
int ooh323c_set_capability(struct ast_format_cap *cap, int dtmf, int dtmfcodec)
static struct ast_format_cap * gCap
int ast_channel_hangupcause(const struct ast_channel *chan)
struct OOH323Regex * rtpmask
void ast_channel_context_set(struct ast_channel *chan, const char *value)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
static ast_mutex_t usecnt_lock
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
static struct ooh323_peer * build_peer(const char *name, struct ast_variable *v, int friend_type)
const char * ast_channel_name(const struct ast_channel *chan)
int attribute_pure ast_false(const char *val)
Make sure something is false. Determine if a string containing a boolean value is "false"...
#define AST_CAUSE_USER_BUSY
struct ast_channel * owner
static struct ooh323_user * build_user(const char *name, struct ast_variable *v)
static int function_ooh323_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
OOH323 Dialplan function - reads ooh323 settings.
int ast_setstate(struct ast_channel *chan, enum ast_channel_state)
Change the state of a channel.
#define AST_PTHREADT_STOP
int ast_rtp_glue_unregister(struct ast_rtp_glue *glue)
Unregister RTP glue.
int ast_async_goto(struct ast_channel *chan, const char *context, const char *exten, int priority)
Set the channel to next execute the specified dialplan location.
int ast_udptl_write(struct ast_udptl *udptl, struct ast_frame *f)
static char gGatekeeper[100]
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.
static int t35countrycode
int ooh323_destroy(struct ooh323_pvt *p)
static struct ooh323_pvt * iflist
int ast_sched_wait(struct ast_sched_context *con) attribute_warn_unused_result
Determines number of seconds until the next outstanding event to take place.
void ast_udptl_set_tag(struct ast_udptl *udptl, const char *format,...)
Associates a character string 'tag' with a UDPTL session.
Data structure associated with a single frame of data.
void ast_channel_softhangup_internal_flag_add(struct ast_channel *chan, int value)
static int ooh323_digit_end(struct ast_channel *ast, char digit, unsigned int duration)
static char * handle_cli_ooh323_show_config(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
static struct ast_jb_conf global_jbconf
struct ast_rtp_instance * rtp
int ooh323_onReceivedSetup(ooCallData *call, Q931Message *pmsg)
#define DSP_FAXMODE_DETECT_CNG
const char * ast_channel_context(const struct ast_channel *chan)
static char * handle_cli_ooh323_show_user(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
void ast_channel_publish_snapshot(struct ast_channel *chan)
Publish a ast_channel_snapshot for a channel.
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.
union ast_frame::@263 data
static enum RasGatekeeperMode gRasGkMode
enum ast_frame_type frametype
#define ast_mutex_init(pmutex)
#define ast_channel_trylock(chan)
unsigned char valid
TRUE if the name information is valid/present.
void ooh323_set_write_format(ooCallData *call, struct ast_format *fmt, int txframes)
#define ast_mutex_destroy(a)
struct ast_format * format
#define H323_DTMF_INBANDRELAX
const char * ast_channel_macrocontext(const struct ast_channel *chan)
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 setup_rtp_remote(ooCallData *call, const char *remoteIp, int remotePort)
#define ASTERISK_GPL_KEY
The text the key() function should return.
#define AST_CAUSE_CALL_REJECTED
void ast_channel_priority_set(struct ast_channel *chan, int value)
#define ast_channel_alloc(needqueue, state, cid_num, cid_name, acctcode, exten, context, assignedids, requestor, amaflag,...)
Create a channel structure.
void ast_rtp_instance_update_source(struct ast_rtp_instance *instance)
Indicate that the RTP marker bit should be set on an RTP stream.
#define AST_CAUSE_BEARERCAPABILITY_NOTAVAIL
struct ast_format * ast_channel_writeformat(struct ast_channel *chan)
struct OOH323Regex * rtpmask
static snd_pcm_format_t format
struct ooh323_user * users
int ooh323_convert_hangupcause_h323ToAsterisk(int cause)
#define ast_rtp_instance_get_remote_address(instance, address)
Get the address of the remote endpoint that we are sending RTP to.
void ast_channel_tech_pvt_set(struct ast_channel *chan, void *value)
unsigned char valid
TRUE if the number information is valid/present.
#define ast_rtp_instance_get_and_cmp_remote_address(instance, address)
Get the address of the remote endpoint that we are sending RTP to, comparing its address to another...
const struct ast_channel_tech * ast_channel_tech(const struct ast_channel *chan)
General jitterbuffer configuration.
int ooh323c_set_capability_for_call(ooCallData *call, struct ast_format_cap *cap, int dtmf, int dtmfcodec, int t38support, int g729onlyA)
static struct ooh323_pvt * find_call(ooCallData *call)
#define FORMAT_STRING_SIZE
#define AST_CAUSE_CONGESTION
static struct ooh323_config ooconfig
int ast_sockaddr_is_ipv6(const struct ast_sockaddr *addr)
Determine if this is an IPv6 address.
static ast_mutex_t iflock
struct ast_rtp_instance * vrtp
#define AST_MUTEX_DEFINE_STATIC(mutex)
#define H323_DTMF_RFC2833
Structure for mutex and tracking information.
int ast_dsp_set_digitmode(struct ast_dsp *dsp, int digitmode)
Set digit mode.
#define AST_OPTION_T38_STATE
struct ast_sockaddr bindaddr
union ooh323_pvt::@7 neighbor
struct ast_frame * ast_rtp_instance_read(struct ast_rtp_instance *instance, int rtcp)
Receive a frame over RTP.
static char * handle_cli_ooh323_show_peer(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
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...
unsigned int call_reference
#define ast_mutex_unlock(a)
int ooh323_convertAsteriskCapToH323Cap(struct ast_format *format)
Channels have this property if they can create jitter; i.e. most VoIP channels.
static char gLogFile[PATH_MAX]
static char gAccountcode[80]
struct ast_party_number number
Subscriber phone number.
int ast_rtp_instance_dtmf_end(struct ast_rtp_instance *instance, char digit)
Stop sending a DTMF digit.
#define ast_module_ref(mod)
Hold a reference to the module.
struct io_context * io_context_create(void)
Creates a context Create a context for I/O operations Basically mallocs an IO structure and sets up s...