--- ./channels/ooh323cDriver.h 2009-07-28 22:25:56.000000000 +0400 +++ ../../asterisk-addons-1.6.1.0/./channels/ooh323cDriver.h 2009-07-11 04:42:18.000000000 +0400 @@ -27,6 +27,7 @@ #define H323_DTMF_H245ALPHANUMERIC (1 << 2) #define H323_DTMF_H245SIGNAL (1 << 3) #define H323_DTMF_INBAND (1 << 4) +#define H323_DTMF_INBANDRELAX (1 << 8) struct h323_pvt; int ooh323c_start_stack_thread(void); --- ./channels/chan_ooh323.c 2009-07-28 22:25:56.000000000 +0400 +++ ../../asterisk-addons-1.6.1.0/./channels/chan_ooh323.c 2009-07-11 04:55:57.000000000 +0400 @@ -129,7 +129,7 @@ char accountcode[256]; /* Account code */ int nat; int amaflags; - int progsent; /* progress is sent */ + int progsent; /* progress is sent */ struct ast_dsp *vad; struct ooh323_pvt *next; /* Next entity */ } *iflist = NULL; @@ -285,19 +285,23 @@ ast_channel_lock(ch); ch->tech = &ooh323_tech; - fmt = capability; - ch->nativeformats = (capability) ? 0 : AST_FORMAT_SLINEAR; + fmt = ast_codec_pref_index(&i->prefs, 0); + if (!fmt) + fmt = ast_best_codec(capability); - ch->fds[0] = ast_rtp_fd(i->rtp); - ch->fds[1] = ast_rtcp_fd(i->rtp); + ch->nativeformats = fmt; + /* ch->nativeformats = (capability) ? 0 : AST_FORMAT_SLINEAR; */ + + ast_channel_set_fd(ch, 0, ast_rtp_fd(i->rtp)); + ast_channel_set_fd(ch, 1, ast_rtcp_fd(i->rtp)); if (state == AST_STATE_RING) ch->rings = 1; ch->adsicpe = AST_ADSI_UNAVAILABLE; - ch->writeformat = fmt; + ch->writeformat = capability; ch->rawwriteformat = 0; - ch->readformat = fmt; + ch->readformat = capability; ch->rawreadformat = 0; ch->tech_pvt = i; i->owner = ch; @@ -306,6 +310,8 @@ if (i->dtmfmode & H323_DTMF_INBAND) { i->vad = ast_dsp_new(); ast_dsp_set_features(i->vad, DSP_FEATURE_DIGIT_DETECT); + if (i->dtmfmode & H323_DTMF_INBANDRELAX) + ast_dsp_set_digitmode(i->vad, DSP_DIGITMODE_DTMF | DSP_DIGITMODE_RELAXDTMF); } ast_mutex_lock(&usecnt_lock); @@ -354,6 +360,9 @@ ch = NULL; } } + + manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate", "Channel: %s\r\nChanneltype: %s\r\n" + "CallRef: %d\r\n", ch->name, "OOH323", i->call_reference); } else ast_log(LOG_WARNING, "Unable to allocate channel structure\n"); @@ -482,7 +491,8 @@ if (dest) { *dest = '\0'; dest++; - ext = tmp; + ext = dest; + dest = tmp; } else if ((dest = strchr(tmp, '@'))) { *dest = '\0'; dest++; @@ -523,7 +533,7 @@ p->capability = peer->capability; /* } */ memcpy(&p->prefs, &peer->prefs, sizeof(struct ast_codec_pref)); - p->dtmfmode = peer->dtmfmode; + p->dtmfmode |= peer->dtmfmode; ast_copy_string(p->accountcode, peer->accountcode, sizeof(p->accountcode)); p->amaflags = peer->amaflags; } else { @@ -801,7 +811,7 @@ if ((val = pbx_builtin_getvar_helper(ast, "CALLER_H323DIALEDDIGITS"))) { ast_copy_string(p->caller_dialedDigits, val, sizeof(p->caller_dialedDigits)); if(!p->callerid_num) - p->callerid_num = strdup(val); + p->callerid_num = strdup(val); } if ((val = pbx_builtin_getvar_helper(ast, "CALLER_H323EMAIL"))) { @@ -1080,6 +1090,9 @@ ooManualRingback(callToken); /* ast_mutex_unlock(&ooh323c_cmd_lock); */ break; + case AST_CONTROL_SRCUPDATE: + ast_rtp_new_source(p->rtp); + break; case AST_CONTROL_PROCEEDING: case -1: break; @@ -1465,7 +1478,7 @@ p->amaflags = user->amaflags; p->capability = user->capability; memcpy(&p->prefs, &user->prefs, sizeof(struct ast_codec_pref)); - p->dtmfmode = user->dtmfmode; + p->dtmfmode |= user->dtmfmode; /* Since, call is coming from a pbx user, no need to use gk */ /* OO_SETFLAG(p->flags, H323_DISABLEGK); OO_SETFLAG(call->flags, OO_M_DISABLEGK); */ @@ -1692,6 +1705,8 @@ struct ast_channel* c = p->owner; ast_queue_control(c, AST_CONTROL_ANSWER); ast_channel_unlock(p->owner); + manager_event(EVENT_FLAG_SYSTEM,"ChannelUpdate","Channel: %s\r\nChanneltype: %s\r\n" + "CallRef: %d\r\n", c->name, "OOH323", p->call_reference); } ast_mutex_unlock(&p->lock); @@ -1838,7 +1853,7 @@ if (gH323Debug) ast_verbose("--- build_user\n"); - user = ast_calloc(1,sizeof(struct ooh323_user)); + user = ast_calloc(1,sizeof(struct ooh323_user)); if (user) { ast_mutex_init(&user->lock); ast_copy_string(user->name, name, sizeof(user->name)); @@ -1859,21 +1874,22 @@ if (user->incominglimit < 0) user->incominglimit = 0; } else if (!strcasecmp(v->name, "accountcode")) { - strncpy(user->accountcode, v->value, sizeof(user->accountcode)-1); + strncpy(user->accountcode, v->value, + sizeof(user->accountcode)-1); } else if (!strcasecmp(v->name, "rtptimeout")) { user->rtptimeout = atoi(v->value); if (user->rtptimeout < 0) user->rtptimeout = gRTPTimeout; } else if (!strcasecmp(v->name, "disallow")) { - ast_parse_allow_disallow(&user->prefs, &user->capability, - v->value, 0); + ast_parse_allow_disallow(&user->prefs, + &user->capability, v->value, 0); } else if (!strcasecmp(v->name, "allow")) { const char* tcodecs = v->value; if (!strcasecmp(v->value, "all")) { tcodecs = "ulaw,alaw,g729,g723,gsm"; } - ast_parse_allow_disallow(&user->prefs, &user->capability, - tcodecs, 1); + ast_parse_allow_disallow(&user->prefs, + &user->capability, tcodecs, 1); } else if (!strcasecmp(v->name, "amaflags")) { user->amaflags = ast_cdr_amaflags2int(v->value); } else if (!strcasecmp(v->name, "ip")) { @@ -1892,6 +1908,10 @@ user->dtmfmode = H323_DTMF_H245ALPHANUMERIC; else if (!strcasecmp(v->value, "h245signal")) user->dtmfmode = H323_DTMF_H245SIGNAL; + else if (!strcasecmp(v->value, "inband")) + user->dtmfmode = H323_DTMF_INBAND; + } else if (!strcasecmp(v->name, "relaxdtmf")) { + user->dtmfmode |= ast_true(v->value) ? H323_DTMF_INBANDRELAX : 0; } v = v->next; } @@ -1916,12 +1936,12 @@ ast_mutex_init(&peer->lock); ast_copy_string(peer->name, name, sizeof(peer->name)); peer->capability = gCapability; - memcpy(&peer->prefs, &gPrefs, sizeof(peer->prefs)); + memcpy(&peer->prefs, &gPrefs, sizeof(peer->prefs)); peer->rtptimeout = gRTPTimeout; ast_copy_string(peer->accountcode, gAccountcode, sizeof(peer->accountcode)); peer->amaflags = gAMAFLAGS; peer->dtmfmode = gDTMFMode; - peer->port = 1720; + peer->port = 1720; if (0 == friend_type) { peer->mFriend = 1; } @@ -1992,6 +2012,10 @@ peer->dtmfmode = H323_DTMF_H245ALPHANUMERIC; else if (!strcasecmp(v->value, "h245signal")) peer->dtmfmode = H323_DTMF_H245SIGNAL; + else if (!strcasecmp(v->value, "inband")) + peer->dtmfmode = H323_DTMF_INBAND; + } else if (!strcasecmp(v->name, "relaxdtmf")) { + peer->dtmfmode |= ast_true(v->value) ? H323_DTMF_INBANDRELAX : 0; } v = v->next; } @@ -2284,7 +2308,9 @@ v->value); gDTMFMode = H323_DTMF_RFC2833; } - } + } else if (!strcasecmp(v->name, "relaxdtmf")) { + gDTMFMode |= ast_true(v->value) ? H323_DTMF_INBANDRELAX : 0; + } v = v->next; } @@ -2388,6 +2414,10 @@ ast_cli(a->fd, "%s\n", "h245alphanumeric"); else if (peer->dtmfmode & H323_DTMF_H245SIGNAL) ast_cli(a->fd, "%s\n", "h245signal"); + else if (peer->dtmfmode & H323_DTMF_INBAND && peer->dtmfmode & H323_DTMF_INBANDRELAX) + ast_cli(a->fd, "%s\n", "inband-relaxed"); + else if (peer->dtmfmode & H323_DTMF_INBAND) + ast_cli(a->fd, "%s\n", "inband"); else ast_cli(a->fd, "%s\n", "unknown"); ast_cli(a->fd, "%-15.15s%s\n", "AccountCode: ", peer->accountcode); @@ -2512,6 +2542,10 @@ ast_cli(a->fd, "%s\n", "h245alphanumeric"); else if (user->dtmfmode & H323_DTMF_H245SIGNAL) ast_cli(a->fd, "%s\n", "h245signal"); + else if (user->dtmfmode & H323_DTMF_INBAND && user->dtmfmode & H323_DTMF_INBANDRELAX) + ast_cli(a->fd, "%s\n", "inband-relaxed"); + else if (user->dtmfmode & H323_DTMF_INBAND) + ast_cli(a->fd, "%s\n", "inband"); else ast_cli(a->fd, "%s\n", "unknown"); ast_cli(a->fd, "%-15.15s%s\n", "AccountCode: ", user->accountcode); @@ -2671,6 +2705,10 @@ ast_cli(a->fd, "%s\n", "h245alphanumeric"); else if (gDTMFMode & H323_DTMF_H245SIGNAL) ast_cli(a->fd, "%s\n", "h245signal"); + else if (gDTMFMode & H323_DTMF_INBAND && gDTMFMode & H323_DTMF_INBANDRELAX) + ast_cli(a->fd, "%s\n", "inband-relaxed"); + else if (gDTMFMode & H323_DTMF_INBAND) + ast_cli(a->fd, "%s\n", "inband"); else ast_cli(a->fd, "%s\n", "unknown"); @@ -3314,6 +3352,8 @@ return OO_G729A; case AST_FORMAT_G726: return OO_G726; + case AST_FORMAT_G726_AAL2: + return OO_G726AAL2; case AST_FORMAT_G723_1: return OO_G7231; case AST_FORMAT_H263: @@ -3406,7 +3446,7 @@ { struct ooh323_pvt *p = NULL; struct sockaddr_in them; - char *callToken = (char *)NULL; + char *callToken = (char *)NULL; if (gH323Debug) ast_verbose("--- setup_rtp_connection\n"); @@ -3424,9 +3464,11 @@ them.sin_port = htons(remotePort); ast_rtp_set_peer(p->rtp, &them); - if(gH323Debug) - ast_verbose("+++ setup_rtp_connection\n"); + if (p->writeformat & AST_FORMAT_G726_AAL2) + ast_rtp_set_rtpmap_type(p->rtp, 2, "audio", "G726-32", AST_RTP_OPT_G726_NONSTANDARD); + if(gH323Debug) + ast_verbose("+++ setup_rtp_connection\n"); return; } @@ -3524,10 +3566,12 @@ /* if (!p->owner->readformat) p->owner->readformat = p->owner->nativeformats; */ - if ((p->dtmfmode & H323_DTMF_INBAND) && p->vad) { + if ((p->dtmfmode & H323_DTMF_INBAND) && p->vad && + (f->subclass == AST_FORMAT_SLINEAR || f->subclass == AST_FORMAT_ALAW || + f->subclass == AST_FORMAT_ULAW)) { f = ast_dsp_process(p->owner, p->vad, f); - if (f && (f->frametype == AST_FRAME_DTMF)) - ast_log(LOG_DEBUG, "* Detected inband DTMF '%c'\n",f->subclass); + if (f && (f->frametype == AST_FRAME_DTMF)) + ast_debug(1, "* Detected inband DTMF '%c'\n",f->subclass); } } } --- ./channels/ooh323cDriver.c 2009-07-28 22:25:56.000000000 +0400 +++ ../../asterisk-addons-1.6.1.0/./channels/ooh323cDriver.c 2009-07-11 04:42:18.000000000 +0400 @@ -203,6 +203,18 @@ } + if(format & AST_FORMAT_G726_AAL2) + { + if(gH323Debug) + ast_verbose("\tAdding g726aal2 capability to H323 endpoint\n"); + ret = ooH323EpAddG726Capability(OO_G726AAL2, gtxframes, grxframes, FALSE, + OORXANDTX, &ooh323c_start_receive_channel, + &ooh323c_start_transmit_channel, + &ooh323c_stop_receive_channel, + &ooh323c_stop_transmit_channel); + + } + if(format & AST_FORMAT_H263) { if(gH323Debug) @@ -312,12 +324,23 @@ } + if(format & AST_FORMAT_G726_AAL2) + { + if(gH323Debug) + ast_verbose("\tAdding g726aal2 capability to call (%s, %s)\n", + call->callType, call->callToken); + txframes = prefs->framing[x]; + ret = ooCallAddG726Capability(call, OO_G726AAL2, txframes, grxframes, FALSE, + OORXANDTX, &ooh323c_start_receive_channel, + &ooh323c_start_transmit_channel, + &ooh323c_stop_receive_channel, + &ooh323c_stop_transmit_channel); + + } + if(format & AST_FORMAT_G729A) { - if(gH323Debug) - ast_verbose("\tAdding g729A capability to call(%s, %s)\n", - call->callType, call->callToken); txframes = (prefs->framing[x])/10; if(gH323Debug) ast_verbose("\tAdding g729 capability to call(%s, %s)\n", @@ -327,6 +350,9 @@ &ooh323c_start_transmit_channel, &ooh323c_stop_receive_channel, &ooh323c_stop_transmit_channel); + if(gH323Debug) + ast_verbose("\tAdding g729A capability to call(%s, %s)\n", + call->callType, call->callToken); ret= ooCallAddG729Capability(call, OO_G729A, txframes, 24, OORXANDTX, &ooh323c_start_receive_channel, &ooh323c_start_transmit_channel, @@ -491,6 +517,8 @@ return AST_FORMAT_G723_1; case OO_G726: return AST_FORMAT_G726; + case OO_G726AAL2: + return AST_FORMAT_G726_AAL2; case OO_H263VIDEO: return AST_FORMAT_H263; default: --- ./channels/ooh323c/src/ooCapability.h 2009-07-28 22:25:56.000000000 +0400 +++ ../../asterisk-addons-1.6.1.0/./channels/ooh323c/src/ooCapability.h 2009-07-11 04:42:18.000000000 +0400 @@ -50,6 +50,7 @@ OO_IS13818_AUDIO = 14, #else OO_AMRNB = 13, + OO_G726AAL2 = 14, #endif OO_G729B = 15, OO_G729AB = 16, --- ./channels/ooh323c/src/ooh323.c 2009-07-28 22:25:56.000000000 +0400 +++ ../../asterisk-addons-1.6.1.0/./channels/ooh323c/src/ooh323.c 2009-07-22 23:36:43.000000000 +0400 @@ -1621,8 +1621,9 @@ ipAddress->ip.data[3]); call->remoteH245Port = ipAddress->port; - /* disable tunneling for this call */ + /* disable tunneling & faststart for this call */ OO_CLRFLAG (call->flags, OO_M_TUNNELING); + OO_CLRFLAG (call->flags, OO_M_FASTSTART); /*Establish an H.245 connection */ ret = ooCreateH245Connection(call); --- ./channels/ooh323c/src/ooq931.c 2009-07-28 22:25:56.000000000 +0400 +++ ../../asterisk-addons-1.6.1.0/./channels/ooh323c/src/ooq931.c 2009-07-22 23:40:11.000000000 +0400 @@ -1238,7 +1238,7 @@ memset (q931msg->userInfo, 0, sizeof(H225H323_UserInformation)); q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1; q931msg->userInfo->h323_uu_pdu.h245Tunneling = - OO_TESTFLAG(gH323ep.flags, OO_M_TUNNELING); + OO_TESTFLAG(call->flags, OO_M_TUNNELING); q931msg->userInfo->h323_uu_pdu.h323_message_body.t = T_H225H323_UU_PDU_h323_message_body_callProceeding; @@ -1337,7 +1337,7 @@ } memset (q931msg->userInfo, 0, sizeof(H225H323_UserInformation)); q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1; - q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(gH323ep.flags, + q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(call->flags, OO_M_TUNNELING); q931msg->userInfo->h323_uu_pdu.h323_message_body.t = T_H225H323_UU_PDU_h323_message_body_alerting; @@ -1467,7 +1467,7 @@ } memset (q931msg->userInfo, 0, sizeof(H225H323_UserInformation)); q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1; - q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(gH323ep.flags, + q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(call->flags, OO_M_TUNNELING); q931msg->userInfo->h323_uu_pdu.h323_message_body.t = T_H225H323_UU_PDU_h323_message_body_progress; @@ -1667,7 +1667,7 @@ } memset(releaseComplete, 0, sizeof(H225ReleaseComplete_UUIE)); q931msg->userInfo->h323_uu_pdu.m.h245TunnelingPresent=1; - q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(gH323ep.flags, + q931msg->userInfo->h323_uu_pdu.h245Tunneling = OO_TESTFLAG(call->flags, OO_M_TUNNELING); q931msg->userInfo->h323_uu_pdu.h323_message_body.t = T_H225H323_UU_PDU_h323_message_body_releaseComplete; @@ -2422,7 +2422,7 @@ setup->sourceCallSignalAddress.u.ipAddress = srcCallSignalIpAddress; setup->m.sourceCallSignalAddressPresent=TRUE; /* No fast start */ - if(!OO_TESTFLAG(gH323ep.flags, OO_M_FASTSTART)) + if(!OO_TESTFLAG(call->flags, OO_M_FASTSTART)) { setup->m.fastStartPresent = FALSE; } --- ./channels/ooh323c/src/ooh245.c 2009-07-28 22:25:56.000000000 +0400 +++ ../../asterisk-addons-1.6.1.0/./channels/ooh323c/src/ooh245.c 2009-07-22 23:34:37.000000000 +0400 @@ -326,7 +326,7 @@ H245AudioTelephonyEventCapability *ateCap=NULL; H245UserInputCapability *userInputCap = NULL; H245CapabilityTableEntry *entry=NULL; - H245AlternativeCapabilitySet *altSet=NULL; + H245AlternativeCapabilitySet *altSetAudio=NULL, *altSetVideo=NULL, *altSetDtmf=NULL; H245CapabilityDescriptor *capDesc=NULL; H245Message *ph245msg=NULL; H245VideoCapability *videoCap=NULL; @@ -373,6 +373,24 @@ termCap->sequenceNumber = ++(call->localTermCapSeqNo); termCap->protocolIdentifier = gh245ProtocolID; /* protocol id */ + /* Initialize alternate sets */ + altSetAudio = (H245AlternativeCapabilitySet*) + memAlloc(pctxt, sizeof(H245AlternativeCapabilitySet)); + altSetVideo = (H245AlternativeCapabilitySet*) + memAlloc(pctxt, sizeof(H245AlternativeCapabilitySet)); + altSetDtmf = (H245AlternativeCapabilitySet*) + memAlloc(pctxt, sizeof(H245AlternativeCapabilitySet)); + if(!altSetAudio || !altSetVideo || !altSetDtmf) + { + OOTRACEERR3("Error:Memory - ooSendTermCapMsg - altSet." + "(%s, %s)\n", call->callType, call->callToken); + return OO_FAILED; + } + memset(altSetDtmf, 0, sizeof(H245AlternativeCapabilitySet)); + memset(altSetVideo, 0, sizeof(H245AlternativeCapabilitySet)); + memset(altSetAudio, 0, sizeof(H245AlternativeCapabilitySet)); + + /* Add audio Capabilities */ dListInit(&(termCap->capabilityTable)); @@ -457,6 +475,8 @@ } entry->capabilityTableEntryNumber = i+1; dListAppend(pctxt , &(termCap->capabilityTable), entry); + altSetAudio->elem[altSetAudio->n] = i+1; + altSetAudio->n++; i++; } else if(epCap->capType == OO_CAP_TYPE_VIDEO) @@ -515,6 +535,8 @@ } entry->capabilityTableEntryNumber = i+1; dListAppend(pctxt , &(termCap->capabilityTable), entry); + altSetVideo->elem[altSetVideo->n] = i+1; + altSetVideo->n++; i++; } } @@ -548,6 +570,8 @@ entry->capabilityTableEntryNumber = i+1; dListAppend(pctxt , &(termCap->capabilityTable), entry); + altSetDtmf->elem[altSetDtmf->n] = i+1; + altSetDtmf->n++; i++; } @@ -582,6 +606,8 @@ entry->capabilityTableEntryNumber = i+1; dListAppend(pctxt , &(termCap->capabilityTable), entry); + altSetDtmf->elem[altSetDtmf->n] = i+1; + altSetDtmf->n++; i++; } @@ -616,6 +642,8 @@ entry->capabilityTableEntryNumber = i+1; dListAppend(pctxt , &(termCap->capabilityTable), entry); + altSetDtmf->elem[altSetDtmf->n] = i+1; + altSetDtmf->n++; i++; } @@ -643,7 +671,7 @@ alternate capabilities set. Need a way for application developer to specify the alternative capability sets. */ - for(j=0; jelem[0] = j+1; dListAppend(pctxt, &(capDesc->simultaneousCapabilities), altSet); - } + } */ + + if (altSetAudio->n) dListAppend(pctxt, &(capDesc->simultaneousCapabilities), altSetAudio); + if (altSetVideo->n) dListAppend(pctxt, &(capDesc->simultaneousCapabilities), altSetVideo); + if (altSetDtmf->n) dListAppend(pctxt, &(capDesc->simultaneousCapabilities), altSetDtmf); dListInit(&(termCap->capabilityDescriptors)); dListAppend(pctxt, &(termCap->capabilityDescriptors), capDesc); @@ -2972,6 +3031,7 @@ case OO_G711ULAW64K: case OO_G711ULAW56K: case OO_G726: + case OO_G726AAL2: case OO_AMRNB: case OO_G728: case OO_G729: --- ./channels/ooh323c/src/ooh323ep.h 2009-07-28 22:25:56.000000000 +0400 +++ ../../asterisk-addons-1.6.1.0/./channels/ooh323c/src/ooh323ep.h 2009-07-11 04:42:18.000000000 +0400 @@ -170,7 +170,7 @@ * * @return OO_OK, on success. OO_FAILED, on failure. */ -EXTERN int ooH323EpSetAsGateway(); +EXTERN int ooH323EpSetAsGateway(void); EXTERN int ooH323EpSetVersionInfo(int t35countrycode, int t35extensions, int manufacturer, char* vendor, char* version); @@ -599,28 +599,28 @@ * the endpoint. * @return OO_OK, on success; OO_FAILED, on failure */ -EXTERN int ooH323EpEnableDTMFH245Alphanumeric(); +EXTERN int ooH323EpEnableDTMFH245Alphanumeric(void); /** * This function is used to disable the H245(alphanumeric) dtmf capability for * the endpoint. * @return OO_OK, on success; OO_FAILED, on failure */ -EXTERN int ooH323EpDisableDTMFH245Alphanumeric(); +EXTERN int ooH323EpDisableDTMFH245Alphanumeric(void); /** * This function is used to enable the H245(signal) dtmf capability for * the endpoint. * @return OO_OK, on success; OO_FAILED, on failure */ -EXTERN int ooH323EpEnableDTMFH245Signal(); +EXTERN int ooH323EpEnableDTMFH245Signal(void); /** * This function is used to disable the H245(signal) dtmf capability for * the endpoint. * @return OO_OK, on success; OO_FAILED, on failure */ -EXTERN int ooH323EpDisableDTMFH245Signal(); +EXTERN int ooH323EpDisableDTMFH245Signal(void); /** * This function is used to add callbacks to the gatekeeper client. If user --- ./channels/ooh323c/src/ooCapability.c 2009-07-28 22:25:56.000000000 +0400 +++ ../../asterisk-addons-1.6.1.0/./channels/ooh323c/src/ooCapability.c 2009-07-11 04:42:18.000000000 +0400 @@ -619,6 +619,7 @@ case OO_G7231: return ooCapabilityCreateSimpleCapability(epCap, pctxt, dir); case OO_G726: + case OO_G726AAL2: case OO_AMRNB: return ooCapabilityCreateNonStandardCapability(epCap, pctxt, dir); case OO_GSMHALFRATE: @@ -652,6 +653,7 @@ memset(pATECap, 0, sizeof(H245AudioTelephonyEventCapability)); pATECap->dynamicRTPPayloadType = giDynamicRTPPayloadType; events = (char*)memAlloc(pctxt, strlen("0-16")+1); + memset(events, 0, strlen("0-16")+1); if(!events) { OOTRACEERR1("Error:Memory - ooCapabilityCreateDTMFCapability - events\n"); @@ -933,6 +935,7 @@ { case OO_AMRNB: case OO_G726: + case OO_G726AAL2: pAudio->t = T_H245AudioCapability_nonStandard; pAudio->u.nonStandard = (H245NonStandardParameter*)memAlloc(pctxt, sizeof(H245NonStandardParameter)); @@ -965,6 +968,15 @@ pAudio->u.nonStandard->data.data = "G.726-32k"; pAudio->u.nonStandard->data.numocts = sizeof("G.726-32k")-1; break; + case OO_G726AAL2: + pAudio->u.nonStandard->data.data = "G726r32"; + pAudio->u.nonStandard->data.numocts = sizeof("G726r32")-1; + /* Cisco G726 */ + pAudio->u.nonStandard->nonStandardIdentifier.u.h221NonStandard->t35CountryCode = 181; + pAudio->u.nonStandard->nonStandardIdentifier.u.h221NonStandard->t35Extension = 0; + pAudio->u.nonStandard->nonStandardIdentifier.u.h221NonStandard->manufacturerCode = 18; + + break; case OO_AMRNB: pAudio->u.nonStandard->data.data = "AMRNB"; pAudio->u.nonStandard->data.numocts = sizeof("AMRNB")-1; @@ -1090,6 +1102,13 @@ else return FALSE; break; + case sizeof("G726r32")-1: + if (!strncmp(audioCap->u.nonStandard->data.data, "G726r32", + audioCap->u.nonStandard->data.numocts)) + cap = OO_G726AAL2; + else + return FALSE; + break; case sizeof("AMRNB")-1: if (!strncmp(audioCap->u.nonStandard->data.data, "AMRNB", audioCap->u.nonStandard->data.numocts)) @@ -1765,6 +1784,13 @@ else return NULL; break; + case sizeof("G726r32")-1: + if (!strncmp(audioCap->u.nonStandard->data.data, "G726r32", + audioCap->u.nonStandard->data.numocts)) + cap = OO_G726AAL2; + else + return NULL; + break; case sizeof("AMRNB")-1: if (!strncmp(audioCap->u.nonStandard->data.data, "AMRNB", audioCap->u.nonStandard->data.numocts)) @@ -2323,6 +2349,15 @@ if (audioCap->u.nonStandard && audioCap->u.nonStandard->nonStandardIdentifier.t == T_H245NonStandardIdentifier_h221NonStandard && + audioCap->u.nonStandard->data.numocts == sizeof("G726r32")-1 && + !strncmp(audioCap->u.nonStandard->data.data, "G726r32", + audioCap->u.nonStandard->data.numocts)) + return ooCapabilityAddSimpleCapability(call, OO_G726AAL2, 20, + 240, FALSE, dir, NULL, NULL, NULL, NULL, TRUE); + + if (audioCap->u.nonStandard && + audioCap->u.nonStandard->nonStandardIdentifier.t == + T_H245NonStandardIdentifier_h221NonStandard && audioCap->u.nonStandard->data.numocts == sizeof("AMRNB")-1 && !strncmp(audioCap->u.nonStandard->data.data, "AMRNB", audioCap->u.nonStandard->data.numocts)) @@ -2631,7 +2666,7 @@ "OO_G729", "OO_G729ANNEXA", "OO_AMRNB", - "OO_UNUSED", + "OO_G726AAL2", "OO_G729WANNEXB", "OO_G729ANNEXAWANNEXB", "OO_G7231ANNEXC",