summaryrefslogtreecommitdiff
path: root/main/channel.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2009-06-22 20:11:04 +0000
committerRussell Bryant <russell@russellbryant.com>2009-06-22 20:11:04 +0000
commit2affa3e999a279149c58f71841988e10408c3191 (patch)
treeffcc85b02b4b70a9e3de59ae612f6c3674085af8 /main/channel.c
parent8d3fb809287f4c39470b33225a45b51189f46983 (diff)
Merged revisions 202496 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r202496 | russell | 2009-06-22 15:08:53 -0500 (Mon, 22 Jun 2009) | 4 lines Report CallerID change during a masquerade. Reported by: markster ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c39
1 files changed, 25 insertions, 14 deletions
diff --git a/main/channel.c b/main/channel.c
index bf35791fd..fdfe9e941 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -4667,6 +4667,26 @@ static void clone_variables(struct ast_channel *original, struct ast_channel *cl
}
/*!
+ * \pre chan is locked
+ */
+static void report_new_callerid(const struct ast_channel *chan)
+{
+ manager_event(EVENT_FLAG_CALL, "NewCallerid",
+ "Channel: %s\r\n"
+ "CallerIDNum: %s\r\n"
+ "CallerIDName: %s\r\n"
+ "Uniqueid: %s\r\n"
+ "CID-CallingPres: %d (%s)\r\n",
+ chan->name,
+ S_OR(chan->cid.cid_num, ""),
+ S_OR(chan->cid.cid_name, ""),
+ chan->uniqueid,
+ chan->cid.cid_pres,
+ ast_describe_caller_presentation(chan->cid.cid_pres)
+ );
+}
+
+/*!
\brief Masquerade a channel
\note Assumes channel will be locked when called
@@ -4869,6 +4889,8 @@ int ast_do_masquerade(struct ast_channel *original)
exchange.cid = original->cid;
original->cid = clonechan->cid;
clonechan->cid = exchange.cid;
+ report_new_callerid(original);
+
exchange.connected = original->connected;
original->connected = clonechan->connected;
clonechan->connected = exchange.connected;
@@ -4972,20 +4994,9 @@ void ast_set_callerid(struct ast_channel *chan, const char *cid_num, const char
ast_free(chan->cid.cid_ani);
chan->cid.cid_ani = ast_strdup(cid_ani);
}
- manager_event(EVENT_FLAG_CALL, "NewCallerid",
- "Channel: %s\r\n"
- "CallerIDNum: %s\r\n"
- "CallerIDName: %s\r\n"
- "Uniqueid: %s\r\n"
- "CID-CallingPres: %d (%s)\r\n",
- chan->name,
- S_OR(chan->cid.cid_num, ""),
- S_OR(chan->cid.cid_name, ""),
- chan->uniqueid,
- chan->cid.cid_pres,
- ast_describe_caller_presentation(chan->cid.cid_pres)
- );
-
+
+ report_new_callerid(chan);
+
ast_channel_unlock(chan);
}