This list is closed, nobody may subscribe to it.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(13) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
|
2006 |
Jan
(6) |
Feb
|
Mar
(5) |
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
(1) |
Dec
|
2007 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
(25) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
(4) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Matthew N. <mni...@di...> - 2006-10-25 17:45:55
|
DomDom wrote: > Hello, > > I am new to Asterisk and relatively new to Python (I write some small > programs). > I am sorry that my questions may seem stupid to some but answers will > help me a lot. > > I would like to generate automatic calls from a python program (let's > call it myprog.py), play a sound file and retrieve the digit pressed by > the callee into the initial program (myprog.py). > I used the pyst package (through a small python programm that we can > call automatic.py) to test generation of calls with Originate and read > the sound file. It works well !! > Thanks to Michael Fletcher for his work. > > 1) Could somebody explain me what python function I can use to run the > automatic.py program from myprog.py ? > It seems that the os.exec function is not the good one. Right ? > I suppose that I will have to use sys.arg to pass the tel number from > myprog.py to automatic.py. You can just connect to the manager from your AGI script, no need to execute an external program. You could also execute an external program as well if you really feel you need to. > 2) How can I retrieve the digit pressed by the callee into myprog.py ? > Should I use the Read Asterisk function and how ? > I wonder if I have to run automatic.py in a thread from myprog.py. You would need to execute the Originate action passing 'context', 'exten', and 'priority' as arguments which would cause the originated call to begin execution at the specified context, exten, and priroity. At that location in the dialplan you would collect any digits pressed. If you wanted to relay that information back to your original script you could use the UserEvent application to generate a manager event. > 3) Just for info, I would like to understand the line ' variables = > {'WaitTime':'45'}, ' in the example provided by Michael in his site > http://blog.vrplumber.com/1274. That line will set the channel variable 'WaitTime' to the value '45' for the originated channel. The 'variables' parameter accepts a dictionary of name and value pairs to set as channel variables on the originated channel. -- Matthew Nicholson Digium |
From: DomDom <Bes...@ne...> - 2006-10-25 07:00:16
|
Hello, I am new to Asterisk and relatively new to Python (I write some small = programs). I am sorry that my questions may seem stupid to some but answers will = help me a lot. =20 I would like to generate automatic calls from a python program (let's = call it myprog.py), play a sound file and retrieve the digit pressed by = the callee into the initial program (myprog.py). I used the pyst package (through a small python programm that we can = call automatic.py) to test generation of calls with Originate and read = the sound file. It works well !! Thanks to Michael Fletcher for his work. 1) Could somebody explain me what python function I can use to run the = automatic.py program from myprog.py ? It seems that the os.exec function is not the good one. Right ? I suppose that I will have to use sys.arg to pass the tel number from = myprog.py to automatic.py. 2) How can I retrieve the digit pressed by the callee into myprog.py ? Should I use the Read Asterisk function and how ? I wonder if I have to run automatic.py in a thread from myprog.py. 3) Just for info, I would like to understand the line ' variables =3D = {'WaitTime':'45'}, ' in the example provided by Michael in his site = http://blog.vrplumber.com/1274. I would appreciate answers since I can't go forward. I will post a small tutorial once I manage to do what I want, to help = others like me. Thank you in advance Dominique |
From: Tristram G. <cal...@gm...> - 2006-04-20 00:38:21
|
Thanks and duh on behalf - now seems very obvious! Cheers, Tris ----- Original Message ----- From: "Matthew A. Nicholson" <mni...@di...> To: <pys...@li...> Sent: Wednesday, April 19, 2006 9:00 PM Subject: Re: [Pyst-users] Debug back to Asterisk console from AGI scripts > If you would like to print information to the asterisk console you can > use the agi.verbose() command. Also if you start asterisk in console > mode (-c) you can print to stderr and it will show up on the asterisk > console (sort of). > > A patch to asterisk redirect stderr back to the console in all cases > would be some what useful. > > Tristram Graham wrote: > > Hi all, > > > > First thanks for the great work. I've recently started using pyst for a > > new Asterisk project and found it works very well. > > > > A question please - I've been able to use the agitb debug module for > > catching error traces in my Asterisk console. But is it possible to send > > back the equivalent of "print"s with debug info or error messages if the > > dialplan incorrectly calls an AGI script? > > > > I find if I use straight Python "print" I get an exception; > > > > agi.py", line 146, in get_result" ... raise > > AGIInvalidCommand(response)" > > > > This seems fair enough if all text to the stdout are taken as commands. > > Writing to stderr doesn't appear in the Asterisk console. For now I'm > > using an Asterisk NoOp with "agi.execute('NoOp;, '### test debug > > message')" which isn't too bad but it does mean I have to have agi debug on. > > > > Un saludo, Tris > > -- > Matthew A. Nicholson > Digium > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users |
From: Matthew A. N. <mni...@di...> - 2006-04-20 00:00:17
|
If you would like to print information to the asterisk console you can use the agi.verbose() command. Also if you start asterisk in console mode (-c) you can print to stderr and it will show up on the asterisk console (sort of). A patch to asterisk redirect stderr back to the console in all cases would be some what useful. Tristram Graham wrote: > Hi all, > > First thanks for the great work. I've recently started using pyst for a > new Asterisk project and found it works very well. > > A question please - I've been able to use the agitb debug module for > catching error traces in my Asterisk console. But is it possible to send > back the equivalent of "print"s with debug info or error messages if the > dialplan incorrectly calls an AGI script? > > I find if I use straight Python "print" I get an exception; > > agi.py", line 146, in get_result" ... raise > AGIInvalidCommand(response)" > > This seems fair enough if all text to the stdout are taken as commands. > Writing to stderr doesn't appear in the Asterisk console. For now I'm > using an Asterisk NoOp with "agi.execute('NoOp;, '### test debug > message')" which isn't too bad but it does mean I have to have agi debug on. > > Un saludo, Tris -- Matthew A. Nicholson Digium |
From: Tristram G. <cal...@gm...> - 2006-04-19 19:11:00
|
Hi all, First thanks for the great work. I've recently started using pyst for a = new Asterisk project and found it works very well. A question please - I've been able to use the agitb debug module for = catching error traces in my Asterisk console. But is it possible to send = back the equivalent of "print"s with debug info or error messages if the = dialplan incorrectly calls an AGI script? I find if I use straight Python "print" I get an exception; agi.py", line 146, in get_result" ... raise = AGIInvalidCommand(response)" This seems fair enough if all text to the stdout are taken as commands. = Writing to stderr doesn't appear in the Asterisk console. For now I'm = using an Asterisk NoOp with "agi.execute('NoOp;, '### test debug = message')" which isn't too bad but it does mean I have to have agi debug = on. Un saludo, Tris |
From: FERNANDO V. <fvi...@ya...> - 2006-03-28 02:22:01
|
My problem was with a consultation SQL and not with verbose, luckyly already I have solved it. In any case thanks Matthew. --- "Matthew A. Nicholson" <mni...@di...> wrote: > You have new line characters '\n' in your verbose > commands, that is what > is causing your problems. If you split multiple > lines into multiple > verbose commands, that should solve your problem. > > FERNANDO VILLARROEL wrote: > > hello not as it is the reason, but verbose me this > > throwing the following error, I stick the error to > > them: > > > > COMMAND: VERBOSE "Mensaje Bienvenida Convenio > Call > > Me S.A." 1 > > prepagocard/prepagocard.py|100|8000: Mensaje > > Bienvenida Convenio Call Me S.A. > > RESULT_LINE: 200 result=1 > > RESULT_DICT: {'result': ('1', '')} > > COMMAND: STREAM FILE cc-bienvenida-defecto "" > 0 > > RESULT_LINE: 200 result=0 endpos=18880 > > RESULT_DICT: {'result': ('0', ''), 'endpos': > > ('18880', '')} > > COMMAND: GET DATA cc-ingrese-numero-tarjeta > 2000 > > 255 > > -- Playing 'cc-ingrese-numero-tarjeta' > (language > > 'en') > > RESULT_LINE: 200 result=124 (timeout) > > RESULT_DICT: {'result': ('124', 'timeout')} > > COMMAND: VERBOSE "ERROR: syntax error en o > cerca > > de "[" at character 73 > > " 1 > > prepagocard/prepagocard.py|100|8000: ERROR: > syntax > > error en o cerca de [ at character 73 > > RESULT_LINE: 200 result=1 > > RESULT_DICT: {'result': ('1', '')} > > COMMAND: VERBOSE "La Tarjeta esta en uso en > este > > momento se cancela ejecucion" 1 > > prepagocard/prepagocard.py|100|8000: La Tarjeta > esta > > en uso en este momento se cancela ejecucion > > RESULT_LINE: 510 Invalid or unknown command > > Traceback (most recent call last): > > File > > > "/var/lib/asterisk/agi-bin/prepagocard/prepagocard.py", > > line 219, in ? > > ag.verbose('La Tarjeta esta en uso en este > momento > > se cancela ejecucion') > > File > "/var/lib/asterisk/agi-bin/prepagocard/agi.py", > > line 548, in verbose > > self.execute('VERBOSE', self._quote(message), > > level) > > File > "/var/lib/asterisk/agi-bin/prepagocard/agi.py", > > line 102, in execute > > return self.get_result() > > File > "/var/lib/asterisk/agi-bin/prepagocard/agi.py", > > line 146, in get_result > > raise AGIInvalidCommand(response) > > agi.AGIInvalidCommand: Invalid or unknown command > > -- AGI Script prepagocard/prepagocard.py > > completed, returning 0 > > == Auto fallthrough, channel 'SIP/100-d17f' > status > > is 'UNKNOWN' > > > > > > Thanks you for its suggestions. > > > > Fernando Villarroel N. > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by xPML, a > groundbreaking scripting language > > that extends applications into web and mobile > media. Attend the live webcast > > and join the prime developer group breaking into > this new coding territory! > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > > _______________________________________________ > > Pyst-users mailing list > > Pys...@li... > > > https://lists.sourceforge.net/lists/listinfo/pyst-users > > -- > Matthew A. Nicholson > Digium > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a > groundbreaking scripting language > that extends applications into web and mobile media. > Attend the live webcast > and join the prime developer group breaking into > this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Matthew A. N. <mni...@di...> - 2006-03-28 00:43:35
|
You have new line characters '\n' in your verbose commands, that is what is causing your problems. If you split multiple lines into multiple verbose commands, that should solve your problem. FERNANDO VILLARROEL wrote: > hello not as it is the reason, but verbose me this > throwing the following error, I stick the error to > them: > > COMMAND: VERBOSE "Mensaje Bienvenida Convenio Call > Me S.A." 1 > prepagocard/prepagocard.py|100|8000: Mensaje > Bienvenida Convenio Call Me S.A. > RESULT_LINE: 200 result=1 > RESULT_DICT: {'result': ('1', '')} > COMMAND: STREAM FILE cc-bienvenida-defecto "" 0 > RESULT_LINE: 200 result=0 endpos=18880 > RESULT_DICT: {'result': ('0', ''), 'endpos': > ('18880', '')} > COMMAND: GET DATA cc-ingrese-numero-tarjeta 2000 > 255 > -- Playing 'cc-ingrese-numero-tarjeta' (language > 'en') > RESULT_LINE: 200 result=124 (timeout) > RESULT_DICT: {'result': ('124', 'timeout')} > COMMAND: VERBOSE "ERROR: syntax error en o cerca > de "[" at character 73 > " 1 > prepagocard/prepagocard.py|100|8000: ERROR: syntax > error en o cerca de [ at character 73 > RESULT_LINE: 200 result=1 > RESULT_DICT: {'result': ('1', '')} > COMMAND: VERBOSE "La Tarjeta esta en uso en este > momento se cancela ejecucion" 1 > prepagocard/prepagocard.py|100|8000: La Tarjeta esta > en uso en este momento se cancela ejecucion > RESULT_LINE: 510 Invalid or unknown command > Traceback (most recent call last): > File > "/var/lib/asterisk/agi-bin/prepagocard/prepagocard.py", > line 219, in ? > ag.verbose('La Tarjeta esta en uso en este momento > se cancela ejecucion') > File "/var/lib/asterisk/agi-bin/prepagocard/agi.py", > line 548, in verbose > self.execute('VERBOSE', self._quote(message), > level) > File "/var/lib/asterisk/agi-bin/prepagocard/agi.py", > line 102, in execute > return self.get_result() > File "/var/lib/asterisk/agi-bin/prepagocard/agi.py", > line 146, in get_result > raise AGIInvalidCommand(response) > agi.AGIInvalidCommand: Invalid or unknown command > -- AGI Script prepagocard/prepagocard.py > completed, returning 0 > == Auto fallthrough, channel 'SIP/100-d17f' status > is 'UNKNOWN' > > > Thanks you for its suggestions. > > Fernando Villarroel N. > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users -- Matthew A. Nicholson Digium |
From: FERNANDO V. <fvi...@ya...> - 2006-03-27 21:52:38
|
hello not as it is the reason, but verbose me this throwing the following error, I stick the error to them: COMMAND: VERBOSE "Mensaje Bienvenida Convenio Call Me S.A." 1 prepagocard/prepagocard.py|100|8000: Mensaje Bienvenida Convenio Call Me S.A. RESULT_LINE: 200 result=1 RESULT_DICT: {'result': ('1', '')} COMMAND: STREAM FILE cc-bienvenida-defecto "" 0 RESULT_LINE: 200 result=0 endpos=18880 RESULT_DICT: {'result': ('0', ''), 'endpos': ('18880', '')} COMMAND: GET DATA cc-ingrese-numero-tarjeta 2000 255 -- Playing 'cc-ingrese-numero-tarjeta' (language 'en') RESULT_LINE: 200 result=124 (timeout) RESULT_DICT: {'result': ('124', 'timeout')} COMMAND: VERBOSE "ERROR: syntax error en o cerca de "[" at character 73 " 1 prepagocard/prepagocard.py|100|8000: ERROR: syntax error en o cerca de [ at character 73 RESULT_LINE: 200 result=1 RESULT_DICT: {'result': ('1', '')} COMMAND: VERBOSE "La Tarjeta esta en uso en este momento se cancela ejecucion" 1 prepagocard/prepagocard.py|100|8000: La Tarjeta esta en uso en este momento se cancela ejecucion RESULT_LINE: 510 Invalid or unknown command Traceback (most recent call last): File "/var/lib/asterisk/agi-bin/prepagocard/prepagocard.py", line 219, in ? ag.verbose('La Tarjeta esta en uso en este momento se cancela ejecucion') File "/var/lib/asterisk/agi-bin/prepagocard/agi.py", line 548, in verbose self.execute('VERBOSE', self._quote(message), level) File "/var/lib/asterisk/agi-bin/prepagocard/agi.py", line 102, in execute return self.get_result() File "/var/lib/asterisk/agi-bin/prepagocard/agi.py", line 146, in get_result raise AGIInvalidCommand(response) agi.AGIInvalidCommand: Invalid or unknown command -- AGI Script prepagocard/prepagocard.py completed, returning 0 == Auto fallthrough, channel 'SIP/100-d17f' status is 'UNKNOWN' Thanks you for its suggestions. Fernando Villarroel N. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: FERNANDO V. <fvi...@ya...> - 2006-03-21 19:36:10
|
Thanks for the data I hope to soon prove it, greetings from Chile. Fernando Villarroel. Ing. Ej. SW. --- "Matthew A. Nicholson" <mni...@di...> wrote: > Pyst 0.0.4rc13 was just uploaded. It includes > several fixes included > allowing '*' in result sets. > -- > Matthew A. Nicholson > Digium > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a > groundbreaking scripting language > that extends applications into web and mobile media. > Attend the live webcast > and join the prime developer group breaking into > this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Matthew A. N. <mni...@di...> - 2006-03-21 18:55:24
|
Pyst 0.0.4rc13 was just uploaded. It includes several fixes included allowing '*' in result sets. -- Matthew A. Nicholson Digium |
From: FERNANDO V. <fvi...@ya...> - 2006-01-25 20:24:26
|
Yes Thanks. --- "Matthew A. Nicholson" <mni...@di...> wrote: > Make sure there are no linefeed characters (\n) in > your verbose string. > It appears there are: > > VERBOSE "Valor Llamada Cliente 100 (<<<< new line) > " 3 > > This caues the next command to Asterisk to be read > as: > " 3VERBOSE "Valor Llmada Distribuidor 20" 3 > > Whis is not a valid command. This is a limitation > of the AGI protocol, > as it uses \n as a command seperator. > > FERNANDO VILLARROEL wrote: > > Hello, I hope that they can help me. My problem > is > > the following one: Because the administration of > the > > Asterisk server we do it remotely we decided to > change > > the messages that we sent to console; it is to > say > > instead of using > > > > sys.stderr.write > > > > These instructions we have changed by method > verbose > > to them of Class AGI. The problem is that it > falls, > > some VERBOSE do without problems but soon it is > with > > verbose and it dies. Attached part of I cosay of > my > > script, indeed where it gives error me. > > > > That I am making bad? > > > > So that some verbose does without problems and in > > others it falls? > > > > ratesd=buf[3] > > prefixd=buf[4] > > grupod=buf[1] > > m="Valor Llmada Distribuidor %s" % (ratesd) > > ag.verbose(m,3) > > > > > > Conneccion establecida con la Base de Datos...... > > COMMAND: VERBOSE "[13830230L, 1, 1, 1, 1, > 'Diego', > > 'Serrano', 'Bustos', 'dse...@ca...', 5000L, > > 2000L, None, 10000L, 0, 0, 1, 1, 1, 50000L, 'k', > > 99557480L, '2', 'Call Me S.A.', > 'ca...@ca...', > > 50000L, 20000L, 0, 0, '171', '042']" 3 > > -- prepagosip/pagos.py|25804671|222: > [13830230L, > > 1, 1, 1, 1, 'Diego', 'Serrano', 'Bustos', > > 'dse...@ca...', 5000L, 2000L, None, 10000L, > 0, > > 0, 1, 1, 1, 50000L, 'k', 99557480L, '2', 'Call Me > > S.A.', 'ca...@ca...', 50000L, 20000L, 0, 0, > > '171', '042'] > > RESULT_LINE: 200 result=1 > > RESULT_DICT: {'result': ('1', '')} > > Rates Encontrado....[2, 1, 100L, '2', 'LDN > Cliente'].. > > COMMAND: VERBOSE "Valor Llamada Cliente 100 > > " 3 > > prepagosip/pagos.py|25804671|222: Valor Llamada > > Cliente 100 > > RESULT_LINE: 200 result=1 > > RESULT_DICT: {'result': ('1', '')} > > Rates Encontrado....[2, 2, 1, 20L, '2', 'Nacional > > Chillan'].. > > COMMAND: VERBOSE "Valor Llmada Distribuidor > 20" 3 > > -- prepagosip/pagos.py|25804671|222: Valor > Llmada > > Distribuidor 20 > > RESULT_LINE: 510 Invalid or unknown command > > Traceback (most recent call last): > > File > > "/var/lib/asterisk/agi-bin//prepagosip/pagos.py", > line > > 182, in ? > > ag.verbose(m,3) > > > > > > Fernando Villarroel Noriel > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > > > > > > ------------------------------------------------------- > > 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 > > _______________________________________________ > > Pyst-users mailing list > > Pys...@li... > > > https://lists.sourceforge.net/lists/listinfo/pyst-users > > -- > Matthew A. Nicholson > Digium > > > ------------------------------------------------------- > 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 > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Matthew A. N. <mni...@di...> - 2006-01-25 16:41:35
|
Make sure there are no linefeed characters (\n) in your verbose string. It appears there are: VERBOSE "Valor Llamada Cliente 100 (<<<< new line) " 3 This caues the next command to Asterisk to be read as: " 3VERBOSE "Valor Llmada Distribuidor 20" 3 Whis is not a valid command. This is a limitation of the AGI protocol, as it uses \n as a command seperator. FERNANDO VILLARROEL wrote: > Hello, I hope that they can help me. My problem is > the following one: Because the administration of the > Asterisk server we do it remotely we decided to change > the messages that we sent to console; it is to say > instead of using > > sys.stderr.write > > These instructions we have changed by method verbose > to them of Class AGI. The problem is that it falls, > some VERBOSE do without problems but soon it is with > verbose and it dies. Attached part of I cosay of my > script, indeed where it gives error me. > > That I am making bad? > > So that some verbose does without problems and in > others it falls? > > ratesd=buf[3] > prefixd=buf[4] > grupod=buf[1] > m="Valor Llmada Distribuidor %s" % (ratesd) > ag.verbose(m,3) > > > Conneccion establecida con la Base de Datos...... > COMMAND: VERBOSE "[13830230L, 1, 1, 1, 1, 'Diego', > 'Serrano', 'Bustos', 'dse...@ca...', 5000L, > 2000L, None, 10000L, 0, 0, 1, 1, 1, 50000L, 'k', > 99557480L, '2', 'Call Me S.A.', 'ca...@ca...', > 50000L, 20000L, 0, 0, '171', '042']" 3 > -- prepagosip/pagos.py|25804671|222: [13830230L, > 1, 1, 1, 1, 'Diego', 'Serrano', 'Bustos', > 'dse...@ca...', 5000L, 2000L, None, 10000L, 0, > 0, 1, 1, 1, 50000L, 'k', 99557480L, '2', 'Call Me > S.A.', 'ca...@ca...', 50000L, 20000L, 0, 0, > '171', '042'] > RESULT_LINE: 200 result=1 > RESULT_DICT: {'result': ('1', '')} > Rates Encontrado....[2, 1, 100L, '2', 'LDN Cliente'].. > COMMAND: VERBOSE "Valor Llamada Cliente 100 > " 3 > prepagosip/pagos.py|25804671|222: Valor Llamada > Cliente 100 > RESULT_LINE: 200 result=1 > RESULT_DICT: {'result': ('1', '')} > Rates Encontrado....[2, 2, 1, 20L, '2', 'Nacional > Chillan'].. > COMMAND: VERBOSE "Valor Llmada Distribuidor 20" 3 > -- prepagosip/pagos.py|25804671|222: Valor Llmada > Distribuidor 20 > RESULT_LINE: 510 Invalid or unknown command > Traceback (most recent call last): > File > "/var/lib/asterisk/agi-bin//prepagosip/pagos.py", line > 182, in ? > ag.verbose(m,3) > > > Fernando Villarroel Noriel > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > > ------------------------------------------------------- > 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 > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users -- Matthew A. Nicholson Digium |
From: FERNANDO V. <fvi...@ya...> - 2006-01-25 13:26:14
|
Hello, I hope that they can help me. My problem is the following one: Because the administration of the Asterisk server we do it remotely we decided to change the messages that we sent to console; it is to say instead of using sys.stderr.write These instructions we have changed by method verbose to them of Class AGI. The problem is that it falls, some VERBOSE do without problems but soon it is with verbose and it dies. Attached part of I cosay of my script, indeed where it gives error me. That I am making bad? So that some verbose does without problems and in others it falls? ratesd=buf[3] prefixd=buf[4] grupod=buf[1] m="Valor Llmada Distribuidor %s" % (ratesd) ag.verbose(m,3) Conneccion establecida con la Base de Datos...... COMMAND: VERBOSE "[13830230L, 1, 1, 1, 1, 'Diego', 'Serrano', 'Bustos', 'dse...@ca...', 5000L, 2000L, None, 10000L, 0, 0, 1, 1, 1, 50000L, 'k', 99557480L, '2', 'Call Me S.A.', 'ca...@ca...', 50000L, 20000L, 0, 0, '171', '042']" 3 -- prepagosip/pagos.py|25804671|222: [13830230L, 1, 1, 1, 1, 'Diego', 'Serrano', 'Bustos', 'dse...@ca...', 5000L, 2000L, None, 10000L, 0, 0, 1, 1, 1, 50000L, 'k', 99557480L, '2', 'Call Me S.A.', 'ca...@ca...', 50000L, 20000L, 0, 0, '171', '042'] RESULT_LINE: 200 result=1 RESULT_DICT: {'result': ('1', '')} Rates Encontrado....[2, 1, 100L, '2', 'LDN Cliente'].. COMMAND: VERBOSE "Valor Llamada Cliente 100 " 3 prepagosip/pagos.py|25804671|222: Valor Llamada Cliente 100 RESULT_LINE: 200 result=1 RESULT_DICT: {'result': ('1', '')} Rates Encontrado....[2, 2, 1, 20L, '2', 'Nacional Chillan'].. COMMAND: VERBOSE "Valor Llmada Distribuidor 20" 3 -- prepagosip/pagos.py|25804671|222: Valor Llmada Distribuidor 20 RESULT_LINE: 510 Invalid or unknown command Traceback (most recent call last): File "/var/lib/asterisk/agi-bin//prepagosip/pagos.py", line 182, in ? ag.verbose(m,3) Fernando Villarroel Noriel __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: FERNANDO V. <fvi...@ya...> - 2006-01-13 04:53:28
|
Thanks Matthew, now work perfect. Greetings from Chile Fernando Villarroel N. Chillan -Chile --- "Matthew A. Nicholson" <mni...@di...> wrote: > Pyst raises an ASTSIGHUPHangup exception when your > "emitter" hangs up. > You can catch this exception, but once you get the > SIGHUP, asterisk is > no longer responding. Try using DeadAGI to execute > your application > instead of AGI. > > FERNANDO VILLARROEL wrote: > > Hello I do not speak ingles, but she will try to > > explain my problem. > > I am doing script AGI with pyst, but I have the > > following problem: > > > > When a user generates a call and this is answered, > if > > the case that the short emitter occurs or cancels > the > > call first that the receiver, in that minute if > > treatment to rescue the time that lasts the call > > (ANSWEREDTIME) not it I can do since my script > sends > > an exception. > > b=AGI() > > answeredtime=b.get_variable("ANSWEREDTIME") > > > > the exception is the following one: > > > > COMMAND: EXEC Dial SIP/4671|45|rt > > -- AGI Script Executing Application: (Dial) > > Options: (SIP/4671|45|rt) > > -- Called 4671 > > -- SIP/4671-5772 is ringing > > == Spawn extension (042SB, 4671, 1) exited > non-zero > > on 'SIP/4670-5e58' > > Traceback (most recent call last): > > File "/var/lib/asterisk/agi-bin/prueba1.py", > line > > 48, in ? > > answeredtime=b.get_variable("DIALEDTIME") > > File "/var/lib/asterisk/agi-bin/agi.py", line > 536, > > in get_variable > > result = self.execute('GET VARIABLE', > > self._quote(name)) > > File "/var/lib/asterisk/agi-bin/agi.py", line > 98, in > > execute > > self.test_hangup() > > File "/var/lib/asterisk/agi-bin/agi.py", line > 95, in > > test_hangup > > raise AGISIGHUPHangup("Received SIGHUP from > > Asterisk") > > agi.AGISIGHUPHangup: Received SIGHUP from Asterisk > > > > > > But if the call cancels the first receiver, in > that > > case I do not have problems. > > > > Then somebody can say to me like calculating the > > duration of the call if it is that a ANSWER takes > > place and if the emitter hangs or cancels the > first > > call that the receiver? > > > > Fernando Villarroel. > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > > > > > > ------------------------------------------------------- > > 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://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > > _______________________________________________ > > Pyst-users mailing list > > Pys...@li... > > > https://lists.sourceforge.net/lists/listinfo/pyst-users > > -- > Matthew A. Nicholson > Digium > > > ------------------------------------------------------- > 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://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Matthew A. N. <mni...@di...> - 2006-01-13 00:42:32
|
Pyst raises an ASTSIGHUPHangup exception when your "emitter" hangs up. You can catch this exception, but once you get the SIGHUP, asterisk is no longer responding. Try using DeadAGI to execute your application instead of AGI. FERNANDO VILLARROEL wrote: > Hello I do not speak ingles, but she will try to > explain my problem. > I am doing script AGI with pyst, but I have the > following problem: > > When a user generates a call and this is answered, if > the case that the short emitter occurs or cancels the > call first that the receiver, in that minute if > treatment to rescue the time that lasts the call > (ANSWEREDTIME) not it I can do since my script sends > an exception. > b=AGI() > answeredtime=b.get_variable("ANSWEREDTIME") > > the exception is the following one: > > COMMAND: EXEC Dial SIP/4671|45|rt > -- AGI Script Executing Application: (Dial) > Options: (SIP/4671|45|rt) > -- Called 4671 > -- SIP/4671-5772 is ringing > == Spawn extension (042SB, 4671, 1) exited non-zero > on 'SIP/4670-5e58' > Traceback (most recent call last): > File "/var/lib/asterisk/agi-bin/prueba1.py", line > 48, in ? > answeredtime=b.get_variable("DIALEDTIME") > File "/var/lib/asterisk/agi-bin/agi.py", line 536, > in get_variable > result = self.execute('GET VARIABLE', > self._quote(name)) > File "/var/lib/asterisk/agi-bin/agi.py", line 98, in > execute > self.test_hangup() > File "/var/lib/asterisk/agi-bin/agi.py", line 95, in > test_hangup > raise AGISIGHUPHangup("Received SIGHUP from > Asterisk") > agi.AGISIGHUPHangup: Received SIGHUP from Asterisk > > > But if the call cancels the first receiver, in that > case I do not have problems. > > Then somebody can say to me like calculating the > duration of the call if it is that a ANSWER takes > place and if the emitter hangs or cancels the first > call that the receiver? > > Fernando Villarroel. > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > > ------------------------------------------------------- > 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://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users -- Matthew A. Nicholson Digium |
From: FERNANDO V. <fvi...@ya...> - 2006-01-12 18:43:19
|
Hello I do not speak ingles, but she will try to explain my problem. I am doing script AGI with pyst, but I have the following problem: When a user generates a call and this is answered, if the case that the short emitter occurs or cancels the call first that the receiver, in that minute if treatment to rescue the time that lasts the call (ANSWEREDTIME) not it I can do since my script sends an exception. b=AGI() answeredtime=b.get_variable("ANSWEREDTIME") the exception is the following one: COMMAND: EXEC Dial SIP/4671|45|rt -- AGI Script Executing Application: (Dial) Options: (SIP/4671|45|rt) -- Called 4671 -- SIP/4671-5772 is ringing == Spawn extension (042SB, 4671, 1) exited non-zero on 'SIP/4670-5e58' Traceback (most recent call last): File "/var/lib/asterisk/agi-bin/prueba1.py", line 48, in ? answeredtime=b.get_variable("DIALEDTIME") File "/var/lib/asterisk/agi-bin/agi.py", line 536, in get_variable result = self.execute('GET VARIABLE', self._quote(name)) File "/var/lib/asterisk/agi-bin/agi.py", line 98, in execute self.test_hangup() File "/var/lib/asterisk/agi-bin/agi.py", line 95, in test_hangup raise AGISIGHUPHangup("Received SIGHUP from Asterisk") agi.AGISIGHUPHangup: Received SIGHUP from Asterisk But if the call cancels the first receiver, in that case I do not have problems. Then somebody can say to me like calculating the duration of the call if it is that a ANSWER takes place and if the emitter hangs or cancels the first call that the receiver? Fernando Villarroel. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Matthew A. N. <mni...@di...> - 2005-10-31 22:42:47
|
Sweet. Thanks for the quick work. There is also a Debian package included in the source. The standard dpkg-buildpackage utility can be used to build it. Fernando Garrido Vaz wrote: > Hi all, > > An ebuild has been posted for Gentoo users, search for pyst at > bugs.gentoo.org. > > Enjoy ;) > > On Monday 31 October 2005 22:15, Matthew A. Nicholson wrote: > >>A new RC release has been posted to the main project page. Enjoy. -- Matthew A. Nicholson Digium |
From: Fernando G. V. <fer...@ma...> - 2005-10-31 22:26:26
|
Hi all, An ebuild has been posted for Gentoo users, search for pyst at=20 bugs.gentoo.org. Enjoy ;) On Monday 31 October 2005 22:15, Matthew A. Nicholson wrote: > A new RC release has been posted to the main project page. Enjoy. |
From: Matthew A. N. <mni...@di...> - 2005-10-31 22:14:36
|
A new RC release has been posted to the main project page. Enjoy. -- Matthew A. Nicholson Digium |
From: Matthew A. N. <mni...@di...> - 2005-06-08 23:10:09
|
Ok good people. I have good news. I have been able to contact the original developer of pyst and we are looking into getting my modifications back into the main line. Keep on the look out. -- Matthew A. Nicholson Digium |
From: Matthew A. N. <mni...@di...> - 2005-02-02 02:06:43
|
A new release of my pyst "fork" can be found here (the usual place): http://sourceforge.net/tracker/index.php?func=detail&aid=1075441&group_id=76162&atid=546274 Changes include: * Line number tracking in config.py * say_time function in agi.py * the usual manager.py updates (man is manager.py buggy... I see are rewrite in my future) -- Matthew A. Nicholson Digium |
From: Dax R. <ra...@gm...> - 2005-01-18 06:11:29
|
Seems its better to 'trap' the "UNDEFINED" in get_data and raise an AGIException Below is the patch. --- pyst-0.0.4rc9.orig/asterisk/agi.py 2004-12-14 09:30:25.000000000 +0800 +++ pyst-0.0.4rc9/asterisk/agi.py 2005-01-18 11:26:02.701385792 +0800 @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python """agi @@ -302,6 +302,8 @@ """ result = self.execute('get data', filename, timeout, max_digits) res, value = result['result'] + if res == 'UNDEFINED': + raise AGIException("res = %s : Timeout without receiving data" %(res )) return res On Wed, 12 Jan 2005 09:21:04 -0600, Matthew A. Nicholson <mni...@di...> wrote: > Dax Reyes wrote: > > I get the following on asterisk console when I > > call get_data > > let it timeout > > then call say_digits. > > > > COMMAND: get data demo-congrats 5000 255 > > -- Playing 'demo-congrats' (language 'en') > > RESULT_LINE: 200 result= (timeout) > > RESULT_DICT: {'result': ('UNDEFINED', '')} > > COMMAND: say digits "UNDEFINED" "" > > RESULT_LINE: 520-Invalid command syntax. Proper usage follows: > > Traceback (most recent call last): > > File "/usr/local/share/asterisk/agi-bin/agi.py", line 516, in ? > > agi.say_digits(mydigit) > > File "/usr/local/share/asterisk/agi-bin/agi.py", line 231, in say_digits > > res = self.execute('say digits', digits, escape_digits)['result'][0] > > File "/usr/local/share/asterisk/agi-bin/agi.py", line 63, in execute > > return self.get_result() > > File "/usr/local/share/asterisk/agi-bin/agi.py", line 111, in get_result > > raise AGIException(code, usage) > > __main__.AGIException: (520, '520-Invalid command syntax. Proper usage follows: > > > > In order to avoid 520 AGIException for this situation: > > > > when agi asks for some input (get_data) then timeout without getting > > any ( thus getting a result = {result:('UNDEFINED','')} ) and later > > "playing/saying" the digits/number with digits = `"UNDEFINED"' > > > > I have added something like > > > > if digits = `"UNDEFINED"': return '' > > > > in function say_digits > > > > Sounds reasonable, go ahead and send a patch. Also if you see any other cases > like this send those as well. > > -- > Matthew A. Nicholson > Digium Dax |
From: Dax R. <ra...@gm...> - 2005-01-16 05:54:06
|
On Wed, 12 Jan 2005 09:21:04 -0600, Matthew A. Nicholson <mni...@di...> wrote: > <snipped> > Sounds reasonable, go ahead and send a patch. Also if you see any other cases > like this send those as well. ok, I have uploaded the patch here. http://sourceforge.net/tracker/index.php?func=detail&aid=1102447&group_id=76162&atid=546274 > > -- > Matthew A. Nicholson > Digium > <snipped> Dax |
From: Matthew A. N. <mni...@di...> - 2005-01-12 15:21:08
|
Dax Reyes wrote: > I get the following on asterisk console when I > call get_data > let it timeout > then call say_digits. > > COMMAND: get data demo-congrats 5000 255 > -- Playing 'demo-congrats' (language 'en') > RESULT_LINE: 200 result= (timeout) > RESULT_DICT: {'result': ('UNDEFINED', '')} > COMMAND: say digits "UNDEFINED" "" > RESULT_LINE: 520-Invalid command syntax. Proper usage follows: > Traceback (most recent call last): > File "/usr/local/share/asterisk/agi-bin/agi.py", line 516, in ? > agi.say_digits(mydigit) > File "/usr/local/share/asterisk/agi-bin/agi.py", line 231, in say_digits > res = self.execute('say digits', digits, escape_digits)['result'][0] > File "/usr/local/share/asterisk/agi-bin/agi.py", line 63, in execute > return self.get_result() > File "/usr/local/share/asterisk/agi-bin/agi.py", line 111, in get_result > raise AGIException(code, usage) > __main__.AGIException: (520, '520-Invalid command syntax. Proper usage follows: > > In order to avoid 520 AGIException for this situation: > > when agi asks for some input (get_data) then timeout without getting > any ( thus getting a result = {result:('UNDEFINED','')} ) and later > "playing/saying" the digits/number with digits = `"UNDEFINED"' > > I have added something like > > if digits = `"UNDEFINED"': return '' > > in function say_digits > Sounds reasonable, go ahead and send a patch. Also if you see any other cases like this send those as well. -- Matthew A. Nicholson Digium |
From: Dax R. <ra...@gm...> - 2005-01-12 03:35:19
|
I get the following on asterisk console when I call get_data let it timeout then call say_digits. COMMAND: get data demo-congrats 5000 255 -- Playing 'demo-congrats' (language 'en') RESULT_LINE: 200 result= (timeout) RESULT_DICT: {'result': ('UNDEFINED', '')} COMMAND: say digits "UNDEFINED" "" RESULT_LINE: 520-Invalid command syntax. Proper usage follows: Traceback (most recent call last): File "/usr/local/share/asterisk/agi-bin/agi.py", line 516, in ? agi.say_digits(mydigit) File "/usr/local/share/asterisk/agi-bin/agi.py", line 231, in say_digits res = self.execute('say digits', digits, escape_digits)['result'][0] File "/usr/local/share/asterisk/agi-bin/agi.py", line 63, in execute return self.get_result() File "/usr/local/share/asterisk/agi-bin/agi.py", line 111, in get_result raise AGIException(code, usage) __main__.AGIException: (520, '520-Invalid command syntax. Proper usage follows: In order to avoid 520 AGIException for this situation: when agi asks for some input (get_data) then timeout without getting any ( thus getting a result = {result:('UNDEFINED','')} ) and later "playing/saying" the digits/number with digits = `"UNDEFINED"' I have added something like if digits = `"UNDEFINED"': return '' in function say_digits On Tue, 11 Jan 2005 09:46:09 -0600, Matthew A. Nicholson <mni...@di...> wrote: > Dax Reyes wrote: > > Hello, > > > > seems to be a bug. > > > > try using agi.py and put something like > > > > #!/usr/bin/env python > > > > import asterisk.agi > > agi = asterisk.agi.AGI() > > > > mydigit = agi.get_data('demo-congrats',timeout=5000) > > > > #do no input anything, mydigit now has a value "UNDEFINED" ! > > agi.say_digits(mydigit) > > sys.exit(0) > > > > > > call function get_data and not input anything. > > then call say_digits > > will throw an exception because of the UNDEFINED value > > > > I can't think of a good fix, since if I put an "if" condition in > > function get_data something like > > > > if res == "UNDEFINED": > > res = '' > > > > say_digits will now issue an agi command > > say digits "" "" > > > > which will also throw an exception > > > > > > I wouldn't call that a bug. Maybe it should be handled differently, but that is > what asterisk returns to us. > > -- > Matthew A. Nicholson > Digium > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Pyst-users mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pyst-users > dax |