summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 528403d8a..c102b84c0 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -14543,7 +14543,8 @@ static void state_notify_build_xml(struct state_notify_data *data, int full, con
ast_str_append(tmp, 0, "<?xml version=\"1.0\"?>\n");
ast_str_append(tmp, 0, "<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" version=\"%u\" state=\"%s\" entity=\"%s\">\n", p->dialogver, full ? "full" : "partial", mto);
if (data->state > 0 && (data->state & AST_EXTENSION_RINGING) && sip_cfg.notifyringing) {
- const char *local_display = exten;
+ /* Twice the extension length should be enough for XML encoding */
+ char local_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,
@@ -14556,6 +14557,8 @@ 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));
+
/* 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
the hint'd device is not sufficient. */
@@ -14575,8 +14578,9 @@ static void state_notify_build_xml(struct state_notify_data *data, int full, con
local_target = ast_alloca(need);
snprintf(local_target, need, "sip:%s@%s", cid_num, p->fromdomain);
- local_display = ast_strdupa(S_COR(ast_channel_caller(callee)->id.name.valid,
- ast_channel_caller(callee)->id.name.str, ""));
+ ast_xml_escape(S_COR(ast_channel_caller(callee)->id.name.valid,
+ ast_channel_caller(callee)->id.name.str, ""),
+ local_display, sizeof(local_display));
connected_num = S_COR(ast_channel_connected(callee)->id.number.valid,
ast_channel_connected(callee)->id.number.str, "");