summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-11-06 16:29:33 +0000
committerJoshua Colp <jcolp@digium.com>2017-11-06 13:02:43 -0500
commit36fedea8c1cb02dda1393c59e7b0e4892f201d72 (patch)
tree645e2d43e15e9dad9382d8bba9172419249d8a21 /res
parent3126c396b1d7468da79a3c6bb282217829a33c11 (diff)
res_pjsip_pubsub: Ensure remote URI contains URI only.
This change makes it so that any user of the pubsub API that requests the remote URI receives only the URI. Previously the entire string was returned, which could contain a display name. ASTERISK-27290 Change-Id: If1d0cd6630f0a264856d31d2a67933109187a017
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip_pubsub.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index 62b187951..274b03840 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -2441,9 +2441,14 @@ void ast_sip_subscription_get_local_uri(struct ast_sip_subscription *sub, char *
void ast_sip_subscription_get_remote_uri(struct ast_sip_subscription *sub, char *buf, size_t size)
{
pjsip_dialog *dlg;
+ pjsip_sip_uri *uri;
dlg = sub->tree->dlg;
- ast_copy_pj_str(buf, &dlg->remote.info_str, size);
+ uri = pjsip_uri_get_uri(dlg->remote.info->uri);
+
+ if (pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, uri, buf, size) < 0) {
+ *buf = '\0';
+ }
}
const char *ast_sip_subscription_get_resource_name(struct ast_sip_subscription *sub)