-2

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();
    }
}
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Girggs Ha
  • 3
  • 3

1 Answers1

0

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

arheops
  • 15,544
  • 1
  • 21
  • 27