[Asterisk-code-review] res pjsip pubsub: Ensure remote URI contains URI only. (asterisk[13])

Joshua Colp asteriskteam at digium.com
Mon Nov 6 11:21:56 CST 2017


Joshua Colp has uploaded this change for review. ( https://gerrit.asterisk.org/7010


Change subject: res_pjsip_pubsub: Ensure remote URI contains URI only.
......................................................................

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
---
M res/res_pjsip_pubsub.c
1 file changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/10/7010/1

diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index e2c6f6c..11c6b09 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -2463,9 +2463,11 @@
 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);
+	pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, uri, buf, size);
 }
 
 const char *ast_sip_subscription_get_resource_name(struct ast_sip_subscription *sub)

-- 
To view, visit https://gerrit.asterisk.org/7010
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: If1d0cd6630f0a264856d31d2a67933109187a017
Gerrit-Change-Number: 7010
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171106/ce18d2ce/attachment.html>


More information about the asterisk-code-review mailing list