[Asterisk-java-users] AGI Chanell Issue
Brought to you by:
srt
From: Olivier B. <Oli...@vo...> - 2006-01-27 00:17:50
|
I am trying to implement the example from the tutorial but the example hangs when a channel method is called (including of course the answer method). =20 1) I am using the Asterisk version on Windows. 2) The extension.conf contains the following line: exten =3D> 1300,1,Agi(agi://localhost/demo.agi) 3) I am starting the DefaultAGIServer from Eclipse and see the following logging info at startup: Jan 26, 2006 4:07:44 PM net.sf.asterisk.util.impl.JavaLoggingLog info INFO: Thread pool started. Jan 26, 2006 4:07:44 PM net.sf.asterisk.util.impl.JavaLoggingLog info INFO: Listening on *:4573. 4) I am calling extension 1300 from an Xlite client, the client tries to connect =20 5) The following logging info shows up in Asterisk PBX console: =20 -- Executing AGI("SIP/olivier-6fd9","agi://localhost/demo.agi") in new stack =20 6) On Eclipse I can see the following logging info: Jan 26, 2006 4:11:45 PM net.sf.asterisk.util.impl.JavaLoggingLog info INFO: Received connection. Jan 26, 2006 4:11:45 PM net.sf.asterisk.util.impl.JavaLoggingLog info INFO: Added mapping for 'demo.agi' to class class com.vodafone.asterisk.demo.WeatherScript Jan 26, 2006 4:11:45 PM net.sf.asterisk.util.impl.JavaLoggingLog info INFO: Begin AGIScript com.vodafone.asterisk.demo.WeatherScript on AGIServer-TaskThread-0 Jan 26, 2006 4:11:45 PM com.vodafone.asterisk.demo.WeatherScript service INFO: HELLO WORLD Jan 26, 2006 4:11:45 PM com.vodafone.asterisk.demo.WeatherScript service INFO: net.sf.asterisk.fastagi.impl.AGIChannelImpl@dbe178 7) The code of the demo is as follow: =20 package com.vodafone.asterisk.demo; =20 import java.util.logging.Logger; =20 import net.sf.asterisk.fastagi.AGIChannel; import net.sf.asterisk.fastagi.AGIException; import net.sf.asterisk.fastagi.AGIRequest; import net.sf.asterisk.fastagi.BaseAGIScript; =20 public class WeatherScript extends BaseAGIScript { private static Logger logger =3D Logger.getLogger("WeatherScript"); public void service(AGIRequest arg0, AGIChannel channel) throws AGIException { =20 logger.info("HELLO WORLD"); logger.info(channel.toString()); logger.info(String.valueOf(channel.getChannelStatus())); // <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D NEVER GET LOGGED!!! channel.answer(); // <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D DOES NOT = EXECUTE logger.info("Channel answered"); //sayDigits("1234"); //streamFile("demo-congrats"); channel.hangup(); } =20 } =20 |