G.729 Codec In Pass-thru Mode

Home » Asterisk Users » G.729 Codec In Pass-thru Mode
Asterisk Users 13 Comments

Hello, Trying to use g729 in pass-thru mode. Call flow:
SIP IP Phone (G.729)–>Asterisk(1.6.2.9)—>SIP Trunk to ITSP(G.729)
When using G.729, call is not getting connected. Below is the extract from CLI.
== Using SIP RTP CoS mark 5
— Executing [12127773456@default:1] agi(“SIP/100-00000000”, “call.php”) in new stack
— Launched AGI Script /var/lib/asterisk/agi-bin/call.php
— AGI Script Executing Application: (Dial) Options: (SIP/xxx.xxx.xxx.xxx/12127773456)
— Couldn’t call xxx.xxx.xxx.xxx/12127773456
== Everyone is busy/congested at this time (0:0/0/0)
AGI Script call.php completed, returning 0
— Auto fallthrough, channel ‘SIP/100-00000000’ status is ‘CHANUNAVAIL’

If I use, ulaw, call works fine.

Thanks, Kamlesh

13 thoughts on - G.729 Codec In Pass-thru Mode

  • hello,

    201.xxx.xxx.xxx = SIP Softphone which originates the call xxx.xxx.xxx.xxx = Asterisk server yyy.yyy.yyy.yyy = ITSP

    < --- SIP read from UDP:201.xxx.xxx.xxx:5060 --->
    INVITE sip:12127773456@xxx.xxx.xxx.xxx SIP/2.0
    To:
    From: 100;tag=c4446262
    Via: SIP/2.0/UDP 201.xxx.xxx.xxx:5060;branch=z9hG4bK-d87543-422974952-1–d87543-;rport Call-ID: 052fcf17df558f7b CSeq: 1 INVITE
    Contact:

    Max-Forwards: 70
    Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
    Content-Type: application/sdp User-Agent: eyeBeam release 3007n stamp 17816
    Content-Length: 233
    v=0
    o=- 872302269 872302706 IN IP4 201.xxx.xxx.xxx s=eyeBeam c=IN IP4 201.xxx.xxx.xxx t=0 0
    m=audio 8612 RTP/AVP 18 101
    a=alt:1 1 : 88385B47 00000038 201.xxx.xxx.xxx 8612
    a=fmtp:101 0-15
    a=rtpmap:101 telephone-event/8000
    a=sendrecv
    < ------------->
    [May 28 11:51:34] — (12 headers 10 lines) –

  • Kamlesh,

    Please provide SIP traces of both call legs for a failed call.

    Your last message only included a SIP trace of the call leg from the SIP
    softphone to the Asterisk server. There was no SIP trace for the call leg from the Asterisk server to the ITSP and, as shown below, that is probably where the answer to your problem can be found.

    First, the call leg from the SIP softphone to the Asterisk server successfully negotiated G.729 as the codec:

    However, the “call.php” AGI script then failed to create the call leg from the Asterisk server to the ITSP:

    Regards,

    Matthew Roth InterMedia Marketing Solutions Software Engineer and Systems Developer

  • Hello Matthew,

    Call even doesn’t go to the ITSP. I tried without AGI script and the results were same.

    Regards, Kamlesh

  • Kamlesh Kumar wrote:

    Kamlesh,

    Your first message stated that the call is successful if the codec is u-law, so there must be communication between the Asterisk server and the ITSP. The key to understanding why the G.729 call fails is in this SIP signaling.

    How are you capturing the SIP trace? Are you enabling SIP debugging for the specific SIP softphone? If so, please use “sip set debug on” to enable it for all SIP packets. Then wait until there are no other calls on the Asterisk server, try another G.729 call, and post the CLI output.

    Regards,

    Matthew Roth InterMedia Marketing Solutions Software Engineer and Systems Developer

  • Matthew,

    Yes that’s correct, when I use u-law call works fine.

    In case of g729, I enabled sip debug with ‘sip set debug on’ and captured all the sip traces and got whatever I posted in last email. There was no other call on the system when I captured sip trace. Please suggest further proceedings.

    Regards, Kamlesh

  • Kamlesh Kumar wrote:

    Kamlesh,

    Please provide a SIP trace (sip set debug on) of a successful u-law call. I’m especially interested in the dialog between the Asterisk server and the ITSP in this scenario.

    Also include the relevant sections of sip.conf and the dialplan.

    Regards,

    Matthew Roth InterMedia Marketing Solutions Software Engineer and Systems Developer

  • Matthew,

    SIP.conf
    [100]
    username=100
    secret=password type=friend host=dynamic nat=yes canreinvite=no insecure=port disallow=all allow=ulaw allow=alaw allow=g729
    context=asterisk qualify=no

    dialplan
    [asterisk]
    exten => _X.,1,AGI(call.php)
    exten => h,1,AGI(hangup.php)

    SIP Trace:
    201.xxx.xxx.xxx = SIP Softphone which originates the call xxx.xxx.xxx.xxx = Asterisk server yyy.yyy.yyy.yyy = ITSP

    < --- SIP read from UDP:201.xxx.xxx.xxx:5060 --->
    INVITE sip:12127773456@xxx.xxx.xxx.xxx SIP/2.0
    To:
    From: 100;tag=7c0c4b22
    Via: SIP/2.0/UDP 201.xxx.xxx.xxx:5060;branch=z9hG4bK-d87543-181300058-1–d87543-;rport Call-ID: 6601fe453f41d566
    CSeq: 1 INVITE
    Contact:

    Max-Forwards: 70
    Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
    Content-Type: application/sdp User-Agent: eyeBeam release 3007n stamp 17816
    Content-Length: 228
    v=0
    o=- 7847157 7847631 IN IP4 201.xxx.xxx.xxx s=eyeBeam c=IN IP4 201.xxx.xxx.xxx t=0 0
    m=audio 8614 RTP/AVP 0 101
    a=alt:1 1 : 05A48429 0000007F 201.xxx.xxx.xxx 8614
    a=fmtp:101 0-15
    a=rtpmap:101 telephone-event/8000
    a=sendrecv
    < ------------->
    [Jun 3 13:11:27] — (12 headers 10 lines) –

  • Kamlesh Kumar wrote:

    Is there also an “allow=g729” line in sip.conf for the ITSP’s SIP peer?

    This response from the ITSP says that only u-law may be used for the call. Please contact the ITSP and confirm that they actually support the G.729 codec.

    Regards,

    Matthew Roth InterMedia Marketing Solutions Software Engineer and Systems Developer

  • 1. Your softphone is not sending g729

    [Jun 3 13:11:27] Capabilities: us – 0x10c (ulaw|alaw|g729), *peer –
    audio=0x4 (ulaw)/video=0x0 (nothing)/text=0x0 (nothing)*, combined – 0x4
    (ulaw)

    I think free version of eyebeam doesn’t come with g729, try Microsip or some other with g729 codec.

    If it is full version, check in the advanced sip settings and allow g729

    2. canreinvite should be set to yes for using pass-thru mode

    check this interesting article Just FYI: Can we bypass Asterisk for RTP
    session?< http://techyatwork.blogspot.ae/2010/10/can-asterisk-bypass-rtp-and-work-like.html>

    Regards,

  • Mark Henry wrote:

    This was a SIP trace of a successful u-law call. In an earlier post Kamlesh provided a trace of a failed G.729 call which did not include the dialog between the Asterisk server and the ITSP. I asked for this trace so that I could see the codecs offered by the ITSP.

    I believe that by pass-thru mode [1] Kamlesh means he wants to avoid transcoding from G.729 to another codec since that requires a license per channel. Pass-
    thru mode can be achieved with “canreinvite=no” as shown by the following line from the successful u-law SIP trace and Mark Michelson’s asterisk-dev post:

    From [asterisk-dev] Native Bridging: terminology [2]:

    …within SIP, native bridging has two subcategories. One, typically referred
    to as “SIP native bridging” is used when reINVITEs are enabled. The endpoints
    send their media directly to one another. The other subcategory is called
    “Packet 2 Packet” or “P2P” bridging. If reINVITEs are not enabled, but there
    are also no features that require the Asterisk core to be in the voice path,
    then the bridging will be done at the RTP layer of Asterisk.

    [1] http://www.voip-info.org/wiki/view/Asterisk+G.729+pass-thru
    [2] http://lists.digium.com/pipermail/asterisk-dev/2010-March/043053.html

    Regards,

    Matthew Roth InterMedia Marketing Solutions Software Engineer and Systems Developer

  • Matthew,

    allow=all is defined in sip.conf for the ITSP’s SIP peer. Additionally, ITSP supports g729 codec as we are able to send the traffic from other soft switch. In case g729 on asterisk box, as I mentioned earlier, call even doesn’t go out of the asterisk box. Below extracts from log also indicate the same thing.

    [Jun 5 12:46:49] — AGI Script Executing Application: (Dial) Options: (SIP/yyy.yyy.yyy.yyy/12127773456)
    [Jun 5 12:46:49] == Using SIP RTP CoS mark 5
    [Jun 5 12:46:49] — Couldn’t call yyy.yyy.yyy.yyy/12127773456
    [Jun 5 12:46:49] == Everyone is busy/congested at this time (0:0/0/0)

    Regards, Kamlesh

  • Kamlesh Kumar wrote:

    There must be some difference between your Asterisk servers. Please set them up for calling the ITSP with G.729 and provide the following CLI output from both of them. Be sure to preserve any differences when obscuring IP addresses and label the output clearly as “G.729 working” and “G.729 fails”.

    CLI> core show version
    CLI> sip show settings
    CLI> sip show peer 100
    CLI> sip show peer
    CLI> g729 show licenses

    Regards,

    Matthew Roth InterMedia Marketing Solutions Software Engineer and Systems Developer