Problems with AGI on Asterisk-Java

Integrating the Cepstral engine

Problems with AGI on Asterisk-Java

Postby csyperski » Fri Jul 23, 2010 6:44 am

I really want to purchase a license, but I am having a problem that may be a deal breaker and I don't how to work around it. I am using asterisk-java 0.3.1 on Ubuntu 10.04 LTS, running asterisk 1.6. Here is my issue:

I have a real simple app that extends BaseAgiScript, the problem I am
having is that if a user hangs up in the middle of the call I can't
reconnect, via my automated dialer.
Code: Select all
public class Swift extends BaseAgiScript
{
    public void service(AgiRequest ar, AgiChannel ac) throws
AgiException
    {
        try
        {
            setAutoHangup(120);
            answer();
            exec("WaitForSilence", "1000|2|15");
            exec("Swift", "\"" + this.getVariable("msg") + "\"");
        }
        catch( Exception e )
        {
           
        }
        finally
        {
            hangup();
        }
    }

}


On attempting to connect to the same extension I get from my dialer:

Code: Select all
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:529)
        at
org.asteriskjava.util.internal.SocketConnectionFacadeImpl.<init>(SocketConnectionFacadeImpl.java:69)
        at
org.asteriskjava.manager.internal.ManagerConnectionImpl.createSocket(ManagerConnectionImpl.java:714)
        at
org.asteriskjava.manager.internal.ManagerConnectionImpl.connect(ManagerConnectionImpl.java:693)
        at
org.asteriskjava.manager.internal.ManagerConnectionImpl.doLogin(ManagerConnectionImpl.java:486)
        at
org.asteriskjava.manager.internal.ManagerConnectionImpl.login(ManagerConnectionImpl.java:434)
        at
org.asteriskjava.manager.internal.ManagerConnectionImpl.login(ManagerConnectionImpl.java:419)
        at
org.asteriskjava.manager.DefaultManagerConnection.login(DefaultManagerConnection.java:266)
        at
net.dupage88.present.service.dialer.CallThread.loginToAsterisk(CallThread.java:375)
        at
net.dupage88.present.service.dialer.CallThread.placeCall(CallThread.java:252)
        at
net.dupage88.present.service.dialer.CallThread.run(CallThread.java:97)


As I said, if the user hangs up while swift is running TTS, they are unable to call the number again. If they listen to the whole message everything is fine. I have been struggling with this for the past two days, so any help would be appreciated.

Or is it possible to pass an abbritrary string, from asterisk-java to swift without using fastagi?

Thanks in advance,
Chuck
csyperski
 
Posts: 2
Joined: Fri Jul 23, 2010 6:35 am

Return to Asterisk

Who is online

Users browsing this forum: No registered users and 8 guests

cron