Summary:ASTERISK-14051: [patch] Patch that makes app_dial set channel variable DIVERTED_BY on 302 response
Reporter:Brent Thomson (_brent_)Labels:
Date Opened:2009-05-01 15:59:52Date Closed:2011-06-07 14:01:04
Versions:Frequency of
Environment:Attachments:( 0) diverted_by-2.patch
Description:I needed to know what username initiated a forward for authentication and accounting purposes. This patch makes app_dial set the channel variable ${DIVERTED_BY} on the *new* channel (the result of the forward). The variable can then be referenced in the dial plan and queried by AGI.

The variable is in the format tech/name. For example, if the SIP extension 1001 forwards the call, ${DIVERTED_BY} will be set to 'SIP/1001' (without the quotes).
Comments:By: Brent Thomson (_brent_) 2009-05-01 17:29:18

Update: it sets ${DIVERTED_BY} to the channel name, not technically the tech/username, but typically created by appending something to tech/username.

By: Brent Thomson (_brent_) 2009-05-01 17:31:16

The second patch doesn't change the functionality, but is a little more clear in that it's taking the name from the *original* channel, not the winning channel. The first patch can be deleted, please.

By: Leif Madsen (lmadsen) 2009-09-18 09:09:26

I'm confirming this issue, and it would be nice to get some testing, however, I have a feeling the way this is implemented will need to be different, as we don't like polluting the variable name space. There will probably need to be some sort of dialplan function that you need to use to get the information.

However, I will leave it up to a developer to review and recommend a better approach.

By: Leif Madsen (lmadsen) 2009-09-18 09:22:26

I'm closing this issue per mmichelson as he stated the func_redirecting function will have the necessary information to perform this very same functionality! It is in trunk, and since this is only a candidate for trunk (and thus duplicate functionality) I'm going to close it.

Thanks for the patch though!