[asterisk-users] Simplifying dial-plan

Jeroen Eeuwes jeroeneeuwes at gmail.com
Wed Dec 22 07:01:45 UTC 2010


Hi Stephen,

> _NXXNXXXXXX
> _NXXXXXX
> _011.
> _911

Of course it can, but it depends on what you want to do when those
numbers are called...

I didn't know about the setvar in the sip.conf and actually I think it
is a much "cleaner" solution. Since you are already using it I would
suggest to not only use it for CallerID but also for the
@vitel-outbound like this:

exten => _1NXXNXXXXXX,1,Set(CALLERID(all)=${EXTERNAL_CALLERID})
exten => _1NXXNXXXXXX,n,Dial(SIP/${EXTEN}@${Outbound})
exten => _1NXXNXXXXXX,n,Goto(h,1)

Of course you'll need to set setvar=Outbound=vitel-outbound or
setvar=Outbound=vitel-outbound2 in sip.conf.

What do you want to do with the other numbers? If you want to do the
same as with _1NXXNXXXXXX you can just add things like this in your
extensions.conf:

exten => _NXXNXXXXXX,1,Goto(_1NXXNXXXXXX,1)
exten => 911,1,Goto(_1NXXNXXXXXX,1)

Or you can do different things if you want that like this:

exten => _NXXXXXX,1,Set(CALLERID(all)="No one cares" <0>)
exten => _NXXXXXX,n,Dial(SIP/${EXTEN}@abcdefgh)
exten => _NXXXXXX,n,Goto(h,1)

Best regards,
Jeroen Eeuwes



More information about the asterisk-users mailing list