Re: [Asterisk-java-users] Run a jar file
Brought to you by:
srt
From: Mateusz K. <by...@gm...> - 2012-07-17 14:22:02
|
I forgot to add that fastagi mapping file also must be on classpath so you can just put it in the jar (top level) or in the same directory as the jar but then you may need to add "." to -cp parameter. 2012/7/17 Mateusz Kulpa <by...@gm...> > Probably you can also have them both in seperate jars and just add them in > the -cp parameter. > > 2012/7/17 Mateusz Kulpa <by...@gm...> > >> Hello Shanavaz, >> >> This is how I run asterisk-java FastAGI server using jar files: >> >> I have asterisk-java-VERSION.jar unpacked in my agiScripts.jar file (in >> my case it's done automatically by maven). Then from directory containing >> this jar file I run following command: >> java -cp agiScripts.jar org.asteriskjava.fastagi.DefaultAgiServer >> >> I am not sure if it's the best practice but thats what I do and it fits >> my solution perfectly. >> >> Hope it helps. >> >> >> 2012/7/17 Shanavaz E A <sha...@ya...> >> >>> yes, i configured the fastagi mapping file as : >>> hello.agi = com.mysite.mypackagename.MyClassFileName >>> >>> Also while building jar file, the main class also specified in the >>> manifest. >>> >>> >>> >>> --- On *Tue, 7/17/12, Albert Bonomo <ape...@gm...>* wrote: >>> >>> >>> From: Albert Bonomo <ape...@gm...> >>> Subject: Re: [Asterisk-java-users] Run a jar file >>> To: ast...@li... >>> Date: Tuesday, July 17, 2012, 7:07 PM >>> >>> >>> java-asterisk can not find your Main.class in your jar file. >>> Have you tried to configure the map file using the complete calss name ? >>> something like com.yourdomain.yourproject.somepacckage.yourcalss ? >>> >>> I don't remember now how to configure asterisk-java. Once I learned how >>> to do it "inside" >>> my ear project, I dropped asterisk-java and stooped using it. >>> >>> The problem to solve is how to tel asterisk-java where is your Main.call >>> in your .jar project. >>> >>> >>> 2012/7/17 Shanavaz E A <sha...@ya...<http://us.mc1601.mail.yahoo.com/mc/compose?to=sha...@ya...> >>> > >>> >>> When i run single class script, I am first starting asterisk-java >>> using the command : >>> java -jar asterisk-java.jar >>> >>> Then I am putting the class file in the same folder and its working. >>> Then I replace the class file with the jar file and also update the mapping >>> file. Then stop the asterisk-java process and starts it again. This is the >>> scenario i use to test. But in this case its not calling the main class in >>> the jar file. Any clue ? >>> >>> >>> >>> --- On *Tue, 7/17/12, Albert Bonomo <ape...@gm...<http://us.mc1601.mail.yahoo.com/mc/compose?to=ape...@gm...> >>> >* wrote: >>> >>> >>> From: Albert Bonomo <ape...@gm...<http://us.mc1601.mail.yahoo.com/mc/compose?to=ape...@gm...> >>> > >>> Subject: Re: [Asterisk-java-users] Run a jar file >>> To: ast...@li...<http://us.mc1601.mail.yahoo.com/mc/compose?to=ast...@li...> >>> Date: Tuesday, July 17, 2012, 6:53 PM >>> >>> >>> When you use your single class script, there must be some service >>> running listening at port 4573. >>> Probably you have run asterisk-java and left it running before your AGI >>> script runs. >>> asterisk-java reads the mapping file and takes care of everything. >>> >>> When you are working with jar project, your project must listen on this >>> port to get and manage >>> events and AGI script calls. >>> >>> There are many examples of ear projects with NetBeans on the internet. >>> >>> 2012/7/17 Shanavaz E A <sha...@ya...<http://us.mc1601.mail.yahoo.com/mc/compose?to=sha...@ya...> >>> > >>> >>> Dear friends, >>> >>> I have successfully installed asterisk-java, and I am able to run agi >>> scripts using that. I am running asterisk-java and I have put a single >>> class file in the folder and mapped as >>> hello.agi = MyClassFileName >>> and this is working. >>> >>> Now I have added few more class files and used package naming and build >>> a single jar file for this package. I use netbeans to build the proect and >>> the jar file. >>> I have now added mapping as >>> hello.agi = com.mysite.mypackagename.MyClassFileName >>> But this is not working. I am getting this error : >>> agi://127.0.0.1/hello.agi: No script configured for URL 'agi:// >>> 127.0.0.1/hello.agi' >>> >>> Can somebody please help & guide me to configure properly. >>> >>> Thanks in advance. >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. Discussions >>> will include endpoint security, mobile security and the latest in malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li...<http://us.mc1601.mail.yahoo.com/mc/compose?to=Ast...@li...> >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >>> >>> >>> -- >>> (@_@) >>> >>> There are only 10 types of people in the world: >>> Those who understand binary and those who don't >>> >>> @apetob at Twitter >>> >>> >>> -----Inline Attachment Follows----- >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. >>> Discussions >>> will include endpoint security, mobile security and the latest in >>> malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> >>> -----Inline Attachment Follows----- >>> >>> >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li...<http://us.mc1601.mail.yahoo.com/mc/compose?to=Ast...@li...> >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. Discussions >>> will include endpoint security, mobile security and the latest in malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li...<http://us.mc1601.mail.yahoo.com/mc/compose?to=Ast...@li...> >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >>> >>> >>> -- >>> (@_@) >>> >>> There are only 10 types of people in the world: >>> Those who understand binary and those who don't >>> >>> @apetob at Twitter >>> >>> >>> -----Inline Attachment Follows----- >>> >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. >>> Discussions >>> will include endpoint security, mobile security and the latest in >>> malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> >>> -----Inline Attachment Follows----- >>> >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li...<http://us.mc1601.mail.yahoo.com/mc/compose?to=Ast...@li...> >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Live Security Virtual Conference >>> Exclusive live event will cover all the ways today's security and >>> threat landscape has changed and how IT managers can respond. Discussions >>> will include endpoint security, mobile security and the latest in malware >>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >> > |