Thread: [Asterisk-java-users] Problem with some commands and manager
Brought to you by:
srt
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: 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 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 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: <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: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: <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: 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: 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: Stefan R. <sr...@re...> - 2006-02-22 20:44:46
Attachments:
signature.asc
|
> 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. yep or you could send a userevent with the relevant data and look for that. |