asterisk-java-users Mailing List for Asterisk-Java Library (Page 159)
Brought to you by:
srt
You can subscribe to this list here.
2005 |
Jan
|
Feb
(8) |
Mar
(33) |
Apr
(36) |
May
(19) |
Jun
(21) |
Jul
(53) |
Aug
(30) |
Sep
(36) |
Oct
(34) |
Nov
(43) |
Dec
(72) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(123) |
Feb
(75) |
Mar
(86) |
Apr
(46) |
May
(41) |
Jun
(29) |
Jul
(76) |
Aug
(38) |
Sep
(39) |
Oct
(68) |
Nov
(16) |
Dec
(17) |
2007 |
Jan
(34) |
Feb
(18) |
Mar
(39) |
Apr
(30) |
May
(20) |
Jun
(10) |
Jul
(59) |
Aug
(54) |
Sep
(60) |
Oct
(22) |
Nov
(14) |
Dec
(10) |
2008 |
Jan
(34) |
Feb
(67) |
Mar
(65) |
Apr
(67) |
May
(60) |
Jun
(51) |
Jul
(88) |
Aug
(75) |
Sep
(47) |
Oct
(143) |
Nov
(54) |
Dec
(42) |
2009 |
Jan
(46) |
Feb
(80) |
Mar
(162) |
Apr
(159) |
May
(200) |
Jun
(34) |
Jul
(46) |
Aug
(59) |
Sep
(5) |
Oct
(35) |
Nov
(73) |
Dec
(30) |
2010 |
Jan
(23) |
Feb
(50) |
Mar
(8) |
Apr
(24) |
May
(19) |
Jun
(49) |
Jul
(56) |
Aug
(35) |
Sep
(26) |
Oct
(79) |
Nov
(39) |
Dec
(34) |
2011 |
Jan
(27) |
Feb
(22) |
Mar
(28) |
Apr
(12) |
May
(16) |
Jun
(19) |
Jul
(1) |
Aug
(64) |
Sep
(19) |
Oct
(11) |
Nov
(17) |
Dec
(12) |
2012 |
Jan
(6) |
Feb
(8) |
Mar
(15) |
Apr
(43) |
May
(41) |
Jun
(14) |
Jul
(32) |
Aug
(3) |
Sep
(4) |
Oct
(7) |
Nov
(11) |
Dec
(11) |
2013 |
Jan
(35) |
Feb
(11) |
Mar
(23) |
Apr
(25) |
May
(37) |
Jun
(47) |
Jul
(25) |
Aug
(21) |
Sep
|
Oct
(1) |
Nov
(9) |
Dec
|
2014 |
Jan
(26) |
Feb
(2) |
Mar
(18) |
Apr
(41) |
May
(7) |
Jun
(7) |
Jul
(24) |
Aug
(5) |
Sep
(6) |
Oct
(8) |
Nov
(9) |
Dec
(7) |
2015 |
Jan
(7) |
Feb
(15) |
Mar
(8) |
Apr
(12) |
May
(7) |
Jun
|
Jul
|
Aug
(5) |
Sep
(1) |
Oct
(3) |
Nov
(30) |
Dec
(3) |
2016 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
|
May
(9) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
(4) |
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mar...@gm...> - 2006-02-06 12:13:17
|
Hi, I am running asterisk in a Virtual Machine, and I don't why the .wav files it plays sound really bad,...with some noise in the background. I generate them with : sox SourcepathFile.* -r 8000 -c 1 DestinypathFile.wav or echo $cadena | text2wave -o $1 -otype riff -f 8000 -scale 6 - In another machine (hardware not virtual ) with Asterisk 1.07 it reproduces sounds perfectly . The virtual machine has Asterisk 1.2.1....can this be happening because of the fact that the machine is virtual??? Thanks in advance, -- Mar=EDa |
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 |
From: Brett S. <bs...@no...> - 2006-02-05 06:20:36
|
try: if (event instanceof NewChannelEvent) ... else if event instanceof HangupEvent) ... Jason Wolfe wrote: > When my handleEvent method recieves an event, how can I tell what type of > event it is... > > > temporarily, I'm just casting it in a try catch so that I can access the > methods, but this, of course, isn't the right way to do it. > > try{ NewChannelObject = (NewChannelEvent)event; > System.out.println("NewChannelEvent"); > System.out.println(NewChannelObject.getCallerId()); > System.out.println(NewChannelObject.getCallerIdName()); > System.out.println(NewChannelObject.getChannel()); > System.out.println(NewChannelObject.getState()); > }catch(Exception e){} } > > > Jason > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > 0 |
From: Jason W. <jas...@be...> - 2006-02-05 04:03:46
|
When my handleEvent method recieves an event, how can I tell what type of event it is... temporarily, I'm just casting it in a try catch so that I can access the methods, but this, of course, isn't the right way to do it. try{ NewChannelObject = (NewChannelEvent)event; System.out.println("NewChannelEvent"); System.out.println(NewChannelObject.getCallerId()); System.out.println(NewChannelObject.getCallerIdName()); System.out.println(NewChannelObject.getChannel()); System.out.println(NewChannelObject.getState()); }catch(Exception e){} } Jason |
From: Jason W. <jas...@be...> - 2006-02-05 02:01:18
|
I apoligize for so many posts about this subject, but I found the problem and frankly it doesn't make any sense... If I could get a comment on this I would greatly appreciate it... The following code would only out.println 'testvar=null' GetVarAction getVarAction = new GetVarAction(); getVarAction.setVariable("testvar"); ManagerResponse actionResponse = (ManagerResponse) managerConnection.sendAction(getVarAction,30000); String accepted = actionResponse.getAttribute("testvar"); System.out.println("testvar=" + accepted); using ethereal, I looked at the actual packet coming from asterisk and noticed it was in the form: Response: Success Variable: testvar Value: youGotMe So... I changed the following line in the code... //String accepted = actionResponse.getAttribute("testvar"); String accepted = actionResponse.getAttribute("value"); and suddenly, what do ya know... out.println gives 'testvar=youGotMe' so, is asterisk sending manager response in a format different than is expected by the reader? Is this something that is configurable? I am also having a similar problem parsing events.. I'm running my java console app on a windows 2000 box, and asterisk is on an FC4 box. thanks. Jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of Jason Wolfe Sent: Saturday, February 04, 2006 1:11 PM To: ast...@li... Subject: RE: [Asterisk-java-users] asterisk manager can't get variable values Thanks for the help, I know I'm close, and just missing something minor. Perhaps I'm not in full understanding of how actions and responses work... I used ethereal to quickly look at the individual packets moving between my client and the asterisk server. I see that asterisk responds to my action with the value that I'm looking for. ManagerResponse actionResponse; GetVarAction getVarAction; getVarAction = new GetVarAction(); getVarAction.setVariable("CONSOLE"); actionResponse = managerConnection.sendAction(getVarAction,10000); System.out.println(actionResponse.toString()); //Why isn't the variable listed in here??? /* this is what I get from actionResponse.toSTring() net.sf.asterisk.manager.response.ManagerResponse: actionId='null'; message='null'; response='Success'; uniqueId='null'; */ String myVar = new String(); myVar = actionResponse.getVariable("CONSOLE"); // System.out.println("myVar=" + myVar); //myVar is null??? Well, if the problem isn't obvious from the code above then I guess I'm heading to the sourcecode to try and pinpoint my misunderstanding. Jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of María Chóliz Sent: Saturday, February 04, 2006 4:46 AM To: ast...@li... Subject: Re: [Asterisk-java-users] asterisk manager can't get variable values Hi, Jason, I have worked more with the manager_java, not with fastagi, but I think I might try to help you, or I hope so. The code you have just sent does what it should.Visit this page: http://asterisk-java.sourceforge.net/apidocs/net/sf/asterisk/fastagi/command /GetVariableCommand.html see: getVariable() Returns the name of the variable to retrieve. Have you tried witth actions of Manager. If you arer using a version of Asterisk under 1.2...you can set a local variable in the dialplan by using the action SetVarAction, and then getting the value with GetVarAction. Or setting the value in the dialplan and getting it with getvaraction. Getvarction only works with local variables under version 1.2 asterisk , from 1.2 it works also with global variables. I hope this helped you, good luck! |
From: Jason W. <jas...@be...> - 2006-02-04 18:10:58
|
Thanks for the help, I know I'm close, and just missing something minor. Perhaps I'm not in full understanding of how actions and responses work... I used ethereal to quickly look at the individual packets moving between my client and the asterisk server. I see that asterisk responds to my action with the value that I'm looking for. ManagerResponse actionResponse; GetVarAction getVarAction; getVarAction = new GetVarAction(); getVarAction.setVariable("CONSOLE"); actionResponse = managerConnection.sendAction(getVarAction,10000); System.out.println(actionResponse.toString()); //Why isn't the variable listed in here??? /* this is what I get from actionResponse.toSTring() net.sf.asterisk.manager.response.ManagerResponse: actionId='null'; message='null'; response='Success'; uniqueId='null'; */ String myVar = new String(); myVar = actionResponse.getVariable("CONSOLE"); // System.out.println("myVar=" + myVar); //myVar is null??? Well, if the problem isn't obvious from the code above then I guess I'm heading to the sourcecode to try and pinpoint my misunderstanding. Jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of María Chóliz Sent: Saturday, February 04, 2006 4:46 AM To: ast...@li... Subject: Re: [Asterisk-java-users] asterisk manager can't get variable values Hi, Jason, I have worked more with the manager_java, not with fastagi, but I think I might try to help you, or I hope so. The code you have just sent does what it should.Visit this page: http://asterisk-java.sourceforge.net/apidocs/net/sf/asterisk/fastagi/command /GetVariableCommand.html see: getVariable() Returns the name of the variable to retrieve. Have you tried witth actions of Manager. If you arer using a version of Asterisk under 1.2...you can set a local variable in the dialplan by using the action SetVarAction, and then getting the value with GetVarAction. Or setting the value in the dialplan and getting it with getvaraction. Getvarction only works with local variables under version 1.2 asterisk , from 1.2 it works also with global variables. I hope this helped you, good luck! |
From: <mar...@gm...> - 2006-02-04 09:46:24
|
Hi, Jason, I have worked more with the manager_java, not with fastagi, but I think I might try to help you, or I hope so. The code you have just sent does what it should.Visit this page: http://asterisk-java.sourceforge.net/apidocs/net/sf/asterisk/fastagi/comman= d/GetVariableCommand.html see: *getVariable<http://asterisk-java.sourceforge.net/apidocs/net/sf/asterisk/= fastagi/command/GetVariableCommand.html#getVariable%28%29> *() Returns the name of the variable to retrieve. Have you tried witth actions of Manager. If you arer using a version of Asterisk under 1.2...you can set a local variable in the dialplan by using the action SetVarAction, and then getting the value with GetVarAction. Or setting the value in the dialplan and getting it with getvaraction. Getvarction only works with local variables under version 1.2 asterisk , from 1.2 it works also with global variables. I hope this helped you, good luck! |
From: Jason W. <jas...@be...> - 2006-02-03 22:27:52
|
This is interesting... when I used the 'tutorial app' at http://www.voip-info.org/wiki/view/MANAGERAPI-JAVA-AGI I couldn't get the actuall variable value from the following code... GetVariableCommand OBJ_DIALSTATUS= new GetVariableCommand("DIALSTATUS"); String dialstatus = OBJ_DIALSTATUS.getVariable(); if(dialstatus.equals("ANSWER")) { } in the above code, getVariable returned "DIALSTATUS", not the value of DIALSTATUS, ANSWER or whatever... do you think this might have something to do with the problem... If there really is a problem. I'm fairly new to Java and very new to asterisk, so I don't want nasty comments, but I guess your right, it might not work. Surely the author of this code tested it and it worked at some point. Jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of María Chóliz Sent: Friday, February 03, 2006 2:45 PM To: ast...@li... Subject: Re: [Asterisk-java-users] asterisk manager can't get variable values I think it might a problem with the version of the package net.sf.Asterisk... because when I use the method getAttribue it does not compile,.... 2006/2/3, Jason Wolfe <ja...@cl...>: Hello, In the dialplan, I set the variable 'accepted=yes' when the user presses 1 and is transfered to extension 1. I'm using the following code to try and get variable values from asterisk in my java console app using the manager API: //**************************************** getVarAction = new GetVarAction(); getVarAction.setVariable("accepted"); Thread.sleep (14000); //wait ten seconds to allow the user to make a selection actionResponse = managerConnection.sendAction(getVarAction,10000); String accepted = new String(); accepted = actionResponse.getAttribute("EXTEN"); System.out.println("accepted=" + accepted); //**************************************** For Any variable I try to get, even the predefined channel variables, I get null. Help would be greatly appreciated. Jason ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ Asterisk-java-users mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-users -- María |
From: <mar...@gm...> - 2006-02-03 19:45:28
|
I think it might a problem with the version of the package net.sf.Asterisk.= . . because when I use the method getAttribue it does not compile,.... 2006/2/3, Jason Wolfe <ja...@cl...>: > > Hello, > > In the dialplan, I set the variable 'accepted=3Dyes' when the user presse= s 1 > and is transfered to extension 1. > > I'm using the following code to try and get variable values from asterisk > in > my java console app using the manager API: > > //**************************************** > > getVarAction =3D new GetVarAction(); > getVarAction.setVariable("accepted"); > Thread.sleep (14000); //wait ten seconds to allow the user to make a > selection > actionResponse =3D managerConnection.sendAction(getVarAction,10000); > > String accepted =3D new String(); > accepted =3D actionResponse.getAttribute("EXTEN"); > System.out.println("accepted=3D" + accepted); > > //**************************************** > > For Any variable I try to get, even the predefined channel variables, I > get > null. Help would be greatly appreciated. > > Jason > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486&dat= =3D121642 > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > -- Mar=EDa |
From: Jason W. <ja...@cl...> - 2006-02-03 16:26:03
|
Hello, In the dialplan, I set the variable 'accepted=yes' when the user presses 1 and is transfered to extension 1. I'm using the following code to try and get variable values from asterisk in my java console app using the manager API: //**************************************** getVarAction = new GetVarAction(); getVarAction.setVariable("accepted"); Thread.sleep (14000); //wait ten seconds to allow the user to make a selection actionResponse = managerConnection.sendAction(getVarAction,10000); String accepted = new String(); accepted = actionResponse.getAttribute("EXTEN"); System.out.println("accepted=" + accepted); //**************************************** For Any variable I try to get, even the predefined channel variables, I get null. Help would be greatly appreciated. Jason |
From: <mar...@gm...> - 2006-02-03 15:39:08
|
Hello, I am working with Version 1.2.1of Asterisk in a virtual machine, and the action SetVarAction does not work sometimes, however the responseManager says"Success" to the action ,although it didn't work. This is the code so that you can understand me better: setVarAction.setChannel(sChannel); setVarAction.setVariable("STRING"); setVarAction.setValue("Whatever"); originateResponse =3D managerConnection.sendAction(setVarAction, 30000); if(originateResponse.getResponse().equals("Success")) { System.out.println(" SETVARACTION correcto "+ originateResponse.getMessage()); } else System.out.println(" setvaraction mal "+originateResponse.getResponse()); I executing the same code in another machine with asterik 0.7 and it works prefectly well. Can anybody please help me????? Thanks in advance, Mar=EDa |
From: Jason W. <ja...@cl...> - 2006-02-03 04:46:16
|
I'm using asterisk.manager OriginateAction in a console app to originate an outbound call. I see the success and failuer responses, and this may be good enough to determine if the call is answered or busy. What I need is to know if the call is accepted, for instance, by the user pressing one. If the call is answered but denied, I need to loop over the origination again with a secondary number. Can someone point me in the right direction. Jason |
From: g f <gf...@gm...> - 2006-02-02 23:15:59
|
Hello all, I am trying to do a simple HangupAction method like so: public void hangupUser(String userID)throws IOException, AuthenticationFailedException, TimeoutException { HangupAction hAction; ManagerResponse mResponse; hAction =3D new HangupAction(); hAction.setChannel(userID); if(!managerConnection.isConnected()) { managerConnection.login(); } mResponse =3D managerConnection.sendAction(hAction,30000); managerConnection.logoff(); //declared elsewhere. System.out.println("HUNGUP CALLED"); // I get to this part } The above code returns no errors, but also does not disconnect the user fro= m the conference. Is there another Hangup action for conferences? Thanks again!! |
From: Stefan R. <sr...@re...> - 2006-01-31 01:39:17
|
On Mon, 2006-01-30 at 14:29 +0100, Mattias Malmquist wrote: > Thanks a lot! That worked like a charm. But why? > It seems more intuitive to use the event generating method in this case the event generating method collects all events send in response to the event generating action until the corresponding action complete event has been received. (which event is the action complete event is determined by a call to getActionCompleteEventClass() on the action) it then returns a ResponseEvents object containing the received response and all received events. in your case you are handling the events by yourself and you are not even interested in the response to your action so using sendAction() with a null action event handler is the best way to go (it will be non blocking as Asterisk-Java doesnt have to wait for any response from Asterisk). > The questions never seem to end... >=20 > Are there any (easy?) way to get the same information as I can get from t= he > getQueueMemberStatus() method in Asterisk 1.0.7? I earlier explained my p= roblems > with migrating to 1.2, so sadly, that is not an option right now. no good one. you can use a command action with "show queues" and try to parse the result - but thats rather ugly. Example: CommandAction commandAction =3D new CommandAction("show queues"); CommandResponse response =3D (CommandResponse) c.sendAction(commandAction); for (String line : (List<String>) response.getResult()) { System.out.println(line); } Result: mainq has 0 calls (max unlimited) in 'ringall' strategy (0s holdtime), W:0, C:0, A:0, SL:0.0% within 0s Members:=20 Agent/@1 (Not in use) has taken no calls yet No Callers =3DStefan |
From: Olivier B. <Oli...@vo...> - 2006-01-30 15:56:37
|
I am running the WIn32 version 0.56 of Asterisk, which is the equivalent = of the Linux version 1.0.10 No error coming out the agi debug cli. =20 Olivier ________________________________ 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 |
From: Mattias M. <ma...@wx...> - 2006-01-30 13:31:03
|
Thanks a lot! That worked like a charm. But why? It seems more intuitive = to use the event generating method in this case, but hey... I'm just = glad it worked... =3D) The questions never seem to end... Are there any (easy?) way to get the same information as I can get from = the getQueueMemberStatus() method in Asterisk 1.0.7? I earlier explained = my problems with migrating to 1.2, so sadly, that is not an option right = now. Thank you for all assistance! // Mattias Malmquist -----Ursprungligt meddelande----- Fr=E5n: ast...@li... = [mailto:ast...@li...] F=F6r Stefan = Reuter Skickat: den 29 januari 2006 19:23 Till: ast...@li... =C4mne: Re: [Asterisk-java-users] Lot of timeouts when sending = actionsrepetedly Try to replace=20 manager.sendEventGeneratingAction(action, 5000); by manager.sendAction(action, null); =3DStefan On Wed, 2006-01-25 at 18:02 +0100, Mattias Malmquist wrote: > Hi all! >=20 > =20 >=20 > I am currently using this simple class to monitor the queue. One > instance of this class is created once every one second (and hopefully > deleted after reaching end). >=20 > =20 >=20 > I am actually quite new at Java and thread programming so I realize > that there must be some better way to do this, but I hope this is > sufficient for the time being. >=20 > =20 >=20 > The problem (if it is a problem) I am experiencing at the moment is > that I receive one timeout every second, but it seems like I get all > the events generated by this action. >=20 > =20 >=20 > My question is this: Do I actually lose any information as I get these > timeouts or are there any other reasons for receiving them? >=20 > =20 >=20 > Never mind the horrors of my code. I just created this to get around > the deadlock I experienced when trying to send an action from the > event dispatching thread. =3D) >=20 > =20 >=20 > Thanks in advance! >=20 > =20 >=20 > // Mattias Malmquist >=20 > =20 >=20 >=20 > =20 >=20 > =20 >=20 > public class QueueStatusChecker extends Thread { >=20 > ManagerConnection manager; >=20 > EventGeneratingAction action; >=20 > =20 >=20 > public QueueStatusChecker(ManagerConnection > manager, ManagerAction action) { >=20 > this.manager =3D manager; >=20 > this.action =3D > (EventGeneratingAction)action; >=20 > } >=20 > public void run() { >=20 > try { >=20 >=20 > manager.sendEventGeneratingAction(action, 5000); >=20 > } catch (Exception e) { >=20 >=20 > if(e.getClass().getSimpleName().equals("EventTimeoutException")) { >=20 >=20 > System.out.println("Timeout"); >=20 > } >=20 > } >=20 > } >=20 > } >=20 >=20 |
From: Stefan R. <sr...@re...> - 2006-01-30 00:41:20
|
thanks, i've added it to svn. =3DStefan |
From: Brett S. <bs...@no...> - 2006-01-29 23:32:43
|
doh, and here is the code :) public enum HangupCause { AST_CAUSE_UNALLOCATED(1), AST_CAUSE_NO_ROUTE_TRANSIT_NET(2), AST_CAUSE_NO_ROUTE_DESTINATION(3), AST_CAUSE_CHANNEL_UNACCEPTABLE(6), AST_CAUSE_CALL_AWARDED_DELIVERED(7), AST_CAUSE_NORMAL_CLEARING(16), AST_CAUSE_USER_BUSY(17), AST_CAUSE_NO_USER_RESPONSE(18), AST_CAUSE_NO_ANSWER(19), AST_CAUSE_CALL_REJECTED(21), AST_CAUSE_NUMBER_CHANGED(22), AST_CAUSE_DESTINATION_OUT_OF_ORDER(27), AST_CAUSE_INVALID_NUMBER_FORMAT(28), AST_CAUSE_FACILITY_REJECTED(29), AST_CAUSE_RESPONSE_TO_STATUS_ENQUIRY(30), AST_CAUSE_NORMAL_UNSPECIFIED(31), AST_CAUSE_NORMAL_CIRCUIT_CONGESTION(34), AST_CAUSE_NETWORK_OUT_OF_ORDER(38), AST_CAUSE_NORMAL_TEMPORARY_FAILURE(41), AST_CAUSE_SWITCH_CONGESTION(42), AST_CAUSE_ACCESS_INFO_DISCARDED(43), AST_CAUSE_REQUESTED_CHAN_UNAVAIL(44), AST_CAUSE_PRE_EMPTED(45), AST_CAUSE_FACILITY_NOT_SUBSCRIBED(50), AST_CAUSE_OUTGOING_CALL_BARRED(52), AST_CAUSE_INCOMING_CALL_BARRED(54), AST_CAUSE_BEARERCAPABILITY_NOTAUTH(57), AST_CAUSE_BEARERCAPABILITY_NOTAVAIL(58), AST_CAUSE_BEARERCAPABILITY_NOTIMPL(65), AST_CAUSE_CHAN_NOT_IMPLEMENTED(66), AST_CAUSE_FACILITY_NOT_IMPLEMENTED(69), AST_CAUSE_INVALID_CALL_REFERENCE(81), AST_CAUSE_INCOMPATIBLE_DESTINATION(88), AST_CAUSE_INVALID_MSG_UNSPECIFIED(95), AST_CAUSE_MANDATORY_IE_MISSING(96), AST_CAUSE_MESSAGE_TYPE_NONEXIST(97), AST_CAUSE_WRONG_MESSAGE(98), AST_CAUSE_IE_NONEXIST(99), AST_CAUSE_INVALID_IE_CONTENTS(100), AST_CAUSE_WRONG_CALL_STATE(101), AST_CAUSE_RECOVERY_ON_TIMER_EXPIRE(102), AST_CAUSE_MANDATORY_IE_LENGTH_ERROR(103), AST_CAUSE_PROTOCOL_ERROR(111), AST_CAUSE_INTERWORKING(127), /* Special Asterisk aliases */ AST_CAUSE_BUSY(AST_CAUSE_USER_BUSY), AST_CAUSE_FAILURE(AST_CAUSE_NETWORK_OUT_OF_ORDER), AST_CAUSE_NORMAL(AST_CAUSE_NORMAL_CLEARING), AST_CAUSE_NOANSWER(AST_CAUSE_NO_ANSWER), AST_CAUSE_CONGESTION(AST_CAUSE_NORMAL_CIRCUIT_CONGESTION), AST_CAUSE_UNREGISTERED(AST_CAUSE_NO_ROUTE_DESTINATION), AST_CAUSE_NOTDEFINED(0), AST_CAUSE_NOSUCHDRIVER(AST_CAUSE_CHAN_NOT_IMPLEMENTED); HangupCause(int cause) { this.cause = cause; } HangupCause(HangupCause cause) { this.cause = cause.cause; } public String toString() { String result = this.name(); if (this.name().startsWith("AST_CAUSE_")) result = this.name().substring(10); return result; } int cause; } |
From: Brett S. <bs...@no...> - 2006-01-29 23:30:42
|
Thanks Stefan, I've created the following enum. I thought you might find it useful for inclusion in Asterisk-Java. Regards, Brett. Stefan Reuter wrote: > On Mon, 2006-01-30 at 06:19 +1100, Brett Sutton wrote: > >> I'm trying to find a list of values returned by the >> HangupEvent.getCause() method and their meanings. >> >> Does anyone know where to find this information? >> > > http://svn.digium.com/svn/asterisk/trunk/include/asterisk/causes.h > > =Stefan > |
From: Stefan R. <sr...@re...> - 2006-01-29 23:01:05
|
On Mon, 2006-01-30 at 06:19 +1100, Brett Sutton wrote: > I'm trying to find a list of values returned by the=20 > HangupEvent.getCause() method and their meanings. >=20 > Does anyone know where to find this information? http://svn.digium.com/svn/asterisk/trunk/include/asterisk/causes.h =3DStefan |
From: Brett S. <bs...@no...> - 2006-01-29 22:53:43
|
I'm trying to find a list of values returned by the HangupEvent.getCause() method and their meanings. Does anyone know where to find this information? Regards, Brett. |
From: Stefan R. <sr...@re...> - 2006-01-29 18:23:30
|
Try to replace=20 manager.sendEventGeneratingAction(action, 5000); by manager.sendAction(action, null); =3DStefan On Wed, 2006-01-25 at 18:02 +0100, Mattias Malmquist wrote: > Hi all! >=20 > =20 >=20 > I am currently using this simple class to monitor the queue. One > instance of this class is created once every one second (and hopefully > deleted after reaching end). >=20 > =20 >=20 > I am actually quite new at Java and thread programming so I realize > that there must be some better way to do this, but I hope this is > sufficient for the time being. >=20 > =20 >=20 > The problem (if it is a problem) I am experiencing at the moment is > that I receive one timeout every second, but it seems like I get all > the events generated by this action. >=20 > =20 >=20 > My question is this: Do I actually lose any information as I get these > timeouts or are there any other reasons for receiving them? >=20 > =20 >=20 > Never mind the horrors of my code. I just created this to get around > the deadlock I experienced when trying to send an action from the > event dispatching thread. =3D) >=20 > =20 >=20 > Thanks in advance! >=20 > =20 >=20 > // Mattias Malmquist >=20 > =20 >=20 >=20 > =20 >=20 > =20 >=20 > public class QueueStatusChecker extends Thread { >=20 > ManagerConnection manager; >=20 > EventGeneratingAction action; >=20 > =20 >=20 > public QueueStatusChecker(ManagerConnection > manager, ManagerAction action) { >=20 > this.manager =3D manager; >=20 > this.action =3D > (EventGeneratingAction)action; >=20 > } >=20 > public void run() { >=20 > try { >=20 >=20 > manager.sendEventGeneratingAction(action, 5000); >=20 > } catch (Exception e) { >=20 >=20 > if(e.getClass().getSimpleName().equals("EventTimeoutException")) { >=20 >=20 > System.out.println("Timeout"); >=20 > } >=20 > } >=20 > } >=20 > } >=20 >=20 |
From: Stefan R. <sr...@re...> - 2006-01-29 18:20:10
|
Hi, the data for agents is sent via events instead of as a reponse so you must send your your AgentsAction via sendEventGeneratingAction(). Example: AgentsAction agentsAction =3D new AgentsAction(); ResponseEvents responseEvents =3D=20 c.sendEventGeneratingAction(agentsAction, 30000); =20 for (ManagerEvent event :=20 (Collection<ManagerEvent>) responseEvents.getEvents()) { if (event instanceof AgentsEvent) { AgentsEvent agent =3D (AgentsEvent) event; System.out.println("Agent " + agent.getAgent() + ": " + agent.getStatus()); } } Hope that helps, Stefan On Wed, 2006-01-25 at 21:04 -0500, Yelson Vivas wrote: > HI Guys > I'm new in asterisk-java so sorry for the silly question. > I just wanna know the agents status in my pbx, but i don't know how to > get the info, the program connects fine to the pbx, but when i try to > read the data y don't know how, can you give me a hand?? > this is my code > -------------------------------------------------------------------------= ------------------------- > class definitions > -------------------------- > AgentsAction agac =3D new AgentsAction(); > Map datos ; > Collection datosp; > ---------------------------- > run method > ---------------------------- > ManagerResponse originateResponse; > managerConnection.login(); > originateResponse =3D managerConnection.sendAction(agac,4000); > System.out.println(originateResponse.getResponse()); > System.out.println(originateResponse.getMessage()); > System.out.println(originateResponse.toString()); > datos =3D originateResponse.getAttributes(); > datosp =3D datos.values(); > Iterator iter =3D datosp.iterator(); > while (iter.hasNext()){ > String agente =3D (String)iter.next(); > System.out.println("the data is '" + agente + "'"); > } > managerConnection.logoff(); >=20 > -------------------------------------------------------------------------= ------------------------- > The program shows this > -------------------------------------------------------------------------= ------------------------- >=20 > Jan 25, 2006 8:51:09 PM net.sf.asterisk.util.impl.JavaLoggingLog info > INFO: Connecting to 192.168.222.22 port 5038 > Jan 25, 2006 8:51:09 PM net.sf.asterisk.util.impl.JavaLoggingLog info > INFO: Connected via Asterisk Call Manager/1.0 > Jan 25, 2006 8:51:09 PM net.sf.asterisk.util.impl.JavaLoggingLog info > INFO: Successfully logged in > Jan 25, 2006 8:51:09 PM net.sf.asterisk.util.impl.JavaLoggingLog info > INFO: Determined Asterisk version: Asterisk 1.0 > Success > Agents will follow > net.sf.asterisk.manager.response.ManagerResponse: actionId=3D'null'; > message=3D'Agents will follow'; response=3D'Success'; uniqueId=3D'null'; > systemHashcode=3D1012673 > the data is '12014584_3#' > the data is 'Agents will follow' > the data is 'Success' > Jan 25, 2006 8:51:09 PM net.sf.asterisk.util.impl.JavaLoggingLog info > INFO: Reached end of stream, terminating reader. > Jan 25, 2006 8:51:09 PM net.sf.asterisk.util.impl.JavaLoggingLog info > INFO: Closing socket. > -------------------------------------------------------------------------= ------------------------------ > In other words how can i read the Map that should show me the agents stat= us??? > Thanks in advance > Best Regards > Yelson >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=103432&bid#0486&dat=121642 > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
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 |
From: Anthony M. <to...@am...> - 2006-01-29 10:45:05
|
I just wanted to send a thank you to the developers for this group. You've done a nice job. I was able to build and use the asterisk-java API to do something very neat things with my PBX within a very short time. Thanks Tony Mowers |