Asterisk 13.13 Codec selection : Possible Bug

Hello;
There is a problem codec selection on Asterisk 13.13 . When calls starts from Operator to Uac and when Uac only supports a codec , it doesnt have codec conversation so that one side voice can be hearable. There is example as below.

if operator side changes codec order like alaw,ulaw,g729 , there isnt any problem

I tested with same conf on Asterisk 11 , there isnt any problem. it works now on asterisk 11 very well.

it is chan_sip configuration;

[Operator]
allow=g729
allow=alaw
allow=ulaw

[uac]
allow=729
allow=alaw
allow=ulaw

Could you check it please.

Do you have disallow=all set before your allow= lines ?

There might be a typo in your config file (or it slipped in typing this post).
[uac] allows=729 instead of g729.

1 Like

You cannot setup calls to a UAC, you can only receive calls from one. The same device can switch between UAC and UAS within a single dialogue if there are re-INVITEs.

The codec negotiation looks correct. Asterisk does not feed back the codec choices from the B side to the A side, although I believe there are dialplan operations you can use to achieve this.

Asterisk is responding to the real UAC with Alaw because this is the least costly codec tor if of those acceptable to the UAC. Codecs in SDP are acceptable codecs for media in the reverse direction to the offer. Although it is common practice to limit the response to those in the offer, that isn’t even necessary.

I’ve assumed that you haven’t prematurely answered the real UAC.

Hello;
only codec priority is written , i didnt write all config. Thanks for reply

Hello;
after your reply , i re-made this situtation again. I think i explain wrong the situation. There is 2 trunk in asterisk. 1 Trunk gets calls and other trunks make out the calls. so in my view at normal there is a two channel (i am not sure there is local channels) that two channel negotiate different events. So asterisk 11.25 can be made right negotiation as below but asterisk 13.13 fails to negatiate or transmit wrong codec rtp.
I hope i can explain what is wrong.

Uac1 isnt int Proxy registrar , just simple show Uac1 registerer on Proxy and int the middle of flow there is proxy that dont touch SDP packet.

Cheers

Both are valid. Asterisk 13 is better because it is avoiding an unnecessary transcoding in the reverse direction and saving you a G.729 licence.

SIP does not require that the same codec be used in both directions.

Hello,
thanks for reply. both are valid. but there is a no voice in calls. i cant hear anything. if i reorder priority like “alaw,ulaw,g729” at both trunk in asterisk , sounds good. when i get trace or pcap from UAC with wireshark , i can hear voice but other side cannot hear anything. OMG it is so complex.
there is problem about one side , and it is hard to find why

anyway, thanks for reply. i will dig situation again.

I’m stuck with the same issue. Did any one fix this issue or had any workaround so far?

i make down to version to 11 . i dont have time to test again :X

@jcolp Hello,
What do you think about this issue , Asterisk 13.13 Codec selection : Possible Bug

is there any solution or i am doing sth wrong

It’s probably some sort of change causing the behavior in chan_sip. I haven’t touched chan_sip in quite a long time so I do not know.