[Asterisk-java-users] external callers and access to AGI Scripts
Brought to you by:
srt
From: CHUCK S. <csy...@DU...> - 2007-07-13 13:16:18
|
I am having a problem, I am using trixbox to send make a batch of calls. = I am using a ManagerConnection to make calls to external numbers, then = connect them to an AGI script that lives at extension "111". The problem = is, if I attempt to call an internal number and transfer it to the 111 = everything works fine, but if I call an external number, the line rings = but then gets dropped. This may not be a problem related with the = asterisk-java package, if it isn't can anyone point me is the right = direction to allow the calls to connect to the agi script. Here is some = testing code I am using: import java.io.*; import org.asteriskjava.manager.*; import org.asteriskjava.manager.action.*; import org.asteriskjava.manager.event.*; import org.asteriskjava.manager.response.*; import org.asteriskjava.fastagi.*; public class Test1 implements ManagerEventListener { private ManagerConnection managerConnection; public Test1() { lg( "Starting application..." ); try { =09 ManagerConnectionFactory factory =3D new ManagerCon= nectionFactory("192.168.1.10", "admin", "password"); this.managerConnection =3D factory.createManagerCon= nection(); managerConnection.addEventListener(this); =09 OriginateAction originateAction; RedirectAction transferAction; ManagerResponse originateResponse; ManagerResponse hangupResponse; =09 originateAction =3D new OriginateAction(); originateAction.setChannel("SIP/t/1630xxxxxxx"); originateAction.setContext("default"); originateAction.setExten("111"); originateAction.setCallerId( "test"); originateAction.setPriority(new Integer(1)); originateAction.setTimeout(new Integer(30000)); managerConnection.login();=09 =09 originateResponse =3D managerConnection.sendAction(= originateAction , 30000); =09 lg(""); lg(""); lg(""); lg( originateResponse.getResponse() ); lg (originateResponse.toString()); lg(""); lg(""); lg(""); if ( originateResponse.getResponse().compareTo( = "Success" ) =3D=3D 0 ) { lg( "Call Connected" ); = =09 } managerConnection.logoff();=09 =09 } catch( Exception e ) { lg( e.getMessage() +"" ); e.printStackTrace(); } lg( "Done" ); } =09 private void lg( String s ) { System.out.println( s + "" ); } =09 public void onManagerEvent(ManagerEvent event) { lg(event.toString()); } =09 public static void main( String[] args ) { new Test1(); } } The agi script is in the context "[from-internal-trixbox]" Is this my problem, if so where do I put it? sorry I am new to asterisk, = and asterisk-java. Thanks for any help you can provide. |