Re: [Asterisk-java-users] AGI Chanell Issue
Brought to you by:
srt
From: Stefan R. <sr...@re...> - 2006-01-29 18:08:35
|
Hi, what version of Asterisk do you use? Please try to enable agi debugging on the CLI and post the output. Maybe that helps trace the problem: srv1*CLI> agi debug AGI Debugging Enabled =3DStefan On Thu, 2006-01-26 at 16:17 -0800, Olivier Brand wrote: > 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 >=20 > INFO: Thread pool started. >=20 > Jan 26, 2006 4:07:44 PM net.sf.asterisk.util.impl.JavaLoggingLog > info >=20 > INFO: Listening on *:4573. >=20 >=20 > 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 >=20 > INFO: Received connection. >=20 > Jan 26, 2006 4:11:45 PM net.sf.asterisk.util.impl.JavaLoggingLog > info >=20 > INFO: Added mapping for 'demo.agi' to class class > com.vodafone.asterisk.demo.WeatherScript >=20 > Jan 26, 2006 4:11:45 PM net.sf.asterisk.util.impl.JavaLoggingLog > info >=20 > INFO: Begin AGIScript com.vodafone.asterisk.demo.WeatherScript on > AGIServer-TaskThread-0 >=20 > Jan 26, 2006 4:11:45 PM com.vodafone.asterisk.demo.WeatherScript > service >=20 > INFO: HELLO WORLD >=20 > Jan 26, 2006 4:11:45 PM com.vodafone.asterisk.demo.WeatherScript > service >=20 > INFO: net.sf.asterisk.fastagi.impl.AGIChannelImpl@dbe178 >=20 >=20 > 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!!! >=20 > channel.answer(); // <=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D DOES NOT E= XECUTE > logger.info("Channel answered"); > //sayDigits("1234"); > //streamFile("demo-congrats"); > channel.hangup(); > } > =20 > } >=20 > =20 |