[asterisk-bugs] [Asterisk 0013501]: Cannot send more than one variable to a python script

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Sep 17 08:03:02 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13501 
====================================================================== 
Reported By:                tjma2001
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13501
Category:                   Applications/app_system
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.17 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-09-17 07:09 CDT
Last Modified:              2008-09-17 08:03 CDT
====================================================================== 
Summary:                    Cannot send more than one variable to a python
script
Description: 
I run my python script using the following command

exten = s,3,System(/usr/share/asterisk/agi-bin/something.py 
"'${CDR(clid)) ${CDR(lastapp)}'")

and I get this error.

-- Executing [s at voicemenu-custom-1:3] System("SIP/6000-b6401e18",
"/usr/share/asterisk/agi-bin/smsgateway.py  " Answer"") in new stack
Traceback (most recent call last):
  File "/usr/share/asterisk/agi-bin/smsgateway.py", line 19, in ?
    lastapp = sys.argv[2]
IndexError: list index out of range

The script works fine on the command line if is use two input variables.
It also works in asterisk if i write it this way:

exten = s,3,System(/usr/share/asterisk/agi-bin/something.py 
"'${CDR(clid)}'" "'${CDR(lastapp)}'")

====================================================================== 

---------------------------------------------------------------------- 
 (0092616) tjma2001 (reporter) - 2008-09-17 08:03
 http://bugs.digium.com/view.php?id=13501#c92616 
---------------------------------------------------------------------- 
Well it seems like its python's reponse to asterisk not sending the values
correctly. Since when I do seperate encapsulation of the variables
"'variablea'" "'variableb'" it works. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-09-17 08:03 tjma2001       Note Added: 0092616                          
======================================================================




More information about the asterisk-bugs mailing list