Re: [Asterisk-java-users] Communicating between AGI and AMI
Brought to you by:
srt
From: Mordechay K. <mka...@gm...> - 2013-08-22 21:13:32
|
B.H. Hi, Rounak! On Tue, Jul 16, 2013 at 11:47 AM, Rounak Saha <rou...@gm...>wrote: > Hii I am making a call from Manager AMI and in my dialPlan the caller will > be connected to AGI.I want to send a variable var from AMI to AGI through > channel variables > > > originateAction.setChannel("SIP/1000abc"); > originateAction.setContext("outgoing-call"); > originateAction.setExten("100"); > originateAction.setVariable("var", " foo baar"); > > I tried all possible combination of outbound call but none of them working > > [outgoing-call] > exten=>100,1,AGI(agi://127.0.0.1/hello.agi?user=${var}<http://127.0.0.1/hello.agi?user=$%7Bvar%7D> > ) > > [outgoing-call] > exten=>100,1,AGI(agi://127.0.0.1/hello.agi?var=${var}<http://127.0.0.1/hello.agi?var=$%7Bvar%7D> > ) > I don't understand what is different, but both are OK... > > [outgoing-call] > exten=>100,1,AGI(agi://127.0.0.1/hello.agi,${var}<http://127.0.0.1/hello.agi,$%7Bvar%7D> > ) > This won't work AFAIK > > > **AGI** > > public void service(AgiRequest request, AgiChannel channel) > throws AgiException > { > answer(); > System.out.println("Inside"); > String a=request.getParameter("var"); > // String b=request.getParameter("user"); > String c=channel.getVariable("var"); > // String d=channel.getVariable("user"); > System.out.println(a+"\n"+b+"\n"+c+"\n"+d+"\n"); > hangup(); > } > > Output is null all the time. > This is very strange. Works fine for me. When you call request.getParameter() you read from AGI call URI's parametes, when you call channel.getVariable() you access channel's variables directly. What versions of Asterisk and Asterisk-Java are you using? > > > > ------------------------------------------------------------------------------ > See everything from the browser to the database with AppDynamics > Get end-to-end visibility with application monitoring from AppDynamics > Isolate bottlenecks and diagnose root cause in seconds. > Start your free trial of AppDynamics Pro today! > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > -- כתיבה וחתימה טובה לשנה טובה ומתוקה בגשמיות וברוחניות! משיח NOW! Moshiach is coming very soon, prepare yourself! יחי אדוננו מורינו ורבינו מלך המשיח לעולם ועד! |