asterisk-java-users Mailing List for Asterisk-Java Library (Page 157)
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: Darren H. <dha...@gh...> - 2006-02-22 19:05:24
|
Hi Liam, I would recommend getting an IDE if you plan on working in Java for a while ;-) =20 Eclipse & NetBeans are full-featured free ones, while simple free ones like BlueJ also work. =20 For commandline, try 'javac HelloAGIScript.java -classpath asterisk-java.jar' =20 Hope that helps get you started! =20 =20 p.s. I use Eclipse as my IDE, and you'll find errors like 'unable to find package' can be identified quickly as Eclipse does on-the-fly compilation of your code to more readily identify problems. =20 -D |
From: Liam O'H. <lia...@gm...> - 2006-02-22 18:57:46
|
Hi all, Firstly, apologies for the very basic nature of this question. Although a developer of many years, my exposure to Java has been extremely limited. I have many years IVR experience and I have been using Asterisk at home for the last year. As such, if I can be helped over this initial hurdle I believe I'll be able to stand on my own. I have Sun's j2sdk1.4.2_09 on Centos 4 and am having difficulties getting HelloAGIScript compiled. After much Googling I discovered that I needed to set my CLASSPATH. I set i= t to the java bin path and the directory containing asterisk-java.jar. This reduced the number of errors but I am unable to get beyond the next problem= . As per the tutorial I changed AbstractAGIScript to BaseAGIScript ( HelloAGIScript.java attached at end of post). The compile command in the tutorial is "javac -cp asterisk-java.jar HelloAGIScript.java" but, from my reading of the javac documentation at java.sun.com the -c and -p options don't appear to be valid options. The compile command I'm using is "javac -sourcepath asterisk-java.jar HelloAGIScript.java" and I'm getting the following errors: HelloAGIScript.java:12: answer() in net.sf.asterisk.fastagi.BaseAGIScriptcannot be applied to ( net.sf.asterisk.fastagi.AGIChannel) answer(channel); ^ HelloAGIScript.java:15: cannot resolve symbol symbol : method streamFile (net.sf.asterisk.fastagi.AGIChannel, java.lang.String) location: class HelloAGIScript streamFile(channel, "welcome"); ^ HelloAGIScript.java:18: hangup() in net.sf.asterisk.fastagi.BaseAGIScriptcannot be applied to ( net.sf.asterisk.fastagi.AGIChannel) hangup(channel); I do realise that this is more of a Java beginner's question than an Asterisk-Java question so I'd be most grateful for any assistance. Any and all suggestions and/or URLs would be great. Regards, Liam HelloAGIScript.java ---------------------------- import net.sf.asterisk.fastagi.AGIChannel; import net.sf.asterisk.fastagi.AGIException; import net.sf.asterisk.fastagi.AGIRequest; import net.sf.asterisk.fastagi.BaseAGIScript; public class HelloAGIScript extends BaseAGIScript { public void service(AGIRequest request, AGIChannel channel) throws AGIException { // Answer the channel... answer(channel); // ...say hello... streamFile(channel, "welcome"); // ...and hangup. hangup(channel); } } |
From: Jason W. <jas...@be...> - 2006-02-22 14:15:28
|
Maria, If you truly want to use Manager only, then you should probably set variables in the extension and then send a getvar action from manager api when there is an extension event that sets the variable. jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of María Chóliz Sent: Wednesday, February 22, 2006 4:31 AM To: ast...@li... Subject: Re: [Asterisk-java-users] Problem with some commands and manager Yes, but I want to know how can I know from Manager-Java ( not Fast AGI) , from Java code, what System returned after excuting in the dial plan. Thanks, |
From: Brett S. <bs...@no...> - 2006-02-22 10:45:05
|
I've actually combined the manager api and fast agi in a single=20 application to determine return codes. The manager api originates a call which makes a fast agi call back to=20 the application. The application then executes the application and=20 returns the results back to the manager api. Works like a treat. If you download the AsterFax source (asterfax.sourceforge.net) and have=20 a look at SubmitFax.java and CallTxFax. The code is still a bit rough=20 but it will give you the general idea. You will also need to look at=20 AgiMappingStragegy and AsterFax.java to see how I've got the fast agi=20 stuff all hanging together in a single application. Regards, Brett. Mar=EDa Ch=F3liz wrote: > Yes, but I want to know how can I know from Manager-Java ( not Fast=20 > AGI) , from Java code, what System returned after excuting in the dial=20 > plan. > > Thanks, |
From: <mar...@gm...> - 2006-02-22 09:30:53
|
Yes, but I want to know how can I know from Manager-Java ( not Fast AGI) , from Java code, what System returned after excuting in the dial plan. Thanks, |
From: Darren H. <dha...@gh...> - 2006-02-21 17:24:05
|
fixed - nothing to do with the library, the softphone wasn't registered with the server (could call out, but not call too). =20 Thanks, I will definately used the information you provided for future debugging :-) =20 -D ________________________________ From: ast...@li... [mailto:ast...@li...] On Behalf Of Jason Wolfe Sent: Tuesday, February 21, 2006 11:58 AM To: ast...@li... Subject: RE: [Asterisk-java-users] Manager.originateAction tutorial and 'error' =09 =09 I always recomend the following to new users, it's very helpful in the learning curve. =20 =09 this is cut from a previous post****************************************************** =20 I did a couple of things to make sure I was making the most of events... You might find it useful to try the following... =20 1. Use a program like Ethereal to sniff packets being recieved by your server running Manager. This way you see exactly what you're getting. You can filter to only show packets from the asterisk machine, and then you can do a test of the situation that you want to capture and see if asterisk is telling you what you need. 2. Look into 'user defined events' http://www.voip-info.org/wiki/view/Asterisk+cmd+UserEvent 3. grep on the entire asterisk directory for the currently generated events, I'm sure what your looking for would be in in channel.c if it exists, or trust the list at http://www.voip-info.org/wiki/view/asterisk+manager+events 4. if you look at the source for asterisk, you'll see that it's not hard to add events right in the source code and recompile if it's mission critical. 5. as well, Stefan did a great job of laying out Asterisk-java, so you could download the source and add a class for your handler if you create one. =20 =09 ************************************************************************ * use System.out.println(originateResponse.toString()); // to see the entire list sent back by asterisk =20 having said that, and taking a look at your code, I don't see an obvious problem, so I recomend the following... backup and divide the problem into smaller steps...=20 1. Are you able to use the dial() applicaiton successfully in the extensions.conf file? if so move to step 2 2. don't dial directly into an app if it's not necessary... dial into an extension, then execute the app, this way Asterisk creates the default CDR's. 3. start asterisk with 'asterisk -cvvvvvvvvvv' (10 v's or so) then check out what it's reporting when you run the java app. 4. check out the asterisk log files. =20 Jason Wolfe, CTO Click For A Call, Inc. ja...@cl... c (770) 561-6956 =09 This e-mail transmission may contain information that is proprietary, privileged and/or confidential and is intended exclusively for the person(s) to whom it is addressed. Any use, copying, retention or disclosure by any person other than the intended recipient or the intended recipient's designees is strictly prohibited. If you are not the intended recipient or their designee, please notify the sender immediately by return e-mail and delete all copies. -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of Darren Hartford Sent: Tuesday, February 21, 2006 11:26 AM To: ast...@li... Subject: RE: [Asterisk-java-users] Manager.originateAction tutorial and 'error' =09 =09 Thanks Jason! It's not that different from http://asterisk-java.sourceforge.net/tutorial.html, just more sysouts to verify assumptions and trying setApplication/setData versions from a previous thread on the mailing list. The phones are SIP softphones (x-lite) if that makes a difference (and they are calling back and forth fine). =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3Dcode from run() = =3D=3D=3D=3D=3D=3D=3D=3D OriginateAction originateAction; ManagerResponse originateResponse; =20 originateAction =3D new OriginateAction(); originateAction.setChannel("SIP/201"); //my phone =09 /* * Below are various attempts to make the call */ =20 originateAction.setApplication("Dial"); originateAction.setData("SIP/200"); // originateAction.setData("200"); =20 =20 // originateAction.setContext("default"); // originateAction.setContext("external"); // originateAction.setExten("SIP/200"); // originateAction.setExten("200"); =20 originateAction.setPriority(new Integer(1)); =09 originateAction.setActionId("originateActionCallfromManagerAPI"); =09 // connect to Asterisk and log in System.out.println("logging in"); managerConnection.login(); System.out.println("connected. Attempting action"); =20 //verify for testing AsteriskServer as =3D managerConnection.getAsteriskServer(); managerConnection.sendAction(new StatusAction()); //this seems to be fine System.out.println(as.getHostname()); =20 // send the originate action and wait for a maximum of 30 seconds for Asterisk // to send a reply originateResponse =3D managerConnection.sendAction(originateAction, 30000); =20 // print out whether the originate succeeded or not //here, response is always 'Error', the actionId is the actionId above, and uniqueId is null System.out.println("The actionId is: " + originateResponse.getActionId()); System.out.println("The response Status is: " + originateResponse.getResponse()); System.out.println("The uniqueID is: " + originateResponse.getUniqueId()); =09 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3Dend code from run() = =3D=3D=3D=3D=3D=3D=3D=3D ________________________________ From: ast...@li... [mailto:ast...@li...] On Behalf Of Jason Wolfe Sent: Tuesday, February 21, 2006 11:14 AM To: ast...@li... Subject: RE: [Asterisk-java-users] Manager.originateAction tutorial and 'error' =09 =09 please post the relevant code and I'll try to help you out. =20 Jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of Darren Hartford Sent: Tuesday, February 21, 2006 10:57 AM To: ast...@li... Subject: [Asterisk-java-users] Manager.originateAction tutorial and 'error' =09 =09 Hey all,=20 N00b trying to learn this. Running Asterisk 1.2 and using binary lib distribution of asterisk-java-0.2.=20 Following the Tutorial, I've used the HelloManager class to connect to the server (and I can get the AsteriskServer and verify that information is correct). When I try to use the example to originate a call from my SIP/201 to a default Context/local 200 extension (or the setApp/SetData SIP/200 way from the mailing list), I keep getting back in the originateResponse.getResponse of 'Error'. Unfortunately, not very helpful in learning where the problem is. How should I debug to figure out what I should correct? Just trying to follow the tutorial to originate a call. Thanks,=20 -D=20 |
From: Jason W. <jas...@be...> - 2006-02-21 16:58:28
|
Manager.originateAction tutorial and 'error'I always recomend the following to new users, it's very helpful in the learning curve. this is cut from a previous post****************************************************** I did a couple of things to make sure I was making the most of events... You might find it useful to try the following... 1. Use a program like Ethereal to sniff packets being recieved by your server running Manager. This way you see exactly what you're getting. You can filter to only show packets from the asterisk machine, and then you can do a test of the situation that you want to capture and see if asterisk is telling you what you need. 2. Look into 'user defined events' http://www.voip-info.org/wiki/view/Asterisk+cmd+UserEvent 3. grep on the entire asterisk directory for the currently generated events, I'm sure what your looking for would be in in channel.c if it exists, or trust the list at http://www.voip-info.org/wiki/view/asterisk+manager+events 4. if you look at the source for asterisk, you'll see that it's not hard to add events right in the source code and recompile if it's mission critical. 5. as well, Stefan did a great job of laying out Asterisk-java, so you could download the source and add a class for your handler if you create one. ************************************************************************* use System.out.println(originateResponse.toString()); // to see the entire list sent back by asterisk having said that, and taking a look at your code, I don't see an obvious problem, so I recomend the following... backup and divide the problem into smaller steps... 1. Are you able to use the dial() applicaiton successfully in the extensions.conf file? if so move to step 2 2. don't dial directly into an app if it's not necessary... dial into an extension, then execute the app, this way Asterisk creates the default CDR's. 3. start asterisk with 'asterisk -cvvvvvvvvvv' (10 v's or so) then check out what it's reporting when you run the java app. 4. check out the asterisk log files. Jason Wolfe, CTO Click For A Call, Inc. ja...@cl... c (770) 561-6956 This e-mail transmission may contain information that is proprietary, privileged and/or confidential and is intended exclusively for the person(s) to whom it is addressed. Any use, copying, retention or disclosure by any person other than the intended recipient or the intended recipient's designees is strictly prohibited. If you are not the intended recipient or their designee, please notify the sender immediately by return e-mail and delete all copies. -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of Darren Hartford Sent: Tuesday, February 21, 2006 11:26 AM To: ast...@li... Subject: RE: [Asterisk-java-users] Manager.originateAction tutorial and 'error' Thanks Jason! It's not that different from http://asterisk-java.sourceforge.net/tutorial.html, just more sysouts to verify assumptions and trying setApplication/setData versions from a previous thread on the mailing list. The phones are SIP softphones (x-lite) if that makes a difference (and they are calling back and forth fine). ============code from run() ======== OriginateAction originateAction; ManagerResponse originateResponse; originateAction = new OriginateAction(); originateAction.setChannel("SIP/201"); //my phone /* * Below are various attempts to make the call */ originateAction.setApplication("Dial"); originateAction.setData("SIP/200"); // originateAction.setData("200"); // originateAction.setContext("default"); // originateAction.setContext("external"); // originateAction.setExten("SIP/200"); // originateAction.setExten("200"); originateAction.setPriority(new Integer(1)); originateAction.setActionId("originateActionCallfromManagerAPI"); // connect to Asterisk and log in System.out.println("logging in"); managerConnection.login(); System.out.println("connected. Attempting action"); //verify for testing AsteriskServer as = managerConnection.getAsteriskServer(); managerConnection.sendAction(new StatusAction()); //this seems to be fine System.out.println(as.getHostname()); // send the originate action and wait for a maximum of 30 seconds for Asterisk // to send a reply originateResponse = managerConnection.sendAction(originateAction, 30000); // print out whether the originate succeeded or not //here, response is always 'Error', the actionId is the actionId above, and uniqueId is null System.out.println("The actionId is: " + originateResponse.getActionId()); System.out.println("The response Status is: " + originateResponse.getResponse()); System.out.println("The uniqueID is: " + originateResponse.getUniqueId()); ============end code from run() ======== ---------------------------------------------------------------------------- From: ast...@li... [mailto:ast...@li...] On Behalf Of Jason Wolfe Sent: Tuesday, February 21, 2006 11:14 AM To: ast...@li... Subject: RE: [Asterisk-java-users] Manager.originateAction tutorial and 'error' please post the relevant code and I'll try to help you out. Jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of Darren Hartford Sent: Tuesday, February 21, 2006 10:57 AM To: ast...@li... Subject: [Asterisk-java-users] Manager.originateAction tutorial and 'error' Hey all, N00b trying to learn this. Running Asterisk 1.2 and using binary lib distribution of asterisk-java-0.2. Following the Tutorial, I've used the HelloManager class to connect to the server (and I can get the AsteriskServer and verify that information is correct). When I try to use the example to originate a call from my SIP/201 to a default Context/local 200 extension (or the setApp/SetData SIP/200 way from the mailing list), I keep getting back in the originateResponse.getResponse of 'Error'. Unfortunately, not very helpful in learning where the problem is. How should I debug to figure out what I should correct? Just trying to follow the tutorial to originate a call. Thanks, -D |
From: Jason W. <jas...@be...> - 2006-02-21 16:40:37
|
check the app_system.c file, but off the top of my head, I think it returns whatever the system call returns, i.e. if you do fileexists, it returns false if there is no file. -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of María Chóliz Sent: Tuesday, February 21, 2006 11:21 AM To: ast...@li... Subject: Re: [Asterisk-java-users] Problem with some commands and manager OK, but How can I know what System returned??? Thanks in advance, María 2006/2/21, Jason Wolfe <jas...@be...>: Using festival in that way is a bad idea because a keypress will interrupt the stream. As well, you have no way of knowing if it worked. I'd use system to call festival to write a wav file, then use system to verify that the file was created, maybe even checking file size, then use background to play it back. Jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of María Chóliz Sent: Tuesday, February 21, 2006 10:02 AM To: ast...@li... Subject: Re: [Asterisk-java-users] Problem with some commands and manager Thanks for your help. I have checked out the tutorial and checked the application, at this time my dial plan looks like: exten => s,9,System(/usr/bin/festival 'Hello World') but how can i know if the 'System' command failed ??? Thanks in advance, 2006/2/21, Jason Wolfe <jas...@be...>: Use the system() command to see if the file exists. something like... exten => s,9,System(/var/lib/asterisk/sounds/filexists /var/lib/asterisk/sounds/${myPlaybackFile}?.gsm) check out the usage in this tutorial... http://www.voip-info.org/wiki-Asterisk+tips+ivr+menu jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of María Chóliz Sent: Tuesday, February 21, 2006 2:50 AM To: ast...@li... Subject: [Asterisk-java-users] Problem with some commands and manager Hello, I have a question. I am working with the Java-Manager. In my dialplan I use the Playback(....) command but I don't know how to get from the Java code if it didn't work. I mean, how can know if the file I am telling Asterisk to play does not exist, for example???or the format is not right??? Is there any event I can capture?I haven`t found any. I don't know how to do this. Thanks in advance, María -- María -- María |
From: Darren H. <dha...@gh...> - 2006-02-21 16:26:27
|
Thanks Jason! It's not that different from http://asterisk-java.sourceforge.net/tutorial.html, just more sysouts to verify assumptions and trying setApplication/setData versions from a previous thread on the mailing list. The phones are SIP softphones (x-lite) if that makes a difference (and they are calling back and forth fine). =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3Dcode from run() = =3D=3D=3D=3D=3D=3D=3D=3D OriginateAction originateAction; ManagerResponse originateResponse; =20 originateAction =3D new OriginateAction(); originateAction.setChannel("SIP/201"); //my phone /* * Below are various attempts to make the call */ =20 originateAction.setApplication("Dial"); originateAction.setData("SIP/200"); // originateAction.setData("200"); =20 =20 // originateAction.setContext("default"); // originateAction.setContext("external"); // originateAction.setExten("SIP/200"); // originateAction.setExten("200"); =20 originateAction.setPriority(new Integer(1)); =20 originateAction.setActionId("originateActionCallfromManagerAPI"); // connect to Asterisk and log in System.out.println("logging in"); managerConnection.login(); System.out.println("connected. Attempting action"); =20 //verify for testing AsteriskServer as =3D managerConnection.getAsteriskServer(); managerConnection.sendAction(new StatusAction()); //this seems to be fine System.out.println(as.getHostname()); =20 // send the originate action and wait for a maximum of 30 seconds for Asterisk // to send a reply originateResponse =3D managerConnection.sendAction(originateAction, 30000); =20 // print out whether the originate succeeded or not //here, response is always 'Error', the actionId is the actionId above, and uniqueId is null System.out.println("The actionId is: " + originateResponse.getActionId()); System.out.println("The response Status is: " + originateResponse.getResponse()); System.out.println("The uniqueID is: " + originateResponse.getUniqueId()); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3Dend code from run() = =3D=3D=3D=3D=3D=3D=3D=3D ________________________________ From: ast...@li... [mailto:ast...@li...] On Behalf Of Jason Wolfe Sent: Tuesday, February 21, 2006 11:14 AM To: ast...@li... Subject: RE: [Asterisk-java-users] Manager.originateAction tutorial and 'error' =09 =09 please post the relevant code and I'll try to help you out. =20 Jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of Darren Hartford Sent: Tuesday, February 21, 2006 10:57 AM To: ast...@li... Subject: [Asterisk-java-users] Manager.originateAction tutorial and 'error' =09 =09 Hey all,=20 N00b trying to learn this. Running Asterisk 1.2 and using binary lib distribution of asterisk-java-0.2.=20 Following the Tutorial, I've used the HelloManager class to connect to the server (and I can get the AsteriskServer and verify that information is correct). When I try to use the example to originate a call from my SIP/201 to a default Context/local 200 extension (or the setApp/SetData SIP/200 way from the mailing list), I keep getting back in the originateResponse.getResponse of 'Error'. Unfortunately, not very helpful in learning where the problem is. How should I debug to figure out what I should correct? Just trying to follow the tutorial to originate a call.=20 Thanks,=20 -D=20 |
From: <mar...@gm...> - 2006-02-21 16:21:12
|
OK, but How can I know what System returned??? Thanks in advance, Mar=EDa 2006/2/21, Jason Wolfe <jas...@be...>: > > Using festival in that way is a bad idea because a keypress will interrup= t > the stream. As well, you have no way of knowing if it worked. > > I'd use system to call festival to write a wav file, then use system to > verify that the file was created, maybe even checking file size, then use > background to play it back. > > > Jason > > -----Original Message----- > *From:* ast...@li... [mailto: > ast...@li...]*On Behalf Of *Mar=EDa > Ch=F3liz > *Sent:* Tuesday, February 21, 2006 10:02 AM > *To:* ast...@li... > *Subject:* Re: [Asterisk-java-users] Problem with some commands and > manager > > Thanks for your help. > > I have checked out the tutorial and checked the application, > > at this time my dial plan looks like: > > exten =3D> s,9,System(/usr/bin/festival 'Hello World') > > but how can i know if the 'System' command failed ??? > > Thanks in advance, > > > > 2006/2/21, Jason Wolfe <jas...@be...>: > > > > Use the system() command to see if the file exists. > > > > something like... > > exten =3D> s,9,System(/var/lib/asterisk/sounds/filexists > > /var/lib/asterisk/sounds/${myPlaybackFile}?.gsm) > > > > check out the usage in this tutorial... > > > > http://www.voip-info.org/wiki-Asterisk+tips+ivr+menu > > > > jason > > > > -----Original Message----- > > *From:* ast...@li... [mailto: > > ast...@li...]*On Behalf Of *Mar=EDa > > Ch=F3liz > > *Sent:* Tuesday, February 21, 2006 2:50 AM > > *To:* ast...@li... > > *Subject:* [Asterisk-java-users] Problem with some commands and manager > > > > Hello, > > > > I have a question. > > I am working with the Java-Manager. In my dialplan I use the > > Playback(....) command but I don't know how to get from the Java code i= f it > > didn't work. I mean, how can know if the file I am telling Asterisk to= play > > does not exist, for example???or the format is not right??? > > > > Is there any event I can capture?I haven`t found any. > > I don't know how to do this. > > > > Thanks in advance, > > > > Mar=EDa > > > > > > > -- > Mar=EDa > > -- Mar=EDa |
From: Jason W. <jas...@be...> - 2006-02-21 16:15:07
|
Manager.originateAction tutorial and 'error'please post the relevant code and I'll try to help you out. Jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of Darren Hartford Sent: Tuesday, February 21, 2006 10:57 AM To: ast...@li... Subject: [Asterisk-java-users] Manager.originateAction tutorial and 'error' Hey all, N00b trying to learn this. Running Asterisk 1.2 and using binary lib distribution of asterisk-java-0.2. Following the Tutorial, I've used the HelloManager class to connect to the server (and I can get the AsteriskServer and verify that information is correct). When I try to use the example to originate a call from my SIP/201 to a default Context/local 200 extension (or the setApp/SetData SIP/200 way from the mailing list), I keep getting back in the originateResponse.getResponse of 'Error'. Unfortunately, not very helpful in learning where the problem is. How should I debug to figure out what I should correct? Just trying to follow the tutorial to originate a call. Thanks, -D |
From: Jason W. <jas...@be...> - 2006-02-21 16:13:51
|
Using festival in that way is a bad idea because a keypress will interrupt the stream. As well, you have no way of knowing if it worked. I'd use system to call festival to write a wav file, then use system to verify that the file was created, maybe even checking file size, then use background to play it back. Jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of María Chóliz Sent: Tuesday, February 21, 2006 10:02 AM To: ast...@li... Subject: Re: [Asterisk-java-users] Problem with some commands and manager Thanks for your help. I have checked out the tutorial and checked the application, at this time my dial plan looks like: exten => s,9,System(/usr/bin/festival 'Hello World') but how can i know if the 'System' command failed ??? Thanks in advance, 2006/2/21, Jason Wolfe <jas...@be...>: Use the system() command to see if the file exists. something like... exten => s,9,System(/var/lib/asterisk/sounds/filexists /var/lib/asterisk/sounds/${myPlaybackFile}?.gsm) check out the usage in this tutorial... http://www.voip-info.org/wiki-Asterisk+tips+ivr+menu jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of María Chóliz Sent: Tuesday, February 21, 2006 2:50 AM To: ast...@li... Subject: [Asterisk-java-users] Problem with some commands and manager Hello, I have a question. I am working with the Java-Manager. In my dialplan I use the Playback(....) command but I don't know how to get from the Java code if it didn't work. I mean, how can know if the file I am telling Asterisk to play does not exist, for example???or the format is not right??? Is there any event I can capture?I haven`t found any. I don't know how to do this. Thanks in advance, María -- María |
From: Darren H. <dha...@gh...> - 2006-02-21 15:56:44
|
Hey all, N00b trying to learn this. Running Asterisk 1.2 and using binary lib distribution of asterisk-java-0.2. Following the Tutorial, I've used the HelloManager class to connect to the server (and I can get the AsteriskServer and verify that information is correct). When I try to use the example to originate a call from my SIP/201 to a default Context/local 200 extension (or the setApp/SetData SIP/200 way from the mailing list), I keep getting back in the originateResponse.getResponse of 'Error'. Unfortunately, not very helpful in learning where the problem is. How should I debug to figure out what I should correct? Just trying to follow the tutorial to originate a call. Thanks, -D |
From: <mar...@gm...> - 2006-02-21 15:02:23
|
Thanks for your help. I have checked out the tutorial and checked the application, at this time my dial plan looks like: exten =3D> s,9,System(/usr/bin/festival 'Hello World') but how can i know if the 'System' command failed ??? Thanks in advance, 2006/2/21, Jason Wolfe <jas...@be...>: > > Use the system() command to see if the file exists. > > something like... > exten =3D> s,9,System(/var/lib/asterisk/sounds/filexists > /var/lib/asterisk/sounds/${myPlaybackFile}?.gsm) > > check out the usage in this tutorial... > > http://www.voip-info.org/wiki-Asterisk+tips+ivr+menu > > jason > > -----Original Message----- > *From:* ast...@li... [mailto: > ast...@li...]*On Behalf Of *Mar=EDa > Ch=F3liz > *Sent:* Tuesday, February 21, 2006 2:50 AM > *To:* ast...@li... > *Subject:* [Asterisk-java-users] Problem with some commands and manager > > Hello, > > I have a question. > I am working with the Java-Manager. In my dialplan I use the > Playback(....) command but I don't know how to get from the Java code if = it > didn't work. I mean, how can know if the file I am telling Asterisk to p= lay > does not exist, for example???or the format is not right??? > > Is there any event I can capture?I haven`t found any. > I don't know how to do this. > > Thanks in advance, > > Mar=EDa > > -- Mar=EDa |
From: Jason W. <jas...@be...> - 2006-02-21 13:08:31
|
Use the system() command to see if the file exists. something like... exten => s,9,System(/var/lib/asterisk/sounds/filexists /var/lib/asterisk/sounds/${myPlaybackFile}?.gsm) check out the usage in this tutorial... http://www.voip-info.org/wiki-Asterisk+tips+ivr+menu jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of María Chóliz Sent: Tuesday, February 21, 2006 2:50 AM To: ast...@li... Subject: [Asterisk-java-users] Problem with some commands and manager Hello, I have a question. I am working with the Java-Manager. In my dialplan I use the Playback(....) command but I don't know how to get from the Java code if it didn't work. I mean, how can know if the file I am telling Asterisk to play does not exist, for example???or the format is not right??? Is there any event I can capture?I haven`t found any. I don't know how to do this. Thanks in advance, María |
From: <mar...@gm...> - 2006-02-21 07:50:13
|
Hello, I have a question. I am working with the Java-Manager. In my dialplan I use the Playback(....= ) command but I don't know how to get from the Java code if it didn't work. I mean, how can know if the file I am telling Asterisk to play does not exist, for example???or the format is not right??? Is there any event I can capture?I haven`t found any. I don't know how to do this. Thanks in advance, Mar=EDa |
From: g f <gf...@gm...> - 2006-02-17 19:05:40
|
Hello all, I have a question. In my application I send people to Conference rooms. I can then monitor the rooms by calling the CommandAction.setCommand("meetm= e list 8200"); Problem I am having is that when I join the users via OriginateAction I ge= t the following output when I call the meetme list 8200 command: This is before anyone is in the room (dont know why I get this, see my previous post) User #: 01 <unknown> sip/202 Channel: SIP/202-6b5f (unmonitored) 1 users in that conference. This is after I join someone to the conference (they are in by themselves) User #: 01 <unknown> sip/202 Channel: SIP/202-6b5f (unmonitored) User #: 02 <unknown> John Smith Channel: SIP/202-e588 (unmonitored) 2 users in that conference. This is the output if I dial from the phone to 8200 (omitting my application) User #: 01 <unknown> sip/202 Channel: SIP/202-6b5f (unmonitored) User #: 02 202 John Smith Channel: SIP/202-e588 (unmonitored) 2 users in that conference. So in my code that is returned from meetme list 8200 I search for <unknown> and if it contains this string I disregard. And then I grab the next string and parse it to return the User Name (in this case : John Smith)as long as it does not contain String <unknown>. As you can see, if the conferences are made through my app, all strings returned from meetme list 8200 are omitted (this displays no users in conference) cus they all contain a string <unknown> From what I understand this Variable with the value of <unknown> is called AMPUSER. So in my OriginateAction I try to do: Map map; map =3D new LinkedHashMap(); map.put("AMPUSER","ZZZ"); oAction =3D new OriginateAction(); oAction.setVariables(map); Still I get <unknown> Is it possible to set this to something other than <unknown> ? Perhaps I am going about this wrong? Any advice is greatly appreciated!! TIA!!! |
From: Brett S. <bs...@no...> - 2006-02-16 11:03:08
|
I've noted that the parameters to setPriority differ for a couple of classes. BaseAGIScript.setPriority(String) OriginateAction.setPriority(Integer) Regards, Brett. |
From: g f <gf...@gm...> - 2006-02-15 23:10:43
|
Hello all, I am trying to use *-Java to determine who is in each conference. Similar to the "meetme" command but with more detail. Any ideas? TIA! |
From: g f <gf...@gm...> - 2006-02-15 21:03:17
|
I figured it out using CommandAction but I still have a problem: public void getConferencees(String confNum)throws IOException, AuthenticationFailedException, TimeoutException { ManagerResponse mResponse; CommandAction commandAction =3D new CommandAction(); commandAction.setCommand("meetme list 8200"); if(!managerConnection.isConnected()) { managerConnection.login(); } mResponse =3D managerConnection.sendAction(commandAction,30000); managerConnection.logoff(); CommandResponse response =3D (CommandResponse)mResponse; List list =3D response.getResult(); for (Iterator it =3D list.iterator(); it.hasNext ();) { String s =3D (String) it.next(); System.out.println("STRING=3D"+s); } } I get the following output on System.out: STRING=3DUser #: 03 202 device Channel: SIP/202-7924 (Admin) (unmonitored)INFO: Connected via Asterisk Call Manager/1.0 STRING=3DUser #: 05 202 Graham F Channel: SIP/202-d58a (unmonitored)Feb 16, 2006 2:29:10 PM net.sf.asterisk.util.impl.JavaLoggingLog info STRING=3D2 users in that conference. Now I can parse these strings to get the User name , but I was wondering if there was an easier way to return just the user name? TIA! On 2/15/06, g f <gf...@gm...> wrote: > > Hello all, > I am trying to use *-Java to determine who is in each conference. > Similar to the "meetme" command but with more detail. > Any ideas? > TIA! > |
From: <mt...@st...> - 2006-02-15 18:31:23
|
Hi! My task is to write "switchboard" application for Asterisk. The user must be able to answer an incoming call from "outside" and then divert it to proper extension. As I am a completly newbie to Asterisk I have several problems with it (I know it's quite a long list and some of them might be dumb questions, so please be merciful :-) - I really didn't find out how to do it). 1) I need to get a list of all connected phones(we use SIP and IAX2 phones) and their states 2) The same thing but with ZAP channels 3) Is it possible to bind a new created object of Channel with some (IAX2 or SIP) peer? 4) Our Asterisk admin did a configuration with Asterisk Management Portal. I noticed that structure of database is different from the structure mention on http://www.voip-info.org/tiki-index.php?page=Asterisk+database. Is it possible to get a cidname of Extension without using database? If not, where can I find how is database structured? Thanks for any help! Martin |
From: Andre L. M. R. <and...@gm...> - 2006-02-15 13:32:28
|
Recently I sent some and-mails with problem in the event meetme. I uncovered that in wrong fact be doing. It should use a RedirectAction and not OriginateAction. However when I do the code it follow appears the error: AsteriskResponse: net.sf.asterisk.manager.response.ManagerError: actionId=3D'null'; message=3D'Secondary redirect failed'; response=3D'Error= '; uniqueId=3D'null'; systemHashcode=3D21657019 RedirectAction redirectAction; redirectAction =3D new RedirectAction(); redirectAction.setChannel(Zap/1-1); redirectAction.setContext("default"); redirectAction.setExten(8200); redirectAction.setPriority(new Integer(1)); redirectAction.setExtraChannel("MeetMe"); try{ ManagerResponse originateResponse; originateResponse =3D managerConnection.sendAction(redirectActi= on, 30000); System.out.println("AsteriskResponse: " + originateResponse.toString()); } .......... Someone knows say me the because of the error? What I am doing of wrong? -- []s Andr=E9 Luiz Martins Rodrigues mailto:and...@gm... |
From: Jason W. <jas...@be...> - 2006-02-14 16:40:32
|
OriginateAction has a precise definition and an exact function. I don't know how you are defining 'initiated', but I want to be helpful so I am trying to clarify. Ringing is a line 'state', 'user picks up the phone' (called answered) is another, completely different state. sending an originate action (a data structure) has nothing to do with the line state. For your program to know the line state after an originate action is parsed by asterisk you will need to parse an event objects that contains the line state. You may be able to send a 'status' action that will cause a status event, and parse this event to find the channel state and do something with that info. I hope you are finding this helpful. -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of Arnd Vehling Sent: Tuesday, February 14, 2006 11:01 AM To: ast...@li... Subject: Re: [Asterisk-java-users] originate call without picking up the fone?! Hi Jason, Jason Wolfe wrote: > In my testing, when I send an originate action, asterisk returns a > response=error immediately when the line is busy AFAIK the call isnt initiated before the fone rings and the user picks up the fone?! At least not when using the java API class OriginateAction?! > and a response=success as > soon as it starts riging. I think, from what you're saying, that your best > solution is to originate the first call, and if response=success, you can > originate a second call, and then put them both into a conference room on > answer. (put them into a conference room using extensions, not java actions) I already thought about initiating a call connecting to an App like conference or parkinglot. > Check out my earlier post about using Ethereal to view what communication is > happening at the TCP/IP level.... I always use "ngrep" for this and instructed my buddy whos the java programmer to use it too. Thx for the advise though. best regards, Arnd ------------------------------------------------------- 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 |
From: Arnd V. <av...@ne...> - 2006-02-14 15:48:21
|
Hi Jason, Jason Wolfe wrote: > In my testing, when I send an originate action, asterisk returns a > response=error immediately when the line is busy AFAIK the call isnt initiated before the fone rings and the user picks up the fone?! At least not when using the java API class OriginateAction?! > and a response=success as > soon as it starts riging. I think, from what you're saying, that your best > solution is to originate the first call, and if response=success, you can > originate a second call, and then put them both into a conference room on > answer. (put them into a conference room using extensions, not java actions) I already thought about initiating a call connecting to an App like conference or parkinglot. > Check out my earlier post about using Ethereal to view what communication is > happening at the TCP/IP level.... I always use "ngrep" for this and instructed my buddy whos the java programmer to use it too. Thx for the advise though. best regards, Arnd |
From: Jason W. <jas...@be...> - 2006-02-14 15:39:14
|
In my testing, when I send an originate action, asterisk returns a response=error immediately when the line is busy and a response=success as soon as it starts riging. I think, from what you're saying, that your best solution is to originate the first call, and if response=success, you can originate a second call, and then put them both into a conference room on answer. (put them into a conference room using extensions, not java actions) also, the consise list of java actions is listed at: http://asterisk-java.sourceforge.net/apidocs/index.html Check out my earlier post about using Ethereal to view what communication is happening at the TCP/IP level.... John, I did a couple of things to make sure I was making the most of events... You might find it useful to try the following... 1. Use a program like Ethereal to sniff packets being recieved by your server running Manager. This way you see exactly what you're getting. You can filter to only show packets from the asterisk machine, and then you can do a test of the situation that you want to capture and see if asterisk is telling you what you need. 2. Look into 'user defined events' http://www.voip-info.org/wiki/view/Asterisk+cmd+UserEvent 3. grep on the entire asterisk directory for the currently generated events, I'm sure what your looking for would be in in channel.c if it exists, or trust the list at http://www.voip-info.org/wiki/view/asterisk+manager+events 4. if you look at the source for asterisk, you'll see that it's not hard to add events right in the source code and recompile if it's mission critical. 5. as well, Stefan did a great job of laying out Asterisk-java, so you could download the source and add a class for your handler if you create one. Hope this helps. Jason -----Original Message----- From: ast...@li... [mailto:ast...@li...]On Behalf Of Arnd Vehling Sent: Tuesday, February 14, 2006 9:06 AM To: ast...@li... Subject: Re: [Asterisk-java-users] originate call without picking up the fone?! Hell Jason, thx for the reply! > Perhaps a little explanation will help you here as I think you might have a > slight misunderstanding of what is happening. > > When you 'originate' a call using the asterisk manager, you are sending an > 'originate action' request to the asterisk server, we are using the asterisk java 2.0 API and the "OriginateAction" Class to establish the call. I have to admit i am not the programmer but posting here on his behalf so i dont understand all the jave API centric concepts fully. Simple Question: Is is possible to solve the problem with existing java-classes or do we need to get down to protocol level and issue actions ourselves?! > It sounds like you want to originate call_A using originateAciton in > Manager, and then, if answered and not busy, use dial() in entensions to > connect to the end user, so when they pickup, they're already connected. We want either this or connect to the enduser when the "other side" is "ringing" and not "busy". We only want the user to pickup the fone if the other side is available or picking up. cheers, Arnd ------------------------------------------------------- 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 |