[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 07:20:30 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 07:20 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)}'")

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

---------------------------------------------------------------------- 
 (0092615) blitzrage (administrator) - 2008-09-17 07:20
 http://bugs.digium.com/view.php?id=13501#c92615 
---------------------------------------------------------------------- 
I can't quite tell if this is python returning information due to it not
getting the values correctly, or if this is an Asterisk response message.
My guess is this is probably coming from python, but I had asked the bug
reporter to file this just to make sure. So if you close this as not a bug,
please don't give negative karma :) 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-09-17 07:20 blitzrage      Note Added: 0092615                          
======================================================================




More information about the asterisk-bugs mailing list