Improve call forwarding reporting, especially with regards to ARI.

This patch addresses a few issues:

1) The order of Dial events have been changed when performing a call forward.
   The order has now been altered to
    1) Dial begins dialing channel A.
    2) When A forwards the call to B, we issue the dial end event to channel
       A, indicating the dial is being canceled due to a forward to B.
    3) When the call to channel B occurs, we then issue a new dial begin to
       channel B.

2) Call forwards are now reported on the calling channel, not the peer channel.

3) AMI DialEnd events have been altered to display the extension the call is
   being forwarded to when relevant.

4) You can now get the values of channel variables for channels that are not
   currently in the Stasis application. This brings the retrieval of channel
   variables more in line with the rest of channel read operations since they
   may be performed on channels not in Stasis.

ASTERISK-24134 #close
Reported by Matt Jordan

ASTERISK-24138 #close
Reported by Matt Jordan

Patches:
	forward-shenanigans.diff uploaded by Matt Jordan (License #6283)

Review: https://reviewboard.asterisk.org/r/3899



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@420794 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2014-08-11 18:32:37 +00:00
parent 1b500d2fa1
commit ef70c08dc7
9 changed files with 57 additions and 61 deletions

View File

@@ -565,34 +565,6 @@ int stasis_app_control_unmute(struct stasis_app_control *control, unsigned int d
return 0;
}
char *stasis_app_control_get_channel_var(struct stasis_app_control *control, const char *variable)
{
RAII_VAR(struct ast_str *, tmp, ast_str_create(32), ast_free);
/* You may be tempted to lock the channel you're about to read from. You
* would be wrong. Some dialplan functions put the channel into
* autoservice, which deadlocks if the channel is already locked.
* ast_str_retrieve_variable() does its own locking, and the dialplan
* functions need to as well. We should be fine without the lock.
*/
if (!tmp) {
return NULL;
}
if (variable[strlen(variable) - 1] == ')') {
if (ast_func_read2(control->channel, variable, &tmp, 0)) {
return NULL;
}
} else {
if (!ast_str_retrieve_variable(&tmp, 0, control->channel, NULL, variable)) {
return NULL;
}
}
return ast_strdup(ast_str_buffer(tmp));
}
int stasis_app_control_set_channel_var(struct stasis_app_control *control, const char *variable, const char *value)
{
return pbx_builtin_setvar_helper(control->channel, variable, value);