Re: [Asterisk-java-users] Passing Information through AMI
Brought to you by:
srt
From: Rounak S. <rou...@gm...> - 2013-07-03 06:06:52
|
Hii, I tried your suggestion but it not working JAVA CODE: originateAction = new OriginateAction(); originateAction.setChannel("dahdi/g0/01234567"); originateAction.setContext("medicine"); originateAction.setExten("s"); originateAction.setPriority(1); originateAction.setTimeout(30000l); originateAction.setAsync(true); originateAction.setVariable("var1", *value*); Extensions.conf [medicine] exten => s,1,Answer() exten => s,n,AGI(agi://127.0.0.1/hello.agi) exten => s,n,Hangup() and Extensions.conf [medicine] exten => s,1,Answer() exten => s,n,AGI(agi://127.0.0.1/hello.agi/?var1=${var1}) exten => s,n,Hangup() AGI public void service(AgiRequest request, AgiChannel channel) throws AgiException { System.out.println(request.getParameter("var1")); System.out.println(channel.getData("var1")); System.out.println(channel.getFullVariable("var1")); System.out.println(channel.getVariable("var1")); } I tried all possible combination but none of the are working.I think I have to somewhere declare var1 in asterisk.I declared it in medicine context but again its not working. And out of four which one were you pointing to to gat the variable.I guess channel.getVariable - request.getParameter - channel.getData("var1") - channel.getFullVariable("var1") - channel.getVariable("var1") On Wed, Jul 3, 2013 at 12:53 AM, Mordechay Kaganer <mka...@gm...>wrote: > B.H. > > > On Mon, Jul 1, 2013 at 11:09 AM, Rounak Saha <rou...@gm...>wrote: > >> Can you provide me the function to pass channel variables?Is it >> setVariables(Map<String,String>)<http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/action/OriginateAction.html#setVariables(java.util.Map)> >> ? >> >> This is what I am doing.My doubts are in red.Sorry for making it so >> colourful. :-) >> >> JAVA CODE: >> originateAction = new OriginateAction(); >> originateAction.setChannel("dahdi/g0/01234567"); >> originateAction.setContext("medicine"); >> originateAction.setExten("s"); >> originateAction.setPriority(1); >> originateAction.setTimeout(30000l); >> originateAction.setAsync(true); >> // Here I want to send some values maybe 3 or 4. >> > > originateAction.setVariable("var1", *value*); > > >> >> Extensions.conf >> [medicine] >> exten => s,1,Answer() >> exten => s,n,AGI(agi://127.0.0.1/hello.agi) //How will I send the >> values to my AGI? >> exten => s,n,Hangup() >> >> AGI >> public void service(AgiRequest request, AgiChannel channel) >> throws AgiException >> { >> // How to obtain the value??channel.getVariable will work?? >> } >> >> > The variables you send using OriginateAction are normal channel variables. > They are accessible from the dialplan or from AGI just like any other > channel variable. > > >> On Mon, Jul 1, 2013 at 3:24 AM, Mordechay Kaganer <mka...@gm...>wrote: >> >>> B.H. >>> >>> On Sat, Jun 29, 2013 at 11:02 AM, Rounak Saha <rou...@gm...>wrote: >>> >>>> To make a outbound call I have to use Manager AMI ri8?I cant use AGi? >>>> >>>> I am making a dynamic IVR . This(below) is what I am doing. >>>> >>>> I search my database,get a "phone number and filelocation of a song ". >>>> Now I want to call that phone number and play the song; >>>> >>>> How to pass infromation (phonenumber and address where the song is) to >>>> asterisk dynamically. >>>> >>>> >>>> >>> You can pass channel variables through OriginateAction - this way you >>> can pass data from your java app to asterisk's dialplan. >>> >>> >>>> >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> This SF.net email is sponsored by Windows: >>>> >>>> Build for Windows Store. >>>> >>>> http://p.sf.net/sfu/windows-dev2dev >>>> _______________________________________________ >>>> Asterisk-java-users mailing list >>>> Ast...@li... >>>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>>> >>>> >>> >>> >>> -- >>> משיח NOW! >>> Moshiach is coming very soon, prepare yourself! >>> יחי אדוננו מורינו ורבינו מלך המשיח לעולם ועד! >>> >>> >>> ------------------------------------------------------------------------------ >>> This SF.net email is sponsored by Windows: >>> >>> Build for Windows Store. >>> >>> http://p.sf.net/sfu/windows-dev2dev >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Windows: >> >> Build for Windows Store. >> >> http://p.sf.net/sfu/windows-dev2dev >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> > > > -- > משיח NOW! > Moshiach is coming very soon, prepare yourself! > יחי אדוננו מורינו ורבינו מלך המשיח לעולם ועד! > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > |