[Asterisk-Dev] codec negotiation issue

Michael Giagnocavo mgg-digium at atrevido.net
Thu Mar 24 09:13:12 MST 2005


>I read http://bugs.digium.com/bug_view_page.php?bug_id=0003346
>This should be a good solution for my need :
>
>exten => _**393.,1,SetPreferredCodec(ulaw)
>exten => _**393.,2,Dial(IAX2/fwdnum:fwdpwd at iax.fwdnet.net/${EXTEN:5})
>
>So any incoming call to FWD would be asked to use ulaw first... if it 
>can, we'll have native bridging :) great ! Will this be patch be soon a 
>part of the main CVS ?
>
>I wondering also if it would not be possible to directly ask peers what 
>codec(s) they can use, so if they can use the same codec, just ask them 
>to use it and native bridge them ?

Well, 2 things. First, preferred codec doesn't mean the codec you'll get.
The other side might override your prefs. You have to set codec override to
FORCE that codec by only allowing that single codec. That's how you can
disable transcoding.

But, this doesn't help you at all. Because when the call is initiated, the
dialplan isn't involved.

Goto chan_iax2, socket_read() (starts around line 5670). In the monster
switch, goto case IAX_COMMAND_NEW: (around line 6110). Go down about another
35 lines to the /* Select an appropriate format */ comment. 

THIS is where code must be patched in to enable codec passthough. At this
point, you need to add some logic to determine which codec to use. My codec
passthrough patch used a simple .conf file. That's probably the easiest for
what you want to do. 

-Michael







More information about the asterisk-dev mailing list