[asterisk-dev] [channel] get the other peer codec

Joshua Colp jcolp at digium.com
Mon Nov 21 09:04:09 CST 2016


On Mon, Nov 21, 2016, at 11:01 AM, Aurele Traynard wrote:
> Hi everyone,
> 
> The main goal of the channel is to make or receive call from another
> channel (mainly SIP)
> I writing a custom channel I have now something working with codec "alaw"
> When I add multiple codecs Asterisk's core "negociate" the good codec and
> give it in the "request" function then I can know wich codec I have to
> use.
> (maybe it is not asterisk's core wich do this?)
> When the call comes from my channel, I can'tknwo which codec will be used
> by the other channel...
> 
> I tried to read chan_sip and chan_iax2 as I did to write my custom
> channel,
> but I could'n see what to do...
> 
> thanks for any help and feel free to ask anything about my problem if I
> was
> not clear enough.

There is currently no mechanism to know what the other side when
answered has negotiated. It's been talked about previously that it would
be good to have such a thing, but it does not exist currently.

The only thing you can do is set your nativeformats to the negotiated
codecs and let Asterisk do the rest.

-- 
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list