<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Dec 14, 2013 at 10:31 PM, Ryan Wagoner <span dir="ltr"><<a href="mailto:rswagoner@gmail.com" target="_blank">rswagoner@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Let's say I have two devices configured and the follow call scenarios occur.<br>
<br>[100]<br>disallow=all<br>allow=g722&ulaw<br><br>Polycom phone with g722,ulaw,alaw,g729<br><br>[101]<br>disallow=all<br>
allow=ulaw<br><br>Polycom phone with g722,ulaw,alaw,g729<br><br>101 dials 100 -> ulaw to ulaw is chosen<br>100 dials 101 -> g722 to ulaw is chosen<br><br>Ideally when 100 dials 101 ulaw would be chosen since it is the common format. Looking into this deeper<br>

<br>Device 100 sends INVITE to Asterisk offering g722,ulaw,alaw,g729<br>Asterisk sends INVITE to device 101 offering ulaw<br>Device 101 sends 200 OK to Asterisk offering ulaw<br>Asterisk sends 200 OK to device 100 offering g722,ulaw<br>

<br>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?<span class=""><font color="#888888"><br>

<br></font></span></div><span class=""><font color="#888888"><div>Ryan<br></div></font></span></div>
</blockquote></div><br>I should have mentioned I'm using Asterisk 11.2-cert2. The core debug from the above shows<br><br>[2013-12-14 22:51:59] DEBUG[25200][C-0000004d]: chan_sip.c:7911 sip_new: *** Our native formats are (g722)<br>
[2013-12-14 22:51:59] DEBUG[25200][C-0000004d]: chan_sip.c:7912 sip_new: *** Joint capabilities are (ulaw|g722)<br>[2013-12-14 22:51:59] DEBUG[25200][C-0000004d]: chan_sip.c:7913 sip_new: *** Our capabilities are (ulaw|g722)<br>
[2013-12-14 22:51:59] DEBUG[25200][C-0000004d]: chan_sip.c:7914 sip_new: *** AST_CODEC_CHOOSE formats are g722<br><br>[2013-12-14 22:51:59] DEBUG[27830][C-0000004d]: chan_sip.c:7911 sip_new: *** Our native formats are (ulaw)<br>
[2013-12-14 22:51:59] DEBUG[27830][C-0000004d]: chan_sip.c:7912 sip_new: *** Joint capabilities are (nothing)<br>[2013-12-14 22:51:59] DEBUG[27830][C-0000004d]: chan_sip.c:7913 sip_new: *** Our capabilities are (ulaw)<br>
[2013-12-14 22:51:59] DEBUG[27830][C-0000004d]: chan_sip.c:7914 sip_new: *** AST_CODEC_CHOOSE formats are ulaw<br>[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)<br><br></div><div class="gmail_extra">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.<br>
</div><div class="gmail_extra"><br></div><div class="gmail_extra">Ryan<br></div></div>