How to set answered channel time

115 Views Asked by At

In the code below I set the channel to automatically hang up in 10 seconds, but nothing happens.

import org.asteriskjava.fastagi.AgiChannel;

import org.asteriskjava.fastagi.AgiException;
import org.asteriskjava.fastagi.AgiRequest;
import org.asteriskjava.fastagi.BaseAgiScript;

public class AgiServer extends BaseAgiScript
{
    public void service(AgiRequest request, AgiChannel channel)
            throws AgiException
    {
         exec("Dial","SIP/"+request.getExtension()+"");
         channel.setAutoHangup(10);
         hangup();
    }
}
1

There are 1 best solutions below

1
On BEST ANSWER

In your code nothing happens after Dial line until your phone call will be hanguped.

You should use dial command L or S param or set timeout BEFORE dialling