Summary:ASTERISK-10686: Added variable "agi_asteriskthreadid" to AGI
Reporter:Dror (dror99)Labels:
Date Opened:2007-11-05 08:52:52.000-0600Date Closed:2007-12-24 20:54:36.000-0600
Versions:Frequency of
Environment:Attachments:( 0) patch11162_4.txt
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@DrorPOC3-95b0,2", "In DrorPOC3") in new stack

Nov  5 14:25:55 VERBOSE[8716] logger.c:     -- Executing DeadAGI("Local/7777@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.


The asterisk version I use is:
Asterisk 1.2.10

Edit: Patch included here removed by jamesgolovich
Comments:By: James Golovich (jamesgolovich) 2007-11-05 10:19:23.000-0600

Don't attach patches in the description or additional information.  They must be uploaded as a file.

By: Jason Parker (jparker) 2007-11-06 12:44:18.000-0600

You will need to submit a license agreement, and reupload the file as a patch before we are able to look at it.

By: Joshua C. Colp (jcolp) 2007-11-07 20:48:35.000-0600

Your license was rejected. You'll need to follow up on that and re-upload.

By: Olle Johansson (oej) 2007-11-19 04:07:47.000-0600

The patch file includes prompts from your linux... Not good.

By: Olle Johansson (oej) 2007-11-19 04:08:30.000-0600

Maybe this should be part of the channel dialplan function also?

By: Dror (dror99) 2007-11-20 03:29:26.000-0600

I've reuploaded the patch file according to oej explanation.
Please remove older version of the patch, and notes that are no longer relevant.

By: Eliel Sardanons (eliel) 2007-12-08 23:48:28.000-0600

Patchs for new features must be created against trunk, please upload this patch against latest trunk.
Asterisk 1.2 will only accept security fixes.


By: Digium Subversion (svnbot) 2007-12-24 20:54:36.000-0600

Repository: asterisk
Revision: 94771

U   trunk/res/res_agi.c

r94771 | tilghman | 2007-12-24 20:54:35 -0600 (Mon, 24 Dec 2007) | 5 lines

Add channel thread ID to the information passed to AGI.
Reported by: dror99
Patch by: tilghman
(Closes issue ASTERISK-10686)