[asterisk-commits] russell: branch 1.4 r202496 - /branches/1.4/main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 22 15:08:56 CDT 2009


Author: russell
Date: Mon Jun 22 15:08:53 2009
New Revision: 202496

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=202496
Log:
Report CallerID change during a masquerade.

Reported by: markster

Modified:
    branches/1.4/main/channel.c

Modified: branches/1.4/main/channel.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/main/channel.c?view=diff&rev=202496&r1=202495&r2=202496
==============================================================================
--- branches/1.4/main/channel.c (original)
+++ branches/1.4/main/channel.c Mon Jun 22 15:08:53 2009
@@ -3718,6 +3718,26 @@
 }
 
 /*!
+ * \pre chan is locked
+ */
+static void report_new_callerid(const struct ast_channel *chan)
+{
+	manager_event(EVENT_FLAG_CALL, "Newcallerid",
+				"Channel: %s\r\n"
+				"CallerID: %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, "<Unknown>"),
+				S_OR(chan->cid.cid_name, "<Unknown>"),
+				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
@@ -3918,7 +3938,8 @@
 	tmpcid = original->cid;
 	original->cid = clone->cid;
 	clone->cid = tmpcid;
-	
+	report_new_callerid(original);
+
 	/* Restore original timing file descriptor */
 	original->fds[AST_TIMING_FD] = original->timingfd;
 	
@@ -4019,20 +4040,9 @@
 			free(chan->cid.cid_ani);
 		chan->cid.cid_ani = ast_strdup(ani);
 	}
-	manager_event(EVENT_FLAG_CALL, "Newcallerid",
-				"Channel: %s\r\n"
-				"CallerID: %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, "<Unknown>"),
-				S_OR(chan->cid.cid_name, "<Unknown>"),
-				chan->uniqueid,
-				chan->cid.cid_pres,
-				ast_describe_caller_presentation(chan->cid.cid_pres)
-				);
-	
+
+	report_new_callerid(chan);
+
 	ast_channel_unlock(chan);
 }
 




More information about the asterisk-commits mailing list