g729 codec problem

I just bought 1 Digium G.729 codec license for testing purpose. The system is running Asterisk 1.4.1. The codec seems to be installed properly as I can place a G.729 call into the system and play some announcements. However, I am experiencing a number of weird problems when trying different combination of calls.

  1. SIP (G.729) - Asterisk - SIP (G.729)
    This works perfect. No g729 codec license is used.

  2. SIP (G.729) - Asterisk - PSTN
    The SIP device can connect to Asterisk. But when the system try to place an outbound call via PSTN, the call drops after answer is detected (I can actually hear the other side speaking); 1 g729 codec license is used. The system log shows the following “codec translation path” error:

0/0 encoders/decoders of 1 licensed channels are currently in use
– Executing [456@from-internal-ALL:1] Dial(“SIP/102-00a42530”, “Zap/g1/85218503|40|Tt”) in new stack
– Requested transfer capability: 0x00 - SPEECH
– Called g1/85218503
– Zap/67-1 is proceeding passing it to SIP/102-00a42530
– Zap/67-1 is ringing
[Jul 12 14:25:29] WARNING[29678]: channel.c:2816 set_format: Unable to find a codec translation path from g729 to slin
[Jul 12 14:25:29] WARNING[29678]: indications.c:121 playtones_alloc: Unable to set ‘SIP/102-00a42530’ to signed linear format (write)
localhost*CLI> show g729
1/1 encoders/decoders of 1 licensed channels are currently in use
– Zap/67-1 answered SIP/102-00a42530
[Jul 12 14:25:31] WARNING[29678]: channel.c:3147 ast_channel_make_compatible: No path to translate from SIP/102-00a42530(256) to Zap/67-1(72)
[Jul 12 14:25:31] WARNING[29678]: app_dial.c:1619 dial_exec_full: Had to drop call because I couldn’t make SIP/102-00a42530 compatible with Zap/67-1
– Hungup ‘Zap/67-1’

  1. PSTN - Asterisk - SIP (G.729)
    The call can connect ok. But the destination connection seems to be using alaw instead of G.729 somehow. Also, there is one instance of g729 codec being used as well. This is the logs:

localhostCLI> show g729
0/0 encoders/decoders of 1 licensed channels are currently in use
– Called 61.152.148.94/8620114
localhost
CLI> show g729
1/0 encoders/decoders of 1 licensed channels are currently in use
– Call on SIP/61.152.148.94-00a42530 left from hold
– SIP/61.152.148.94-00a42530 is making progress passing it to Zap/30-1
localhostCLI> show g729
1/1 encoders/decoders of 1 licensed channels are currently in use
localhost
CLI> show g729
1/1 encoders/decoders of 1 licensed channels are currently in use
localhostCLI> sip show channels
Peer User/ANR Call ID Seq (Tx/Rx) Form Hold Last Message
61.152.148.94 8620114 5cca06a133b 00102/00000 alaw No Init: INVITE
1 active SIP channel
– Zap/63-1 is ringing
– Call on SIP/61.152.148.94-00a42530 left from hold
– SIP/61.152.148.94-00a42530 answered Zap/30-1
– Channel 0/30, span 1 got hangup request
localhost
CLI> show g729
0/0 encoders/decoders of 1 licensed channels are currently in use

Can anybody shred some light on what the problem might be?
Many Thx.
Joseph

IMHO:

  1. you should check if the phones are able to “reinvite”, parameter canreinvite=yes in sip.conf, if so the rtp stream is flowing directly beetwen the phones and * doesn’t need to use any g729 license;
  2. the call has two legs, perhaps you need two g729 licenses ?
  3. in this case, as there aren’t enough licenses, as in 2), I think a different codec is negotiated.

Bye.

  1. This issue was fixed in Asterisk 1.4.5 and 1.2.19. Once upgraded, it will be able to transcode.

  2. Make sure you have disallowed all codecs and only allowed g729 and ulaw for all your sip friends.

  1. Thank you very much. In fact, I have applied the patch from r69010 back to my Asterisk 1.4.1 and it is working fine now.

  2. Actually, I just found the problem. It is because Asterisk always use the calling channel’s codec as the most preferred codec. In this case, the calling channel is a E1 (i.e. alaw), and therefore, Asterisk always make alaw the most preferred codec during negotiation. If I disallow alaw and ulaw totally, then it will force Asterisk to use g729 as the preferred codec.

What I still don’t understand is why the g729 codec usage is 1 even when alaw (instead of g729) is used!?

[quote=“jshi”]2. Thank you very much. In fact, I have applied the patch from r69010 back to my Asterisk 1.4.1 and it is working fine now.

What I still don’t understand is why the g729 codec usage is 1 even when alaw (instead of g729) is used!?[/quote]

  1. You’re welcome!

I’m not sure about why it is using a license even when using alaw. Are you sure both legs of the call are something other than g.729? I would first suggest trying Asterisk 1.4.7.1 to see if there was a fix I’m not aware of. After this I suggest emailing/calling Digium support and provide the output of ‘sip show channels’ and ‘show g729’.

You could use
sip show channels
I think you will find that one of your channels is using g729. Remember that if someone calls on a trunk using G729 to your Asterisk that will be one encoder, if they leave an email that will bump it up to 2 encoders.

Hello,

Could you show your Asterisk configuration (SIP, dialing plan) for such a set-up, as I’m trying to do the same thing but it doesn’t work for me.

Thanks!