[Asterisk-Users] allowing/disallowing codecs in dialplan?

Andreas Greulich andreas.greulich at spl.ch
Mon Sep 13 12:35:54 MST 2004


Hi all,

Is there a possibility to set the codecs Asterisk will choose in the dialplan
("exten=>" statements or their contexts) instead of sip.conf?

My problem is that I connect my SIP phone with several providers (Nikotel,
Sipgate, Stanaphone) for icoming and outgoing calls. Not all of these providers
offer the same set of codecs. I'd like Asterisk to use the same codec for the
provider side as well as of the device side, to prevent codec translation.
Unfortunately, Asterisk seems to negotiate the codec for the device and for the
peer independently, so it often happens it sets them differently.

I could of course just allow ulaw, bit I'd like to use ilbc where possible (less
dropouts). So, I'd like to configure Asterisk in a way that, depending on what
extension is chosen, it negotiates another codec with the phone. Of course I
considered setting the allow statements in the sections of sip.conf. But it
seems these settings are only considered on incoming calls, but not on outgoing
calls (initiated by a Dial application with the sip.conf section as its argument).

So, when I have something like 

[general]
disallow=all
allow=alaw
allow=ulaw
allow=ilbc

[SipgateAccount]
type=friend
...
disallow=all
allow=ilbc

then these settings are only considered when I get an incoming call, but not
when I make an outgoing call using
"exten=>...,Dial/SIP/${EXTEN}@SipgateAccount,60,)"

Thanks in advance, Andy

-- 

Andreas Greulich
E-Mail: andreas.greulich at spl.ch
Skype: klaymen-neverhood

Sermo datur cunctis, animi sapientia paucis.




More information about the asterisk-users mailing list