martin f krafft
2008-Mar-28 13:27 UTC
[asterisk-users] Two phones fail to agree on codec, asterisk at fault?
Hi list, I am faced by a situation where I am trying to make a softphone and a Siemens C450IP talk to each other. Both are hooked up directly to the same asterisk, in the same IP net. - a softphone runs on 192.168.14.3 - the C450IP is at 192.168.14.30 - asterisk runs on the machine known as 192.168.14.1 I am running Asterisk 1.4.11, backported to Debian Etch by Xorcom. If I set canreinvite=yes for both, everything works. However, I have reason to use canreinvite=no for both. But if I do, then the two phones fail to agree on a codec. So calls are going via an asterisk bridge and the symptoms of my problem are: 1 if C450IP calls softphone, they can talk fine 2 if softphone calls C450IP, voice only goes from C450IP to softphone, not the other way around. I traced this down to the session description protocol, where there is funky stuff going on with the supported codecs each peer announces. Remember, asterisk is between them, and I set disallow=all,allow=ulaw,allow=alaw in [global]. So in situation 1, when the C450IP calls the softphone, these codecs are announced. 0 is ulaw, 8 is alaw, 111 is g726-32, 3 is gsm. C450IP to asterisk: 8, 0 asterisk to softph: 8, 3, 0 softph to asterisk: 8 asterisk to C450IP: 8, 0 They both agree on 8 (alaw) and stuff is working, but it's already curious how asterisk adds the 3 (GSM) in the second line and the 0 (ulaw) in the last. In situation 2, no voice travels from the softphone to the C450IP, and this is the dialog: softph to asterisk: 8, 0, 3 asterisk to C450IP: 0, 8, 111 C450IP to asterisk: 0 asterisk to softph: 3, 0, 8 Again, notice how asterisk basically ignores what it was asked to relay. In the end, the softphone settles for 3 (GSM) but the C450IP chooses 0 (ulaw). Since the softphone has no problem decoding ulaw, it can hear whatever the C450IP transmits, but it returns GSM packets, which the C450IP can't decode, and therefore nothing comes out of that phone. What's going on here? From all I can tell, the clients do the right thing, each selecting the first codec offered by asterisk (which they support), but asterisk is going a bit lala here, isn't it? First of all, why does it even bother with 3 and 111, given how I disallowed them? And second, why does it *dare* to announce more than what is available to the peer to which it relays? -- martin | http://madduck.net/ | http://two.sentenc.es/ "there are more things in heaven and earth, horatio, than are dreamt of in your philosophy." -- hamlet spamtraps: madduck.bogus at madduck.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature (see http://martin-krafft.net/gpg/) Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20080328/cc205604/attachment.pgp
Brent Davidson
2008-Mar-28 20:49 UTC
[asterisk-users] Two phones fail to agree on codec, asterisk at fault?
With canreinvite=no you are forcing asterisk to remain in the call path. As long as Asterisk is in the call path, it is supposed to be transcoding the calls, so it doesn't care what the compatible codecs are between then endpoints. Each leg of the call is phone<->asterisk so asterisk negotiates a compatible codec set with each phone. If there is a codec difference between two legs of a call, it should be transcoding between them, unless you have that disabled somehow. (A quick google and I don't see how to disable transcoding apart from limiting codecs.) Now the other issue here is why Asterisk is offering GSM to the softphone and g726 to the C450IP. Try setting the allow and disallow settings for each channel rather than in Global. I tend to set things like codecs on a per-device basis rather than in global. Global settings have a bad habit of being overridden. Good luck, Brent martin f krafft wrote:> Hi list, > > I am faced by a situation where I am trying to make a softphone and > a Siemens C450IP talk to each other. Both are hooked up directly to > the same asterisk, in the same IP net. > > - a softphone runs on 192.168.14.3 > - the C450IP is at 192.168.14.30 > - asterisk runs on the machine known as 192.168.14.1 > > I am running Asterisk 1.4.11, backported to Debian Etch by Xorcom. > > If I set canreinvite=yes for both, everything works. However, I have > reason to use canreinvite=no for both. But if I do, then the two > phones fail to agree on a codec. > > So calls are going via an asterisk bridge and the symptoms of my > problem are: > > 1 if C450IP calls softphone, they can talk fine > 2 if softphone calls C450IP, voice only goes from C450IP to > softphone, not the other way around. > > I traced this down to the session description protocol, where there > is funky stuff going on with the supported codecs each peer > announces. Remember, asterisk is between them, and I set > disallow=all,allow=ulaw,allow=alaw in [global]. > > So in situation 1, when the C450IP calls the softphone, these codecs > are announced. 0 is ulaw, 8 is alaw, 111 is g726-32, 3 is gsm. > > C450IP to asterisk: 8, 0 > asterisk to softph: 8, 3, 0 > softph to asterisk: 8 > asterisk to C450IP: 8, 0 > > They both agree on 8 (alaw) and stuff is working, but it's already > curious how asterisk adds the 3 (GSM) in the second line and the > 0 (ulaw) in the last. > > In situation 2, no voice travels from the softphone to the C450IP, > and this is the dialog: > > softph to asterisk: 8, 0, 3 > asterisk to C450IP: 0, 8, 111 > C450IP to asterisk: 0 > asterisk to softph: 3, 0, 8 > > Again, notice how asterisk basically ignores what it was asked to > relay. In the end, the softphone settles for 3 (GSM) but the C450IP > chooses 0 (ulaw). Since the softphone has no problem decoding ulaw, > it can hear whatever the C450IP transmits, but it returns GSM > packets, which the C450IP can't decode, and therefore nothing comes > out of that phone. > > What's going on here? From all I can tell, the clients do the right > thing, each selecting the first codec offered by asterisk (which > they support), but asterisk is going a bit lala here, isn't it? > > First of all, why does it even bother with 3 and 111, given how > I disallowed them? And second, why does it *dare* to announce more > than what is available to the peer to which it relays? > > > ------------------------------------------------------------------------ > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080328/0748ccff/attachment-0001.htm
Mojo with Horan & Company, LLC
2008-Mar-28 23:29 UTC
[asterisk-users] Two phones fail to agree on codec, asterisk at fault?
martin f krafft wrote:> What's going on here? From all I can tell, the clients do the right > thing, each selecting the first codec offered by asterisk (which > they support), but asterisk is going a bit lala here, isn't itI think Brent's on to it there -- as he suggested, get your allow= and disallow= statements in each [peer], rather than in [global] ;) Moj
Karsten Wemheuer
2008-Mar-29 12:14 UTC
[asterisk-users] Two phones fail to agree on codec, asterisk at fault?
Hi Martin, Am Freitag, den 28.03.2008, 14:27 +0100 schrieb martin f krafft:> [...] > So calls are going via an asterisk bridge and the symptoms of my > problem are: > > 1 if C450IP calls softphone, they can talk fine > 2 if softphone calls C450IP, voice only goes from C450IP to > softphone, not the other way around. > > I traced this down to the session description protocol, where there > is funky stuff going on with the supported codecs each peer > announces. Remember, asterisk is between them, and I set > disallow=all,allow=ulaw,allow=alaw in [global].If this isn't a typo, use [general] instead of [global]. HTH, Karsten