Re: [Asterisk-java-users] Package Name in fastagi-mapping.properties
Brought to you by:
srt
From: Martin S. <ma...@be...> - 2008-03-26 19:35:58
|
Hi Rodney, The dotted syntax works for me. The loading method is actually in the Abstract base class, AbstractMappingStrategy, and it uses java.lang.Class#forName, which accepts the dotted syntax. It does check to make sure your class implements the org.asteriskjava.fastagi.AgiScript interface, so if your script doesn't that will fail. The example for the resourcebundle strategy is -- in your properties file: hello.agi = com.example.fastagi.HelloAgiScript in your dialplan: exten => 123,1,AGI(agi://your.server.com/hello.agi) Your mileage may vary, or maybe something else is gone wrong, but have you alternatively tried org.asteriskjava.fastagi.ClassNameMappingStrategy? I tend to prefer it over the resource bundle one, as I often change these mappings and I don't want to bring down my application to redeploy it with a new mapping file (My EJB server will halt anything that lists the properties file as a dependency when I redo the properties file). The example for ClassNameMappingStrategy is: exten => 123,1,AGI(agi://your.server.com/com.example.agi.MyScript) If neither works, show us the output from Asterisk and your agi script's logging :) Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221 ________________________________ From: ast...@li... [mailto:ast...@li...] On Behalf Of Rodney Seifert Sent: Wednesday, March 26, 2008 11:46 AM To: ast...@li... Subject: [Asterisk-java-users] Package Name in fastagi-mapping.properties Hello, I have a working example of asterisk-java with fastagi. Very good stuff! Thank you for all the efforts. My fastagi-mapping.properties looks like this: AsterTest.agi = AsterTest In this example my AsterTest.class has no package. My question is how do I reference a package name in the fastagi-mapping.properties? I would like my object to live in a package such as: dev.util.AsterTest I have tried the following variations in the fastagi-mapping.properties and all produce Class not found errors: AsterTest.agi = dev.util.AsterTest or AsterTest.agi = dev/util/AsterTest Is it possible to reference the script object in a package name? Thank you. Rodney |