[Asterisk-Dev] codec negotiation issue

Michael Giagnocavo mgg-digium at atrevido.net
Thu Mar 24 10:15:52 MST 2005


>> 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. 
>
>This has come up before, but I still don't understand why adding code at 
>this spot is better than just setting the allow/disallow options 
>properly for the user placing the call... What information are you going 
>to have to make a different codec decision here?

Because your system might have better knowledge of where the call will
terminate. In the original posters case, he has phones that support GSM or
ULAW. However, when dialing a specific extension, "he" knows that the call
will goto a ULAW termination point, and thus should negotiate ULAW the whole
way.

In my case, my provider sends me DIDs and will send in any format I prefer.
The DIDs are assigned to various customers, some GSM, some ULAW, some G729,
and some iLBC. In my database, I know which DID is assigned to which
customer. I also know about call forwarding, etc. So, I'll dispatch a SOAP
call to find the codec to use, and then negotiate that, right there in the
NEW call. 

There should probably be a programmatic hook so someone can easily plug in
their own logic without having to patch chan_iax2 themselves.

-Michael





More information about the asterisk-dev mailing list