[Asterisk-Users] Way to disable codec in dialingplan

billy at kersting.com billy at kersting.com
Thu May 25 20:06:05 MST 2006


Why not have multiple records in the sip.conf for the carrier.
For example, if your carrier was level3 then you'd do something like this:

sip.conf
[level3_729]
host=x.x.x.x
type=peer
insecure=very
context=whatever
disallow=all
allow=g729

[level3_ulaw]
host=x.x.x.x
type=peer
insecure=very
context=whatever
disallow=all
allow=ulaw

In you dialplan, if you wanted to send all calls starting with "407" NPA via
g729 and everything else via ulaw, you'd do the following:
exten => s,1,Ringing
exten => s,2,GoToIf($["${MACRO_EXTEN:-10:3}" = "407"]?3:5)
exten => s,3,Dial(SIP/${MACRO_EXTEN}@${level3_729})
exten => s,4,hangup
exten => s,5,Dial(SIP/${MACRO_EXTEN}@${level3_ulaw})
exten => s,6,hangup

It may take some tweaking for your needs, but I believe the theory is
sound... it should work.

bp

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Luki
Sent: Thursday, May 25, 2006 9:12 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [Asterisk-Users] Way to disable codec in dialingplan

> can we enable or force a codec on specified npa..

Depends on the channel. On SIP you can set SIP_CODEC to force a codec,
but I don't think you can disallow one in the dialplan.

See:
http://voip-info.org/tiki-pagehistory.php?page=Asterisk+variables

--Luki
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list