Re: [Asterisk-java-devel] Call is not initiating between two extensions through Asterisk-Java progr
Brought to you by:
srt
From: <Jac...@L-...> - 2013-11-05 13:53:32
|
I think you issue is going to be in your extensions.conf [abcd] exten => 121,1,Dial(SIP/121,15) exten => 121,2,Hangup [abcd] exten => 115,1,Dial(SIP/115,15) exten => 115,2,Hangup You are defining [abcd] twice which is not good, it will match on the first one found and never hit the second one. It should look like this (only one [abcd] entry): [abcd] exten => 121,1,Dial(SIP/121,15) exten => 121,2,Hangup exten => 115,1,Dial(SIP/115,15) exten => 115,2,Hangup As well you can test if your AMI (asterisk manager interface) is working by do a Telnet session to 127.0.0.1 on port 5038 and seeing if you can login manually. Jacob From: Chandramouli P [mailto:mou...@gm...] Sent: Tuesday, November 05, 2013 6:45 AM To: ast...@li... Subject: [Asterisk-java-devel] Call is not initiating between two extensions through Asterisk-Java program Hi, I am completely new to Asterisk-Java and following http://www.asterisk-java.org/development/tutorial.html link. I am able to execute basic "Hello AGI" example. Now, I am trying to execute "Hello Manager" example. But, nothing is happening. I have two extensions (121, 115) and connected to my Asterisk server through two soft phones (Xlite). I am able to make call between two extensions directly. Now, I want to initiate a call from 121 to extension 115 using Asterisk-Java program. Please find my below configuration step by step: 1) /etc/asterisk/manager.conf [general] enabled = yes port = 5038 bindaddr = 0.0.0.0 [manager] secret=password permit=0.0.0.0/0.0.0.0 read=all write=all 2) /etc/asterisk/sip.conf [121] type=friend username=121 secret=cmp1 callerid="cmp121" host=dynamic context=abcd [115] type=friend username=115 secret=cmp2 callerid="cmp115" host=dynamic context=abcd 3) /etc/asterisk/extensions.conf [abcd] exten => 121,1,Dial(SIP/121,15) exten => 121,2,Hangup [abcd] exten => 115,1,Dial(SIP/115,15) exten => 115,2,Hangup 4) HelloManager.java import java.io.IOException; import org.asteriskjava.manager.AuthenticationFailedException; import org.asteriskjava.manager.ManagerConnection; import org.asteriskjava.manager.ManagerConnectionFactory; import org.asteriskjava.manager.TimeoutException; import org.asteriskjava.manager.action.OriginateAction; import org.asteriskjava.manager.response.ManagerResponse; public class HelloManager { private ManagerConnection managerConnection; public HelloManager() throws IOException { ManagerConnectionFactory factory = new ManagerConnectionFactory( "localhost", "manager", "password"); this.managerConnection = factory.createManagerConnection(); } public void run() throws IOException, AuthenticationFailedException, TimeoutException { OriginateAction originateAction; ManagerResponse originateResponse; originateAction = new OriginateAction(); originateAction.setChannel("SIP/121"); originateAction.setContext("abcd"); originateAction.setExten("115"); originateAction.setPriority(new Integer(1)); //originateAction.setTimeout(new Integer(30000)); managerConnection.login(); originateResponse = managerConnection.sendAction(originateAction, 30000); // print out whether the originate succeeded or not System.out.println(originateResponse.getResponse()); managerConnection.logoff(); } public static void main(String[] args) throws Exception { HelloManager helloManager; helloManager = new HelloManager(); helloManager.run(); } } 5) Connected to Asterisk server (asterisk -rvvvvv) 6) Start Asterisk-Java ( java -jar asterisk-java.jar) 7) Compiled the program (javac -cp asterisk-java.jar HelloManager.java) 8) HelloManager.class file is created. I executed the above 8 steps and not seeing any messages on Asterisk-Java server console (on *:4573) and also not seeing any messages on Asterisk server console. Call is also not forming between the extensions. What I need to do in addition? Any help would be appreciated. Thanks in advance. Regards, CMP |