RE: [Asterisk-java-users] asterisk manager can't get variable values
Brought to you by:
srt
From: Jason W. <jas...@be...> - 2006-02-03 22:27:52
|
This is interesting... when I used the 'tutorial app' at http://www.voip-info.org/wiki/view/MANAGERAPI-JAVA-AGI I couldn't get the actuall variable value from the following code... GetVariableCommand OBJ_DIALSTATUS= new GetVariableCommand("DIALSTATUS"); String dialstatus = OBJ_DIALSTATUS.getVariable(); if(dialstatus.equals("ANSWER")) { } in the above code, getVariable returned "DIALSTATUS", not the value of DIALSTATUS, ANSWER or whatever... do you think this might have something to do with the problem... If there really is a problem. I'm fairly new to Java and very new to asterisk, so I don't want nasty comments, but I guess your right, it might not work. Surely the author of this code tested it and it worked at some point. Jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of María Chóliz Sent: Friday, February 03, 2006 2:45 PM To: ast...@li... Subject: Re: [Asterisk-java-users] asterisk manager can't get variable values I think it might a problem with the version of the package net.sf.Asterisk... because when I use the method getAttribue it does not compile,.... 2006/2/3, Jason Wolfe <ja...@cl...>: Hello, In the dialplan, I set the variable 'accepted=yes' when the user presses 1 and is transfered to extension 1. I'm using the following code to try and get variable values from asterisk in my java console app using the manager API: //**************************************** getVarAction = new GetVarAction(); getVarAction.setVariable("accepted"); Thread.sleep (14000); //wait ten seconds to allow the user to make a selection actionResponse = managerConnection.sendAction(getVarAction,10000); String accepted = new String(); accepted = actionResponse.getAttribute("EXTEN"); System.out.println("accepted=" + accepted); //**************************************** For Any variable I try to get, even the predefined channel variables, I get null. Help would be greatly appreciated. Jason ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ Asterisk-java-users mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-users -- María |