diff options
author | Jenkins2 <jenkins2@gerrit.asterisk.org> | 2017-11-13 06:43:04 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-11-13 06:43:04 -0600 |
commit | 3ee826607dff6b36cc678d96031f1905c7448937 (patch) | |
tree | 7294fad6f572c7a518fd4bdcb5cc46fa136dca0e | |
parent | f66a8d6b97e571bb9b86adeb254a4b3c6bc74635 (diff) | |
parent | 2a50fdbf99a6e968d1ccfb96e97cc8dac1cbdac4 (diff) |
Merge "res_pjsip_pubsub: Ensure remote URI contains URI only." into 15
-rw-r--r-- | res/res_pjsip_pubsub.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c index 42b1a659b..59418e4a9 100644 --- a/res/res_pjsip_pubsub.c +++ b/res/res_pjsip_pubsub.c @@ -2453,9 +2453,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) |