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
Frederico Madeira wrote:> 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.exten=> 3000,1,Dial(SIP/${EXTEN}@provider-302333-${EXTEN},60,Tt) exten=> 3000,n,Hangup() exten=> 3001,1,Dial(SIP/${EXTEN}@provider-302222-${EXTEN},60,Tt) exten=> 3001,n,Hangup() That dialplan is about as easy as it can get. :) Regards, Philipp Kempgen -- amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de Let's use IT to solve problems and not to create new ones. Asterisk? -> http://www.das-asterisk-buch.de Gesch?ftsf?hrer: Stefan Wintermeyer Handelsregister: Neuwied B 14998
On Thu, 2007-10-25 at 15:26 -0500, Eric "ManxPower" Wieling wrote:> Steve Murphy wrote: > > > Although.... late model expression parser code allows ==, and treats it > > like =, > > and, & and && are interchangeable, and so also | and ||. > > > > murf > > "late model" is SVN TRUNK, 1.4, SVN BRANCH 1.4, or 1.2? >Late model == trunk. Change was too late for 1.4 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3239 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20071025/0fe33126/attachment.bin