[asterisk-bugs] [Asterisk 0011162]: Added variable "agi_asteriskthreadid" to AGI
noreply at bugs.digium.com
noreply at bugs.digium.com
Mon Nov 5 10:19:23 CST 2007
A NOTE has been added to this issue.
======================================================================
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:19 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.
======================================================================
----------------------------------------------------------------------
jamesgolovich - 11-05-07 10:19
----------------------------------------------------------------------
Don't attach patches in the description or additional information. They
must be uploaded as a file.
Issue History
Date Modified Username Field Change
======================================================================
11-05-07 10:19 jamesgolovich Note Added: 0073105
======================================================================
More information about the asterisk-bugs
mailing list