[asterisk-users] Why doesn't Asterisk try to prevent transcoding

Ryan Wagoner rswagoner at gmail.com
Sat Dec 14 22:06:34 CST 2013


On Sat, Dec 14, 2013 at 10:31 PM, Ryan Wagoner <rswagoner at gmail.com> wrote:

> Let's say I have two devices configured and the follow call scenarios
> occur.
>
> [100]
> disallow=all
> allow=g722&ulaw
>
> Polycom phone with g722,ulaw,alaw,g729
>
> [101]
> disallow=all
> allow=ulaw
>
> Polycom phone with g722,ulaw,alaw,g729
>
> 101 dials 100 -> ulaw to ulaw is chosen
> 100 dials 101 -> g722 to ulaw is chosen
>
> Ideally when 100 dials 101 ulaw would be chosen since it is the common
> format. Looking into this deeper
>
> Device 100 sends INVITE to Asterisk offering g722,ulaw,alaw,g729
> Asterisk sends INVITE to device 101 offering ulaw
> Device 101 sends 200 OK to Asterisk offering ulaw
> Asterisk sends 200 OK to device 100 offering g722,ulaw
>
> I can prevent transcoding by adding SIP_CODEC_INBOUND=ulaw to the dialplan
> for extension 101. This causes Asterisk to send 200 OK to device 100
> offering ulaw. Am I missing why Asterisk wouldn't just offer the highest
> priority codec they have in common to prevent transcoding?
>
> Ryan
>

I should have mentioned I'm using Asterisk 11.2-cert2. The core debug from
the above shows

[2013-12-14 22:51:59] DEBUG[25200][C-0000004d]: chan_sip.c:7911 sip_new:
*** Our native formats are (g722)
[2013-12-14 22:51:59] DEBUG[25200][C-0000004d]: chan_sip.c:7912 sip_new:
*** Joint capabilities are (ulaw|g722)
[2013-12-14 22:51:59] DEBUG[25200][C-0000004d]: chan_sip.c:7913 sip_new:
*** Our capabilities are (ulaw|g722)
[2013-12-14 22:51:59] DEBUG[25200][C-0000004d]: chan_sip.c:7914 sip_new:
*** AST_CODEC_CHOOSE formats are g722

[2013-12-14 22:51:59] DEBUG[27830][C-0000004d]: chan_sip.c:7911 sip_new:
*** Our native formats are (ulaw)
[2013-12-14 22:51:59] DEBUG[27830][C-0000004d]: chan_sip.c:7912 sip_new:
*** Joint capabilities are (nothing)
[2013-12-14 22:51:59] DEBUG[27830][C-0000004d]: chan_sip.c:7913 sip_new:
*** Our capabilities are (ulaw)
[2013-12-14 22:51:59] DEBUG[27830][C-0000004d]: chan_sip.c:7914 sip_new:
*** AST_CODEC_CHOOSE formats are ulaw
[2013-12-14 22:51:59] DEBUG[27830][C-0000004d]: chan_sip.c:7916 sip_new:
*** Our preferred formats from the incoming channel are (g722)

I'm looking at the code now. I am hoping to write a patch, if I can wrap my
head around the code, to determine join capabilities between the joint
capabilities of each channel. If this exists then set both channels this
codec.

Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20131214/a399302c/attachment.html>


More information about the asterisk-users mailing list