On Mon, Apr 2, 2012 at 7:05 PM, Paolo Supino <paolo.sup...@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>
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to