[asterisk-dev] SIP codec selection. Can I select a codec and reinvite?

asterisk Asterisk at isgcom.com
Mon Nov 19 14:12:21 CST 2007


I am having an issue with codec selections. I am using only 2 codecs
ULAW & G729.  On some peers I want the proffered codec to be G729 other
ULAW.    I have a SIP trunk form a carrier that supports both G729 and
ULAW. I would like asterisk to use the [proffered codec and not
transcode.

My peers are setup like this. 

[siptrunk] 
Deny=all
Allow=ulaw
Allow=g729

[UPeer]
Deny=all
Allow=ulaw

[Gpeer]
Deny=all
Allow=G729


On outbound calls every thing works fine. The phone picks the codec and
asterisk passes it on to the sip trunk.   On inbound calls  (from the
SIP trunk) the Sip trunks proffered codec is selected.  

Is there any way (in asterisk) that I can select the codec per call?   

i.e.  Call comes in. before answering the call look up the destination
peers codec, (function SIPPEER?) and set the codec to use and then
answer?  

Or is there any way to set the codec and do an manual re-invite?

Thanks
Doug Gillespie



More information about the asterisk-dev mailing list