summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid M. Lee <dlee@digium.com>2013-01-14 15:29:22 +0000
committerDavid M. Lee <dlee@digium.com>2013-01-14 15:29:22 +0000
commita91a2891540d72ec6653796ad7a332539e794932 (patch)
treecdd18c8c0b28acc3c1a5b8e8c103a354d07c7689
parent9b475cd3efd9f32a3f0c483921bb970f5c950c3f (diff)
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 ........ Merged revisions 379020 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379021 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_sip.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index c102b84c0..692254358 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -14545,8 +14545,8 @@ static void state_notify_build_xml(struct state_notify_data *data, int full, con
if (data->state > 0 && (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
@@ -14558,6 +14558,7 @@ static void state_notify_build_xml(struct state_notify_data *data, int full, con
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
@@ -14588,8 +14589,9 @@ static void state_notify_build_xml(struct state_notify_data *data, int full, con
remote_target = ast_alloca(need);
snprintf(remote_target, need, "sip:%s@%s", connected_num, p->fromdomain);
- remote_display = ast_strdupa(S_COR(ast_channel_connected(callee)->id.name.valid,
- ast_channel_connected(callee)->id.name.str, ""));
+ ast_xml_escape(S_COR(ast_channel_connected(callee)->id.name.valid,
+ ast_channel_connected(callee)->id.name.str, ""),
+ remote_display, sizeof(remote_display));
ast_channel_unlock(callee);
callee = ast_channel_unref(callee);