Hi
Does anyone know how I can check if a callerID is more than 2 digits.
I am setting up my phones so that if the callerID is 3 digits the phones
ring one way if it is more than 3 digits it rings another i.e. internal
calls and external calls.
exten => 2222,1,GotoIf($["${CALLERIDNUM}" = "1111"]?5)
This will tell it to jump to 5 if callerID if 1111 but how do i tell it do
jump based on length of callerID?
Many thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20061101/23ff346f/attachment.htm
The following will:
exten => s,1,GotoIf($[${LEN(${CALLERID(num)})}=2]?50)
On 11/1/06, Scott Pinhorne <scott@scottpinhorne.co.uk>
wrote:>
>
>
>
> Hi
>
>
>
> Does anyone know how I can check if a callerID is more than 2 digits.
>
> I am setting up my phones so that if the callerID is 3 digits the phones
> ring one way if it is more than 3 digits it rings another i.e. internal
> calls and external calls.
>
>
>
> exten => 2222,1,GotoIf($["${CALLERIDNUM}" =
"1111"]?5)
>
>
>
> This will tell it to jump to 5 if callerID if 1111 but how do i tell it do
> jump based on length of callerID?
>
>
>
> Many thanks
>
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
On 11:53, Wed 01 Nov 06, Scott Pinhorne wrote:> Hi > > > > Does anyone know how I can check if a callerID is more than 2 digits. > > I am setting up my phones so that if the callerID is 3 digits the phones > ring one way if it is more than 3 digits it rings another i.e. internal > calls and external calls. > > > > exten => 2222,1,GotoIf($["${CALLERIDNUM}" = "1111"]?5) > > > > This will tell it to jump to 5 if callerID if 1111 but how do i tell it do > jump based on length of callerID?check the LEN() dialplan function -- Michiel van Baak michiel@vanbaak.eu http://michiel.vanbaak.eu GnuPG key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x71C946BD "Why is it drug addicts and computer afficionados are both called users?"
On Wed, 2006-11-01 at 11:53 +0000, Scott Pinhorne wrote:> Hi > > > > Does anyone know how I can check if a callerID is more than 2 digits. > > I am setting up my phones so that if the callerID is 3 digits the > phones ring one way if it is more than 3 digits it rings another i.e. > internal calls and external calls. > > > > exten => 2222,1,GotoIf($["${CALLERIDNUM}" = "1111"]?5)I'm sure on the wiki (http://voip-info.org) is a list of functions, including one to determine length of strings, but you could also do something like: exten => 2222,1,Goto(${CALLERIDNUM},1) exten => _XXX,1,dostuffwith3digits exten => _XXXX.,1,dostuffwithmorethan3digits Conrad
Scott Pinhorne wrote:> Hi > > > > Does anyone know how I can check if a callerID is more than 2 digits. > > I am setting up my phones so that if the callerID is 3 digits the phones > ring one way if it is more than 3 digits it rings another i.e. internal > calls and external calls. > > > > exten => 2222,1,GotoIf($["${CALLERIDNUM}" = "1111"]?5) > > > > This will tell it to jump to 5 if callerID if 1111 but how do i tell it > do jump based on length of callerID? > >Hi, would this work: exten => _X.,4,GotoIf($[${LEN(${CALLERIDNUM})} != 3 ] ? 40) -- thanks, yusuf -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
That worked great
Many Thanks
-----Original message-----
From: "C F" shmaltz@gmail.com
Date: Wed, 1 Nov 2006 06:57:28 -0600
To: "Asterisk Users Mailing List - Non-Commercial Discussion"
asterisk-users@lists.digium.com
Subject: Re: [asterisk-users] ${CALLERIDNUM}
> The following will:
> exten => s,1,GotoIf($[${LEN(${CALLERID(num)})}=2]?50)
>
> On 11/1/06, Scott Pinhorne <scott@scottpinhorne.co.uk> wrote:
> >
> >
> >
> >
> > Hi
> >
> >
> >
> > Does anyone know how I can check if a callerID is more than 2 digits.
> >
> > I am setting up my phones so that if the callerID is 3 digits the
phones
> > ring one way if it is more than 3 digits it rings another i.e.
internal
> > calls and external calls.
> >
> >
> >
> > exten => 2222,1,GotoIf($["${CALLERIDNUM}" =
"1111"]?5)
> >
> >
> >
> > This will tell it to jump to 5 if callerID if 1111 but how do i tell
it do
> > jump based on length of callerID?
> >
> >
> >
> > Many thanks
> >
> >
> > _______________________________________________
> > --Bandwidth and Colocation provided by Easynews.com --
> >
> > asterisk-users mailing list
> > To UNSUBSCRIBE or update options visit:
> >
> > http://lists.digium.com/mailman/listinfo/asterisk-users
> >
> >
> >
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
At 03:53 AM 11/1/2006, you wrote:>exten => 2222,1,GotoIf($["${CALLERIDNUM}" = "1111"]?5) > > >This will tell it to jump to 5 if callerID if 1111 but how do i tell >it do jump based on length of callerID?exten => 2222,1,GotoIf($[1${CALLERIDNUM} <= 1999]?5) Ira
>>>>> "SP" == Scott Pinhorne <scott@scottpinhorne.co.uk> writes:SP> I am setting up my phones so that if the callerID is 3 digits the SP> phones ring one way if it is more than 3 digits it rings another SP> i.e. internal calls and external calls. SP> exten => 2222,1,GotoIf($["${CALLERIDNUM}" = "1111"]?5) SP> This will tell it to jump to 5 if callerID if 1111 but how do i SP> tell it do jump based on length of callerID? There has been lots of answers to this one, but how about simply: exten => 2222/XXX,1,Goto(threedigits) exten => 2222/XX,1,Goto(twodigits) exten => 2222/.,1, ... /Benny
Benny Amorsen wrote:>>>>>> "SP" == Scott Pinhorne <scott@scottpinhorne.co.uk> writes: >>>>>> > > SP> I am setting up my phones so that if the callerID is 3 digits the > SP> phones ring one way if it is more than 3 digits it rings another > SP> i.e. internal calls and external calls. > > SP> exten => 2222,1,GotoIf($["${CALLERIDNUM}" = "1111"]?5) > > SP> This will tell it to jump to 5 if callerID if 1111 but how do i > SP> tell it do jump based on length of callerID? > > There has been lots of answers to this one, but how about simply: > > exten => 2222/XXX,1,Goto(threedigits) > exten => 2222/XX,1,Goto(twodigits) > exten => 2222/.,1, ... >One of the earlier replies suggested using the LEN function, an example: exten => 2222,1,GotoIf(LEN(${CALLERID(num)}) = 3?4) This will jump to priority 4 if extension is 3 digits Leo