在下面的代码中,我将频道设置为在 10 秒内自动挂断,但没有任何反应。
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();
}
}