summaryrefslogtreecommitdiff
path: root/include/asterisk/res_pjsip.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asterisk/res_pjsip.h')
-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 002182b9a..28ecf7f1d 100644
--- a/include/asterisk/res_pjsip.h
+++ b/include/asterisk/res_pjsip.h
@@ -2491,6 +2491,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.