[asterisk-commits] dlee: branch certified-1.8.15 r379002 - in /certified/branches/1.8.15: ./ cha...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 14 09:17:49 CST 2013


Author: dlee
Date: Mon Jan 14 09:17:44 2013
New Revision: 379002

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=379002
Log:
Fix XML encoding of 'identity display' in NOTIFY messages, continued.

When r378933 was merged into 1.8, it should have also escaped
remote_display, since it will have the same XML encoding problem when
the caller/callee roles are reversed.

(closes issue ABE-2902)
Reported by: Guenther Kelleter
........

Merged revisions 379001 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    certified/branches/1.8.15/   (props changed)
    certified/branches/1.8.15/channels/chan_sip.c

Propchange: certified/branches/1.8.15/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: certified/branches/1.8.15/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/certified/branches/1.8.15/channels/chan_sip.c?view=diff&rev=379002&r1=379001&r2=379002
==============================================================================
--- certified/branches/1.8.15/channels/chan_sip.c (original)
+++ certified/branches/1.8.15/channels/chan_sip.c Mon Jan 14 09:17:44 2013
@@ -12850,8 +12850,8 @@
 		if ((data->state & AST_EXTENSION_RINGING) && sip_cfg.notifyringing) {
 			/* Twice the extension length should be enough for XML encoding */
 			char local_display[AST_MAX_EXTENSION * 2];
+			char remote_display[AST_MAX_EXTENSION * 2];
 			char *local_target = ast_strdupa(mto);
-			const char *remote_display = exten;
 			/* It may seem odd to base the remote_target on the To header here,
 			 * but testing by reporters on issue ASTERISK-16735 found that basing
 			 * on the From header would cause ringing state hints to not work
@@ -12863,6 +12863,7 @@
 			char *remote_target = ast_strdupa(mto);
 
 			ast_xml_escape(exten, local_display, sizeof(local_display));
+			ast_xml_escape(exten, remote_display, sizeof(remote_display));
 
 			/* There are some limitations to how this works.  The primary one is that the
 			   callee must be dialing the same extension that is being monitored.  Simply dialing
@@ -12882,8 +12883,9 @@
 					remote_target = alloca(need);
 					snprintf(remote_target, need, "sip:%s@%s", cid_num, p->fromdomain);
 
-					remote_display = ast_strdupa(S_COR(caller->caller.id.name.valid,
-						caller->caller.id.name.str, ""));
+					ast_xml_escape(S_COR(caller->caller.id.name.valid,
+							     caller->caller.id.name.str, ""),
+						       remote_display, sizeof(remote_display));
 
 					connected_num = S_COR(caller->connected.id.number.valid,
 						caller->connected.id.number.str, "");




More information about the asterisk-commits mailing list