aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-01-09 20:09:48 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-01-09 20:09:48 +0000
commit630bfb67927c3acfb1fde206d4faa8c0f95e166f (patch)
tree715e0348dfb760a549dbf2e67ca5110d1647f4ac
parentde5a432d693816493a78c503f111fabf87455678 (diff)
Set blind transfer variable (bug #3268)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4736 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xchannels/chan_sip.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index e7d34943c..bf52e1263 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -3455,7 +3455,7 @@ static int add_sdp(struct sip_request *resp, struct sip_pvt *p)
/* Prefer the codec we were requested to use, first, no matter what */
if (capability & p->prefcodec) {
if (debug)
- ast_verbose("Answering/Requesting with root capability %d\n", p->prefcodec);
+ ast_verbose("Answering/Requesting with root capability 0x%x (%s)\n", p->prefcodec, ast_getformatname(p->prefcodec));
codec = ast_rtp_lookup_code(p->rtp, 1, p->prefcodec);
if (codec > -1) {
snprintf(costr, sizeof(costr), " %d", codec);
@@ -5242,7 +5242,8 @@ static int get_refer_info(struct sip_pvt *p, struct sip_request *oreq)
char tmp5[256] = ""; /* CallID to replace */
struct sip_request *req;
struct sip_pvt *p2;
-
+ struct ast_channel *chan = NULL, *peer = NULL;
+
req = oreq;
if (!req)
req = &p->initreq;
@@ -5346,6 +5347,7 @@ static int get_refer_info(struct sip_pvt *p, struct sip_request *oreq)
ast_log(LOG_NOTICE, "Supervised transfer requested, but unable to find callid '%s'\n", tmp5);
} else if (ast_exists_extension(NULL, p->context, c, 1, NULL) || !strcmp(c, ast_parking_ext())) {
/* This is an unsupervised transfer */
+
ast_log(LOG_DEBUG,"Assigning Extension %s to REFER-TO\n", c);
ast_log(LOG_DEBUG,"Assigning Extension %s to REFERRED-BY\n", c2);
ast_log(LOG_DEBUG,"Assigning Contact Info %s to REFER_CONTACT\n", tmp3);
@@ -5353,6 +5355,10 @@ static int get_refer_info(struct sip_pvt *p, struct sip_request *oreq)
strncpy(p->referred_by, c2, sizeof(p->referred_by) - 1);
strncpy(p->refer_contact, tmp3, sizeof(p->refer_contact) - 1);
p->refer_call = NULL;
+ if((chan = p->owner) && (peer = ast_bridged_channel(p->owner))) {
+ pbx_builtin_setvar_helper(chan, "BLINDTRANSFER", peer->name);
+ pbx_builtin_setvar_helper(peer, "BLINDTRANSFER", chan->name);
+ }
return 0;
} else if (ast_canmatch_extension(NULL, p->context, c, 1, NULL)) {
return 1;