RE: [Asterisk-java-users] Manager.originateAction tutorial and 'error'
Brought to you by:
srt
From: Darren H. <dha...@gh...> - 2006-02-21 16:26:27
|
Thanks Jason! It's not that different from http://asterisk-java.sourceforge.net/tutorial.html, just more sysouts to verify assumptions and trying setApplication/setData versions from a previous thread on the mailing list. The phones are SIP softphones (x-lite) if that makes a difference (and they are calling back and forth fine). =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3Dcode from run() = =3D=3D=3D=3D=3D=3D=3D=3D OriginateAction originateAction; ManagerResponse originateResponse; =20 originateAction =3D new OriginateAction(); originateAction.setChannel("SIP/201"); //my phone /* * Below are various attempts to make the call */ =20 originateAction.setApplication("Dial"); originateAction.setData("SIP/200"); // originateAction.setData("200"); =20 =20 // originateAction.setContext("default"); // originateAction.setContext("external"); // originateAction.setExten("SIP/200"); // originateAction.setExten("200"); =20 originateAction.setPriority(new Integer(1)); =20 originateAction.setActionId("originateActionCallfromManagerAPI"); // connect to Asterisk and log in System.out.println("logging in"); managerConnection.login(); System.out.println("connected. Attempting action"); =20 //verify for testing AsteriskServer as =3D managerConnection.getAsteriskServer(); managerConnection.sendAction(new StatusAction()); //this seems to be fine System.out.println(as.getHostname()); =20 // send the originate action and wait for a maximum of 30 seconds for Asterisk // to send a reply originateResponse =3D managerConnection.sendAction(originateAction, 30000); =20 // print out whether the originate succeeded or not //here, response is always 'Error', the actionId is the actionId above, and uniqueId is null System.out.println("The actionId is: " + originateResponse.getActionId()); System.out.println("The response Status is: " + originateResponse.getResponse()); System.out.println("The uniqueID is: " + originateResponse.getUniqueId()); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3Dend code from run() = =3D=3D=3D=3D=3D=3D=3D=3D ________________________________ From: ast...@li... [mailto:ast...@li...] On Behalf Of Jason Wolfe Sent: Tuesday, February 21, 2006 11:14 AM To: ast...@li... Subject: RE: [Asterisk-java-users] Manager.originateAction tutorial and 'error' =09 =09 please post the relevant code and I'll try to help you out. =20 Jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of Darren Hartford Sent: Tuesday, February 21, 2006 10:57 AM To: ast...@li... Subject: [Asterisk-java-users] Manager.originateAction tutorial and 'error' =09 =09 Hey all,=20 N00b trying to learn this. Running Asterisk 1.2 and using binary lib distribution of asterisk-java-0.2.=20 Following the Tutorial, I've used the HelloManager class to connect to the server (and I can get the AsteriskServer and verify that information is correct). When I try to use the example to originate a call from my SIP/201 to a default Context/local 200 extension (or the setApp/SetData SIP/200 way from the mailing list), I keep getting back in the originateResponse.getResponse of 'Error'. Unfortunately, not very helpful in learning where the problem is. How should I debug to figure out what I should correct? Just trying to follow the tutorial to originate a call.=20 Thanks,=20 -D=20 |