[asterisk-users] extensions.conf gotoif and label

Nicolas nicolas at evar.fr
Thu Feb 1 03:15:31 MST 2007


Hello,

I got a little interogation about these 3 points.
I want to write something like this sample in my extension.conf. I have 
tested and it works but I don't know if it is a good way to make a menu.
I don't want to put number as it is boring to maintain.
Does anyone know if there is some problem to write like this?

exten => 7890,1,Wait(1)
exten => 7890,n(lbl0),Read(REP|annonce|1)
exten => 7890,n,GotoIf($[${REP} = 1 ] ?lbl1:lbl2)
exten => 7890,n(lbl1),noop( hit 1 ! )
exten => 7890,n,system(echo you hit one)
exten => 7890,n,Hangup
exten => 7890,n(lbl2),GotoIf($[${REP} != 2 ] ?lbl3)
exten => 7890,n,noop( hit 2 ! )
exten => 7890,n,system(echo you hit two)
exten => 7890,n,Hangup
exten => 7890,n(lbl3),noop( hit something else ! )
exten => 7890,n,system(echo you hit another key)
exten => 7890,n,goto(lbl0)

Another question on the web i have seen there is some trouble using 
"while" application. Is that still true or it was an old release wich 
get this problem?


Thanks ,
Nicolas



More information about the asterisk-users mailing list