[asterisk-users] Advanced Dial Plan
Frederico Madeira
fmadeira at gmail.com
Thu Oct 25 08:46:33 CDT 2007
Hi Guys,
I Have this peers on my sip.conf
[provider-302333-3000]
type=friend
context=provider
secret=xpto
username=3023333000
host=sip.provider.com
fromuser=3023333000
insecure=very
canreinvite=no
[provider-302222-3001]
type=friend
context=provider
secret=xpto
username=3022223001
host=sip.provider.com
fromuser=3022223001
insecure=very
canreinvite=no
I Have in my sip.conf two extension 3000 and 3001.
I have this rule in my extensions.conf
exten=> _X.,1,Dial(SIP/${EXTEN}@provider-302333-${CALLERID(num)},60,Tt)
exten=> _X.,2,Hangup
exten=> _X.,1,Dial(SIP/${EXTEN}@provider-302222-${CALLERID(num)},60,Tt)
exten=> _X.,2,Hangup
And every calls made by my both extension was using the first rule, so
calls from extension 3000 match with peer and work, but calls from
3001 didn't match with peer and I got error.
How can I use a conditional sentence like:
if {${CALLERID(num)}=3000)
{
exten=> _X.,1,Dial(SIP/${EXTEN}@provider-302333-${CALLERID(num)},60,Tt)
exten=> _X.,2,Hangup
}
else
if {${CALLERID(num)}=3001)
{
exten=> _X.,1,Dial(SIP/${EXTEN}@provider-302222-${CALLERID(num)},60,Tt)
exten=> _X.,2,Hangup
}
Thanks.
--
Frederico Madeira
fmadeira at gmail.com
www.madeira.eng.br
More information about the asterisk-users
mailing list