RE: [Asterisk-java-users] AGI Chanell Issue
Brought to you by:
srt
From: Olivier B. <Oli...@vo...> - 2006-02-06 07:30:53
|
Stefan, =20 Running the script through Eclipse debugger, I can see that the problem = resides in the execution of the answer() operation. =20 The line included in AGIReaderImpl.java: "line =3D socket.readLine()" doe not return anything, so the threads just hangs. =20 On Asterisk console, I can only see the following when "agi debug" is = on: =20 AGI Tx >> agi_network_script: demo.agi AGI Tx >> agi_request: agi://localhost/demo.agi AGI Tx >> agi_channel: SIP/angela-1c3a AGI Tx >> agi_language: en AGI Tx >> agi_type: SIP AGI Tx >> agi_uniqueid: 1139209883.7 AGI Tx >> agi_callerid: "angela" <angela> AGI Tx >> agi_dnid: 1300 AGI Tx >> agi_rdnis: unknown AGI Tx >> agi_context: tutorial AGI Tx >> agi_extension: 1300 AGI Tx >> agi_priority: 1 AGI Tx >> agi_enhanced: 0.0 AGI Tx >> agi_accountcode: AGI Tx >>=20 =20 This is it!! =20 Help please. =20 Olivier =20 =20 =20 =20 =20 ________________________________ From: ast...@li... on behalf of = Stefan Reuter Sent: Sun 1/29/2006 10:08 AM To: ast...@li... Subject: Re: [Asterisk-java-users] AGI Chanell Issue 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 > > 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 |