Re: [Asterisk-java-users] originate a call and get user selected option
Brought to you by:
srt
From: Mordechay K. <mka...@gm...> - 2013-01-02 16:27:53
|
B.H. On Wed, Jan 2, 2013 at 5:49 PM, Kelly Goedert <kel...@gm...>wrote: > Hi, Hello > > I need to originate a call from java, this call is made to an extension > which plays menu options to the user, like, press 1 to confirm and 2 to > cancel. > > I originate a call to the extension 400@ivr that looks like this: > > [ivr] > exten => 400,1,MP3Player(sound1.mp3) > exten => 400,2,Background(menu.mp3) > exten => 400,n,WaitExten(5) > > exten => 1,1,MP3Player(confirmed.mp3) > > exten => 2,1,MP3Player(cancel.mp3) > exten => 3,1,MP3Player(later.mp3) > exten => 4,1,Goto(ivr,400,2) > exten => i,1,MP3Player(invalid.mp3) > exten => t,1,Hangup() > > Is it possible to know if the user selected 1,2,3 or 4? If so, how can I > do that? > > Thanks > > Kelly > > AFAIK, Asterisk 1.4 sends NewExtenEvent on every priority in the dialplan but the later versions do not send this event. I would recommend to use cusom UserEvent like this on every extention of the menu: exten => s,n,UserEvent(MENU,uid: ${UNIQUEID},selection: ${EXTEN}) (you need to pass the channel's UNIQUEID because for some reason it is not passed automatically by asterisk for user events) Then you create a class MenuEvent (The class name matters!) which extends org.asteriskjava.manager.event.UserEvent and register it with your AMI connection: connection.registerUserEventClass(MenuEvent.class); Another solution whould be to use FastAGI, if it is applicable in your case > > > ------------------------------------------------------------------------------ > Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery > and much more. Keep your Java skills current with LearnJavaNow - > 200+ hours of step-by-step video tutorials by Java experts. > SALE $49.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122612 > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > Best regards, Mordechay -- משיח NOW! Moshiach is coming very soon, prepare yourself! יחי אדוננו מורינו ורבינו מלך המשיח לעולם ועד! |