[asterisk-users] Advanced Dial Plan

Steve Murphy murf at digium.com
Thu Oct 25 18:00:59 CDT 2007


On Thu, 2007-10-25 at 10:36 -0500, Brett Crapser wrote:
> On Thu, 25 Oct 2007, Frederico Madeira wrote:
> > Philipp
> >
> > This didn't wotk.
> >
> > Let's suppose that my sip extension 3000 want to call to (302).123.3211
> > I need a rule in extensions.conf to match with this number, right ?
> > So, I can't use rules that you advice.
> >
> > My problem is only for outbound calls.
> >
> > 2007/10/25, Philipp Kempgen <philipp.kempgen at amooma.de>:
> >> 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
> 
> Okie dokie....
> 
> [outbound]
> exten=> _X.,1,GotoIf([${CALLERID(num)} == "3000"]?path0|1)
> exten=> _X.,2,GotoIf([${CALLERID(num)} == "3001"]?path1|1)

oops! you need to say:

exten=> _X.,1,GotoIf(["${CALLERID(num)}" == "3000"]?path0|1)
exten=> _X.,2,GotoIf(["${CALLERID(num)}" == "3001"]?path1|1)

.. or the double quotes won't match, and you'll hear monkeys for sure!


> exten=> _X.,3,Playback(tt-monkeys)
> exten=> _X.,4,Hangup
> 
> [path0]
> exten=> _X.,1,Dial(SIP/${EXTEN}@provider-302333-3000,60,Tt)
> exten=> _X.,2,Hangup
> 
> [path1]
> exten=> _X.,1,Dial(SIP/${EXTEN}@provider-302222-3001,60,Tt)
> exten=> _X.,2,Hangup
> 
> If you hear the monkeys...
> 
> Brett
> 
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
Steve Murphy
Software Developer
Digium
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3227 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20071025/f085f81d/attachment.bin 


More information about the asterisk-users mailing list