[asterisk-bugs] [Asterisk 0011162]: Added variable "agi_asteriskthreadid" to AGI

noreply at bugs.digium.com noreply at bugs.digium.com
Mon Nov 5 10:20:05 CST 2007


The following issue has been UPDATED. 
====================================================================== 
http://bugs.digium.com/view.php?id=11162 
====================================================================== 
Reported By:                dror99
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   11162
Category:                   Resources/res_agi
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     new
Asterisk Version:            1.2.12.1  
SVN Branch (only for SVN checkouts, not tarball releases):  1.2  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             11-05-2007 08:52 CST
Last Modified:              11-05-2007 10:20 CST
====================================================================== 
Summary:                    Added variable "agi_asteriskthreadid" to AGI
Description: 
I've added a small feature to AGI interface.

I've added a variable "agi_asteriskthreadid" to the asterisk variables
that AGI passes to the script it runs.

 

We needed this feature because our script writes a log file, and we wanted
to write in the log the asterisk thread id, so it would be easier to match
between asterisk log and the script log.

 

Here is how our script file log looks like:

Nov 05 14:21:29 [8717] ----------OUR SCRIPT START---------

Nov 05 14:21:29 [8717] SET VARIABLE PHP_DO_SCRIPT start

Nov 05 14:21:29 [8716] NOTICE!!! agi_asteriskthreadid exists - updating id
in log from scriptpid->agi_asteriskthreadid 8717 -> 8716

Nov 05 14:21:29 [8716] Hello World!

Nov 05 14:21:29 [8716] ----------OUR SCRIPT ENDS---------

 

Here is the asterisk log:

Nov  5 14:25:55 VERBOSE[8716] logger.c:     -- Executing
NoOp("Local/7777 at DrorPOC3-95b0,2", "In DrorPOC3") in new stack

Nov  5 14:25:55 VERBOSE[8716] logger.c:     -- Executing
DeadAGI("Local/7777 at DrorPOC3-95b0,2", "my_script.php|DROR_TEST|1|2|3") in
new stack

Nov  5 14:25:55 VERBOSE[8716] logger.c:     -- Launched AGI Script
/var/lib/asterisk/agi-bin/my_script.php

Nov  5 14:25:55 VERBOSE[8716] logger.c:     -- AGI Script my_script.php
completed, returning 0

 

Notice that [8716] is the asterisk thread id that launched the AGI
command.

It's now very easy for one looking at the asterisk log to match it to the
script log. 


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

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
11-05-07 10:20  jamesgolovich  Additional Information Updated                   

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




More information about the asterisk-bugs mailing list