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

Joshua Colp asteriskteam at digium.com
Mon Nov 6 11:22:14 CST 2017


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


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/12/7012/1

diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index 62b1879..b3afbb1 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -2441,9 +2441,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/7012
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If1d0cd6630f0a264856d31d2a67933109187a017
Gerrit-Change-Number: 7012
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/6264a2df/attachment.html>


More information about the asterisk-code-review mailing list