[asterisk-users] SIP codec negotiation / manipulation

Kevin Sandy kevin.sandy at snohio.net
Mon Mar 22 08:54:35 CDT 2010



On 3/21/2010 4:05 AM, Olle E. Johansson wrote:
> 

> 17 mar 2010 kl. 16.37 skrev Kevin Sandy:
> 
>> We're having an odd issue with codec negotiation from one of our
>> SIP providers. Here's the basic situation.
>> 
>> We receive an invite from them advertising support for G711, G729,
>> and G723. In our response, we send back that we support G711 and
>> G729. In about half the cases, this results in no problems, with
>> audio being encoded with G711. The other half of the time, they
>> send us a second invite requesting G729. However, they proceed to
>> send us a G711 encoded audio stream...
>> 
>> They have somewhat acknowledged the problem, but their advice is
>> for us to only accept a single codec in our 200 OK. We don't want
>> to disable either; we have customers using G729, so we'd like to
>> avoid transcoding when possible, but we also do some T38 faxing,
>> which I believe requires G711 to start off.
>> 
>> My first thought was to selectively force the codec on inbound
>> calls - if it is for a voice number, use 729, otherwise 711.
>> However, I can't find any way of doing this within Asterisk. (We do
>> have an OpenSIPS server sitting between us and the provider, and I
>> could use OpenSIPS features to do this; however, right now the
>> OpenSIPS server is fairly dumb - it's only proxying traffic between
>> us and the provider and knows nothing about our specific DIDs.)
>> 
>> A couple more details in case anyone has seen a similar issue. The
>> provider is Broadvox, and this issue only seems to manifest on
>> calls coming to them via Skype. They claim to not have any direct
>> link with Skype, but it seems odd that the problem would be
>> specific to Skype callers if the call is coming to Broadvox as a
>> standard PSTN call.
>> 
>> Is there any way to do this? Am I totally missing something and
>> making a stupid mistake, or making the issue more complicated than
>> it needs to be?
>> 
> The problem here is that you have a proxy in between, so Asterisk
> can't have separate peer configurations, since all the SIP messages
> are from the same IP and thus the same peer. I have a branch that
> implements peer matching in this specific configuration, which means
> that you can have different codec configurations for different
> partners even though there's a proxy in front of Asterisk.
> 
> https://origsvn.digium.com/svn/asterisk/team/oej/pinetree-1.4
> 
> Please try this branch and give feedback. There should be some docs
> in sip.conf for the new "matchrule" setting.
> 
> /O


I'd be interested in trying this out - but the site doesn't seem to be
responding. :)

I have a few more questions, but I'm guessing that I can figure them out
on my own once I have the code.



More information about the asterisk-users mailing list