summaryrefslogtreecommitdiff
path: root/res/res_pjsip_pubsub.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-08-29 18:08:22 -0500
committerRichard Mudgett <rmudgett@digium.com>2016-09-09 17:09:54 -0500
commit30af92e78d36523f8012da5eb9aee16687d8fe61 (patch)
tree1f84280f76613282c8a81dc9b7aaf2b738201dfa /res/res_pjsip_pubsub.c
parent7580a736bb30577d7557aac9165894dc9f9583e6 (diff)
res_pjsip: Add ignore_uri_user_options option.
This implements the chan_sip legacy_useroption_parsing option but with a better name. * Made the caller-id number and redirecting number strings obtained from incoming SIP URI user fields always truncated at the first semicolon. People don't care about anything after the semicolon showing up on their displays even though the RFC allows the semicolon. ASTERISK-26316 #close Reported by: Kevin Harwell Change-Id: Ib42b0e940dd34d84c7b14bc2e90d1ba392624f62
Diffstat (limited to 'res/res_pjsip_pubsub.c')
-rw-r--r--res/res_pjsip_pubsub.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index 3ac3f342f..2fa7f34e3 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -1400,6 +1400,12 @@ static int sub_persistence_recreate(void *obj)
resource = ast_alloca(resource_size);
ast_copy_pj_str(resource, &request_uri->user, resource_size);
+ /*
+ * We may want to match without any user options getting
+ * in the way.
+ */
+ AST_SIP_USER_OPTIONS_TRUNCATE_CHECK(resource);
+
handler = subscription_get_handler_from_rdata(rdata);
if (!handler || !handler->notifier) {
ast_log(LOG_WARNING, "Failed recreating '%s' subscription: Could not get subscription handler.\n",
@@ -2815,6 +2821,12 @@ static pj_bool_t pubsub_on_rx_subscribe_request(pjsip_rx_data *rdata)
resource = ast_alloca(resource_size);
ast_copy_pj_str(resource, &request_uri_sip->user, resource_size);
+ /*
+ * We may want to match without any user options getting
+ * in the way.
+ */
+ AST_SIP_USER_OPTIONS_TRUNCATE_CHECK(resource);
+
expires_header = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_EXPIRES, rdata->msg_info.msg->hdr.next);
if (expires_header) {
@@ -3028,6 +3040,12 @@ static struct ast_sip_publication *publish_request_initial(struct ast_sip_endpoi
resource_name = ast_alloca(resource_size);
ast_copy_pj_str(resource_name, &request_uri_sip->user, resource_size);
+ /*
+ * We may want to match without any user options getting
+ * in the way.
+ */
+ AST_SIP_USER_OPTIONS_TRUNCATE_CHECK(resource_name);
+
resource = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "inbound-publication", resource_name);
if (!resource) {
ast_debug(1, "No 'inbound-publication' defined for resource '%s'\n", resource_name);