[Asterisk-java-devel] Originate Aciton
Brought to you by:
srt
From: Daniel M. <da...@ou...> - 2006-08-07 06:42:34
|
Hey, I am trying to use the manager API to start a call between an external number and an extension. In the documentation I have read it says that when you preform a call like this it should 1. Call the external number 2. Once that has been picked up call the extension When I try to do this, it calls the external number fine but then hangs up on them when they answer. Code: //all the login and stuff has been done OriginateAction org = new OriginateAction(); org.setChannel("SIP/"+number+"@myfone-sip"); org.setContext("default"); org.setExten("300"); org.setPriority(1); org.setCallerId("0422439077"); org.setCallingPres(true); org.setTimeout(20000l); ManagerResponse res; try { System.out.println("Calling"); res = dmc.sendAction(org); System.out.println("The resposnse was: "+res.getResponse ()); System.out.println("The message was: "+res.getMessage()); System.out.println("Not calling ne more"); } catch (IOException e) { e.printStackTrace(); } catch (TimeoutException e) { e.printStackTrace(); } End Code Cheers Daniel |