[Asterisk-Users] GotoIf problem

kurt x kurtwp at gmail.com
Wed Mar 9 10:14:09 MST 2005


Removing the quotes and eliminating s,3,gotoif did work but its not
what I am looking for.
What I want to do is the following:  If a ani that comes in has <10>
digits I want to change the ${CALLERIDNUM} to "unknown".  If  the ani
is 10 digits just goto voicemail.

When I set up my [vmail] to look like below, it does not work.  When I
send a 4 digit
ani my e-mail confirmation of the voicemail shows the 4 digit ani and
not Unknown.

[globals]
Setvar(DIGITS=10)


[vmail]
exten => s,1,Answer
exten => s,2,NoOp(${ext})
exten => s,3,GotoIf($[${LEN(${CALLERIDNUM})} != $DIGITS}]?4:5)
exten => s,4,Setvar(${CALLERIDNUM}="Unknown")
exten => s,5,Voicemail(u${ext})
exten => s,6,Hangup


Kurt 

On Wed, 09 Mar 2005 07:34:24 +1100, Howard Lowndes <lannet at lannet.com.au> wrote:
> On Wed, 2005-03-09 at 05:29, kurt x wrote:
> >  I am trying to test how the GotoIf and $LEN functions work but am not
> > succeeding is
> > this venture.  When I dial and access voicemail with an ani of 3000
> > the gotoif statement does not push the call to s|6.  Its goes through
> > each line( 1,2,3,4,5,6,7) .  In additon when I dial with a 10 digit
> > ani the s,3,Gotoif does not work.  It also goes through each line(
> > 1,2,3,4,5,6,7)
> >
> > Any help is greatly appreciated.
> 
> Have you tried removing the quotes?
> 
> >
> > Thanks
> >
> > Kurt
> >
> > Asterisk CVS-HEAD-07/14/04-16:28:29 built by
> > root at asterick.wlb2.n2p.com on a i686 running Linux
> >
> >
> > [globals]
> > ${ext}=0
> > SetGlobalVar(DIGITS=10)
> >
> >
> > [vmail]
> > exten => s,1,Answer
> > exten => s,2,NoOp(${ext})
> > exten => s,3,GotoIf($[${LEN(${CALLERIDNUM}}) = ${DIGITS}]?s|5)
> > exten => s,4,GotoIf($[${CALLERIDNUM}  = "3000"]?s|6)
> > exten => s,5,Voicemail(u${ext})
> > exten => s,6,Background(pbx-invalid)
> > exten => s,7,Hangup
> > _______________________________________________
> > Asterisk-Users mailing list
> > Asterisk-Users at lists.digium.com
> > http://lists.digium.com/mailman/listinfo/asterisk-users
> > To UNSUBSCRIBE or update options visit:
> >    http://lists.digium.com/mailman/listinfo/asterisk-users
> --
> Howard.
> LANNet Computing Associates;
> Your Linux people <http://www.lannetlinux.com>
> ------------------------------------------
> "When you just want a system that works, you choose Linux;
> when you want a system that just works, you choose Microsoft."
> ------------------------------------------
> "Flatter government, not fatter government;
> Get rid of the Australian states."
> 
>



More information about the asterisk-users mailing list