[asterisk-users] extending fallback numbers

Warren Selby wcselby at selbytech.com
Mon Apr 2 19:35:16 CDT 2012


On Mon, Apr 2, 2012 at 7:05 PM, Paolo Supino <paolo.supino at gmail.com> wrote:

> Hi
>
> A couple of weeks ago I asekd how to setup a fallback numer and one of
> the reply I received was to se GotoIF and ${DIALSTATUS}.
> I succeeded in making it work for a single fallback number (i.e. the
> operator), but I want to extend it in the following manner:
>
> 2000-2099 -> fallback to 2000
> 2100-2199 -> fallback to 2100
> 2200-2299 -> fallback to 2200
> 2300-2399 -> fallback to 2300
>
> and so on...
>
>
>  How do I implement such a configuration in a dialplan?
>
>

The simplest way is to just use pattern matching and multiple Dial
statements in consecutive order, like so:

exten => _20XX,1,Dial(SIP/${EXTEN},30)
exten => _20XX,n,Dial(SIP/2000,30)

exten => _21XX,1,Dial(SIP/${EXTEN},30)
exten => _21XX,n,Dial(SIP/2100,30)

exten => _22XX,1,Dial(SIP/${EXTEN},30)
exten => _22XX,n,Dial(SIP/2200,30)

exten => _23XX,1,Dial(SIP/${EXTEN},30)
exten => _23XX,n,Dial(SIP/2300,30)

This doesn't take things like DIALSTATUS into account, however it
accomplishes the same goal of having a fallback number, if that's what you
want.  If you want to add a check for DIALSTATUS, just do it for each
pattern.

-- 
Thanks,
--Warren Selby, dCAP
http://www.SelbyTech.com <http://www.selbytech.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120402/b86d9bb4/attachment.htm>


More information about the asterisk-users mailing list