[asterisk-users] dynamic menus in dialplan

Danny Nicholas danny at debsinc.com
Tue Apr 14 10:44:52 CDT 2009


Steve Edwards had (IMO) the best answer to this.  Here is an example of
how-to in a regular dialplan:

[sat]

exten => s,1(start),Noop(in test Section)

exten => s,n,AGI(satver.agi|)

exten => s,n,Set(Play1=record/silence)

exten => s,n,Set(Play2=record/silence)

exten => s,n,Set(Press1=record/silence)

exten => s,n,Set(Press2=record/silence)

exten => s,n,Set(Play3=record/silence)

exten => s,n,Set(Press3=record/silence)

exten => s,n,Set(PRESS=0)

exten => s,n(s1check),Gotoif($["${sat1}" != "TRUE"]?s2check)

exten => s,n,Set(Play1=record/nsfmenu)

exten => s,n,Set(Press1=record/press1)

exten => s,n,Set(PRESS=1)

exten => s,n,Goto(sat|s|s2check)

exten => s,n(s2check),Gotoif($["${sat2}" != "TRUE"]?s3check)

.

exten =>
s,n(allchecked),Background(${Play1}&${Press1}&${Play2}&${Press2}&${Play3}&${
Press3}&${Play4}&${Press4})

exten => s,n,WaitExten(10,m)

exten => s,n,Set(TRY=$[${TRY} + 1])

exten => s,n,Gotoif($["${TRY}" = "3"]?expired)

exten => s,n,Goto(sat|s|start)

exten => s,n(expired),playback(vm-goodbye)

exten => s,n,Hangup

exten => i,1,Set(TRY=$[${TRY} + 1])

exten => i,n,Verbose(Invalid Try # ${TRY} )

exten => i,n,Gotoif($["${TRY}" = "3"]?expired)

exten => i,n,Background(invalid)

exten => i,n,Goto(sat|s|start)

exten => t,1,Goto(sat|s|start)

exten => 1,1,Gotoif($["${sat1}" = "TRUE"]?sat1|s|1)

exten => 1,n,Gotoif($["${sat2}" = "TRUE"]?sat1|s|1)

exten => 2,1,Gotoif($["${sat2}" = "TRUE"]?sat2|s|1)

exten => 2,n,Gotoif($["${sat3}" = "TRUE"]?sat3|s|1)

 

 [sat1]

Sat1 stuff

[sat2] 

Sat2 stuff

  _____  

From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of David fire
Sent: Monday, April 13, 2009 9:54 PM
To: eric.fort at gmail.com; Asterisk Users Mailing List - Non-Commercial
Discussion
Subject: Re: [asterisk-users] dynamic menus in dialplan

 

hi
you can use AGI or a database internal or external
then if you know all the satellites  and are a few you can 
if(${SAT1}=1)
playback(SAT1)
if(${SAT2}=1)
playback(SAT2)
.
.
.

or you can use an agi 
David



2009/4/14 Eric Fort <eric.fort at gmail.com>

I have an application that needs to vary the menu choices available based
upon the availability of an external resource at a given time.  What I have
in mind is a system that can uplink a user to one of many different
satellites.  Due to the nature of orbital mechanics a satellite may be out
of range at any given time.  I only want to present a menu of available
satellites.  I can query an external program for a list of available
satellites, but how can I use that list to present menu options for
selection?  What's the best way of doing this?  Does anyone know of similar
examples?

Thanks,

Eric

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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




-- 
(\__/) 
(='.'=)This is Bunny. Copy and paste bunny into your 
(")_(")signature to help him gain world domination. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090414/e1358d30/attachment.htm 


More information about the asterisk-users mailing list