[Home]

Summary:ASTERISK-06597: [patch][post 1.4] FastAGI does not pass paramaters to the FastAGI Server
Reporter:exomorph (exomorph)Labels:
Date Opened:2006-03-22 12:34:03.000-0600Date Closed:2006-10-17 18:09:17
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_agi
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) res_agi.v1.diff
( 1) res_agi.v2.diff
( 2) res_agi.v3.diff
( 3) res_agi.v4.diff
( 4) res_agi.v6.diff
Description:When issuing a FastAGI call in the dialplan that has paramaters, the paramaters never actually got passed to the server.

****** ADDITIONAL INFORMATION ******

This patch fixes that problem by having the launch_netscript() function pass each script argument as a "agi_arg_X: <param>" startup line on the input file handle.
Comments:By: BJ Weschke (bweschke) 2006-03-22 13:21:26.000-0600

Does this affect any kind of backward compatibility or is it fully backward compatible with previous FastAGI functionality?

By: exomorph (exomorph) 2006-03-22 14:09:40.000-0600

As far as I can tell, passing Arguments never worked with FastAGI. So there will not be any compatability issues with it.  This only effects FastAGI (and not normal AGI support).

By: exomorph (exomorph) 2006-03-22 15:01:32.000-0600

I've done further research, and it appears that there are inconsistencies with how AGI and FastAGI pass information. AGI passes arguments by the AGI command…
Example: AGI(agi://my.example.com/|${EXTEN})

Where FastAGI requires you to pass arguments on the URI...
Example: AGI(agi://my.example.com/?extension=${EXTEN})

I have changed the patch to allow FastAGI to either pass named arguments on the URI and/or pass arguments via the AGI application itself.

At the very least we should probably change the description of the AGI application to show this difference between AGI and FastAGI.

By: exomorph (exomorph) 2006-03-22 15:02:54.000-0600

Oppps, Normal AGI's example would be:

Example: AGI(/path/to/example/script|${EXTEN})

By: Stefan Reuter (srt) 2006-03-29 05:58:57.000-0600

If you use AGI(agi://my.example.com/?extension=${EXTEN})
the whole URL is available to your AGI script and can be parsed there.
I dont think there is a need to change Asterisk here...

By: exomorph (exomorph) 2006-03-29 08:47:44.000-0600

Hey Srt,

I noted that above.  But also stated that this is inconsistent with how the normal AGI scripting works.  This patch keeps the new way of passing parameters to FAST-AGI (the way you stated), but also adds the ability to use the old way of passing parameters.

By: Stefan Reuter (srt) 2006-03-29 08:55:04.000-0600

The reason why this is inconsistent with with how the normal AGI scripting works is because you cant pass environment variables over a network socket the way you can when invoking a script.
A clean solution might actually be to provide the "agi_arg_XXX" stuff for both AGI and FastAGI and deprecate parameter passing via environment variables as it only works with local invocation.

=Stefan

P.S. would also make life easier for AGI script developers as parsing the URL like this kinda sucks ;)

By: Serge Vecher (serge-v) 2006-05-25 16:12:44

Exomorph: where are we with this issue?

By: Serge Vecher (serge-v) 2006-06-05 20:16:44

time is ticking .... Need a patch here to make it into 1.4 ...

By: exomorph (exomorph) 2006-06-14 11:23:08

Fixed the patch so that all agi scripts get the new agi_argX arguments.  For non-fastagi scripts, they still receive the arguments on the command line, but also receive them with by the agi_argX parameters.

At a later date, we should probably depreciate how non-fastagi scripts get the arguments via the command line.

By: Serge Vecher (serge-v) 2006-06-16 11:57:42

did anybody monitoring this bug try the latest patch / have any comments?

By: exomorph (exomorph) 2006-06-16 13:08:27

I do have this patch in production, but we should get one or two more people to test it...

By: exomorph (exomorph) 2006-07-06 11:32:50

Anything new on this patch?  Is it going in for 1.4 or is it being held off for 1.6?

By: Serge Vecher (serge-v) 2006-07-06 11:36:07

At this point, this is post 1.4 material. Once the 1.4 beta branch is forked, please get some testers for this patch to report on whether they successfully use this or not. Thanks.

By: Steve Murphy (murf) 2006-10-17 18:02:34

I've added myself to the tester list, applied the patch, and ran tests
against this both before and after. It looks good. The code does not
violate the standards, afaik. It does no harm, yet makes args available
to fastagi servers. I'm sold!

By: Steve Murphy (murf) 2006-10-17 18:08:24

This patch folded into the trunk via rev  45426. Corrected a small spelling mistake, and corrected a now obsolete CLI command reference to its new format.

Ran tests to make sure it works as advertised.

By: Steve Murphy (murf) 2006-10-17 18:09:15

Looks like this job is finished!