[asterisk-users] Submenus

Mir michael.sysdba at gmail.com
Mon Sep 4 08:47:03 MST 2006


Hello
I'm doing an IVR-service, where pilot can check metar (airport weather
information), they enter the 4 letter airport code on their phone, and
get the metar read back by text-to-speech.


[Metar]

exten => 1,1,answer

exten => 1,2,Background(Met_welcome)

exten => 1,3,set(airport="")2,Background(Met_welcome)

exten => 1,3,set(airport="")3,set(airport="")

exten => 1,n,Background(Met_Instructions)

(When they press an airportcode, I set a variable)

exten => 3575,1,set(airport=ekrk)

exten => 3575,n,goto(Metar,s,1)

exten => 3598,1,set(airport=ekyt)

and so on

exten => 3575,n,goto(Metar,s,1)

exten => 3598,1,set(airport=ekyt)

and so on

exten => 3598,1,set(airport=ekyt)

and so on
In the S extension, I do all of the processing .
My problem is that some of the airports has the same code, for
instance EKCH wich is entered by pressing 3524, but EKAH has the same
digits, so I need to make a sub-menu, where I can ask the caller to
press 1 for EKCH or 2 for EKAH.
Right now, I do like this:


exten => 3524,1,background(Met_ch_bi_ah)background(Met_ch_bi_ah)

exten => 4,1,set(airport=ekch)

exten => 4,n,goto(Metar,s,1)

exten => 6,1,set(airport=ekbi)

exten => 6,n,goto(Metar,s,1)1,set(airport=ekch)

exten => 4,n,goto(Metar,s,1)

exten => 6,1,set(airport=ekbi)

exten => 6,n,goto(Metar,s,1)6,1,set(airport=ekbi)

exten => 6,n,goto(Metar,s,1)6,n,goto(Metar,s,1)

This is not a very good solution, if a user by mistake press 4 in the
main loop, it goes right to EKCH metar, instead of informing the user
that it is an invalid code.

So what I need is a way to make a submenu, that is only "visible" when
needed, and can set the airport variable.

How do I do this?



Michael



More information about the asterisk-users mailing list