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-06 17:22:28
|
I have tested the code provided at the bottom (HelloManager.java) and it works fine on my system. Are you using an IDE like Netbeans or Eclipse or IntelliJ? If not I would recommend doing so. If you on a command line only system I would learn a little more about creating a basic java package. Jacob From: Yves A. [mailto:yv...@gm...] Sent: Wednesday, November 06, 2013 10:54 AM To: ast...@li... Subject: Re: [Asterisk-java-devel] Call is not initiating between two extensions through Asterisk-Java program no... not the sources... the libraries (asterisk-java.jar) must be on the classpath... yves Am 06.11.2013 17:29, schrieb Chandramouli P: Hello Jacob, Thank you for your quick reply. The asterisk-java.jar file is in my source directory only, where my source code program (.java) is located. I think that we no need to add my program source directory to the class path. Am I correct? I look forward to hearing from you. Thank you. Regards, Chandra. On 11/6/2013 6:06 PM, Jac...@L-... wrote: So, now on the step where you execute java HelloManager you need to make sure that asterisk-java.jar is in your classpath. Jacob From: Chandramouli P [mailto:mou...@gm...] Sent: Wednesday, November 06, 2013 6:33 AM To: ast...@li... Subject: Re: Call is not initiating between two extensions through Asterisk-Java program Hello Jacob, Thank you for your quick reply. As you suggested, I executed the generated class file like java HelloManager. I am getting the below errors: Exception in thread "main" java.lang.NoClassDefFoundError: org/asteriskjava/manager/action/ManagerAction at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Unknown Source) at java.lang.Class.getMethod0(Unknown Source) at java.lang.Class.getMethod(Unknown Source) at sun.launcher.LauncherHelper.getMainMethod(Unknown Source) at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.asteriskjava.manager.action.ManagerAction at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 6 more Please note that I am getting the above errors with Step 6 and with out Step 6 also. Please let me know your thoughts. Thank you. Regards, Chandra. On 11/6/2013 5:44 PM, Jac...@L-... wrote: OK, after step 8 you now have a HelloManager.class file, you now need to tell Java to run that class file (java HellowManager) should be the command to have Java execute your code. I don't think step 6 is needed, as your code creates a new manager connection and handles the sending of the OriginateAction so there is no need to run "java -jar asterisk-java.jar". Jacob From: Chandramouli P [mailto:mou...@gm...] Sent: Wednesday, November 06, 2013 5:55 AM To: ast...@li... Subject: Re: Call is not initiating between two extensions through Asterisk-Java program Hello Jacob, Thank you for your reply. I tried as you suggested in both the below scenarios. But, I am not getting anything. Please find the below modified extensions.conf file: Scenario 1: [abcd] exten => 121,1,Dial(SIP/121,15) exten => 121,2,Hangup [abcd](+) exten => 115,1,Dial(SIP/115,15) exten => 115,2,Hangup Scenario 2: [abcd] exten => 121,1,Dial(SIP/121,15) exten => 121,2,Hangup exten => 115,1,Dial(SIP/115,15) exten => 115,2,Hangup I tested AMI through Telnet connected successfully. Please find the below output: # telnet 127.0.0.1 5038 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. Asterisk Call Manager/1.3 Action: Login UserName: manager Secret: password I pressed "Enter" key two times and got the below output: Response: Success Message: Authentication accepted After Step 8 (I mean after creating the .class file), Do I need to execute any command? Any update would be appreciated. Thanks in advance. Regards, CMP On 11/5/2013 7:23 PM, ast...@li... wrote: Re: Call is not initiating between two extensions through Asterisk-Java program (Jac...@L-...) ------------------------------------------------------------------------ ------ November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clk trk _______________________________________________ Asterisk-java-devel mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel ________________________________ <http://www.avast.com/> Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus <http://www.avast.com/> Schutz ist aktiv. |