[asterisk-commits] schmidts: branch schmidts/unleash-the-beast r343162 - in /team/schmidts/unlea...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Nov 2 17:01:07 CDT 2011
Author: schmidts
Date: Wed Nov 2 17:01:03 2011
New Revision: 343162
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=343162
Log:
adding FORWARDER_SIPPEER chan var and also Redirect chan var
Modified:
team/schmidts/unleash-the-beast/apps/app_dial.c
team/schmidts/unleash-the-beast/channels/chan_sip.c
Modified: team/schmidts/unleash-the-beast/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/schmidts/unleash-the-beast/apps/app_dial.c?view=diff&rev=343162&r1=343161&r2=343162
==============================================================================
--- team/schmidts/unleash-the-beast/apps/app_dial.c (original)
+++ team/schmidts/unleash-the-beast/apps/app_dial.c Wed Nov 2 17:01:03 2011
@@ -840,6 +840,8 @@
char *tech;
int cause;
struct ast_party_caller caller;
+ const char *forward_sippeer = pbx_builtin_getvar_helper(c, "FORWARDER_SIPPEER");
+
ast_copy_string(tmpchan, c->call_forward, sizeof(tmpchan));
if ((stuff = strchr(tmpchan, '/'))) {
@@ -875,6 +877,7 @@
ast_channel_make_compatible(o->chan, in);
ast_channel_inherit_variables(in, o->chan);
ast_channel_datastore_inherit(in, o->chan);
+ pbx_builtin_setvar_helper(o->chan, "_FORWARDER_SIPPEER", forward_sippeer);
/* When a call is forwarded, we don't want to track new interfaces
* dialed for CC purposes. Setting the done flag will ensure that
* any Dial operations that happen later won't record CC interfaces.
Modified: team/schmidts/unleash-the-beast/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/schmidts/unleash-the-beast/channels/chan_sip.c?view=diff&rev=343162&r1=343161&r2=343162
==============================================================================
--- team/schmidts/unleash-the-beast/channels/chan_sip.c (original)
+++ team/schmidts/unleash-the-beast/channels/chan_sip.c Wed Nov 2 17:01:03 2011
@@ -19302,6 +19302,12 @@
ast_debug(2, "Received 302 Redirect to extension '%s' (domain %s)\n", contact_number, domain);
if (p->owner) {
pbx_builtin_setvar_helper(p->owner, "SIPDOMAIN", domain);
+ if (!ast_strlen_zero(p->peername)) {
+ pbx_builtin_setvar_helper(p->owner, "_FORWARDER_SIPPEER", p->peername);
+ } else {
+ pbx_builtin_setvar_helper(p->owner, "_FORWARDER_SIPPEER", p->username);
+ }
+
ast_string_field_set(p->owner, call_forward, contact_number);
}
}
@@ -23163,6 +23169,12 @@
if (!ast_strlen_zero(referred_by)) {
pbx_builtin_setvar_helper(current.chan2, "_SIPTRANSFER_REFERER", referred_by);
}
+ if (!ast_strlen_zero(p->peername)) {
+ pbx_builtin_setvar_helper(current.chan2, "_TRANSFERER_SIPPEER", p->peername);
+ } else {
+ pbx_builtin_setvar_helper(current.chan2, "_TRANSFERER_SIPPEER", p->username);
+ }
+
}
sip_pvt_lock(p);
More information about the asterisk-commits
mailing list