Girggs Ha
Girggs Ha

Reputation: 3

How to set answered channel time

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();
    }
}

Upvotes: -2

Views: 112

Answers (1)

arheops
arheops

Reputation: 15259

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

Upvotes: 0

Related Questions