summaryrefslogtreecommitdiff
path: root/include
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:13:02 -0500
commitba362822f34e1967e5e15a0e81bab2f5981b014a (patch)
tree2a29699f8901f55e40b7f9270532f4b8ec405455 /include
parent9d54dd04bbdad6849aee77536ab12c5fa6620680 (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 'include')
-rw-r--r--include/asterisk/res_pjsip.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h
index 8a5ad29c5..92bdabb66 100644
--- a/include/asterisk/res_pjsip.h
+++ b/include/asterisk/res_pjsip.h
@@ -2447,6 +2447,38 @@ int ast_sip_get_mwi_tps_queue_low(void);
unsigned int ast_sip_get_mwi_disable_initial_unsolicited(void);
/*!
+ * \brief Retrieve the global setting 'ignore_uri_user_options'.
+ * \since 13.12.0
+ *
+ * \retval non zero if ignore the user field options.
+ */
+unsigned int ast_sip_get_ignore_uri_user_options(void);
+
+/*!
+ * \brief Truncate the URI user field options string if enabled.
+ * \since 13.12.0
+ *
+ * \param str URI user field string to truncate if enabled
+ *
+ * \details
+ * We need to be able to handle URI's looking like
+ * "sip:1235557890;phone-context=national@x.x.x.x;user=phone"
+ *
+ * Where the URI user field is:
+ * "1235557890;phone-context=national"
+ *
+ * When truncated the string will become:
+ * "1235557890"
+ */
+#define AST_SIP_USER_OPTIONS_TRUNCATE_CHECK(str) \
+ do { \
+ char *__semi = strchr((str), ';'); \
+ if (__semi && ast_sip_get_ignore_uri_user_options()) { \
+ *__semi = '\0'; \
+ } \
+ } while (0)
+
+/*!
* \brief Retrieve the system debug setting (yes|no|host).
*
* \note returned string needs to be de-allocated by caller.