diff options
author | Richard Mudgett <rmudgett@digium.com> | 2016-08-29 18:08:22 -0500 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2016-09-09 17:11:07 -0500 |
commit | b7ec070cd754db0d6e91f7822e68f1bb2ad1b0f2 (patch) | |
tree | 4d42efafb1652b9786deeb52f6573c29d04a22ae /res/res_pjsip_pubsub.c | |
parent | 236761a5b2efc54a5baa32febdaa869a669c7ce7 (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.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c index fe16c613a..015ef99c7 100644 --- a/res/res_pjsip_pubsub.c +++ b/res/res_pjsip_pubsub.c @@ -1378,6 +1378,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", @@ -2750,6 +2756,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) { @@ -2963,6 +2975,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); |