summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2012-03-02 21:06:12 +0000
committerKinsey Moore <kmoore@digium.com>2012-03-02 21:06:12 +0000
commit8d1bde49a9255ddf5738aa453cb1daf83e7566bb (patch)
treecad2e4977b3fabd2356d7b69e2ec6ee73e46e34f /include
parent9926662aba1ed9410461cb5eb127a72477ae7fcd (diff)
Fix case-sensitivity for device-specific event subscriptions and CCSS
This change fixes case-sensitivity for device-specific subscriptions such that the technology identifier is case-insensitive while the remainder of the device string is still case-sensitive. This should also preserve the original case of the device string as passed in to the event system. CCSS is the only feature affected as it is the only consumer of device-specific event subscriptions. The second part of this patch addresses similar case-sensitivity issues within CCSS itself that prevented it from functioning correctly after the fix to the events system. This adds a unit test to verify that the event system works as expected. (closes issue ASTERISK-19422) Review: https://reviewboard.asterisk.org/r/1780/ ........ Merged revisions 357940 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 357941 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357942 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/strings.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h
index 5827dda9b..6764125d1 100644
--- a/include/asterisk/strings.h
+++ b/include/asterisk/strings.h
@@ -897,6 +897,26 @@ int ast_check_digits(const char *arg),
)
/*!
+ * \brief Convert the tech portion of a device string to upper case
+ *
+ * \retval dev_str Returns the char* passed in for convenience
+ */
+AST_INLINE_API(
+char *ast_tech_to_upper(char *dev_str),
+{
+ char *pos;
+ if (!dev_str || !strchr(dev_str, '/')) {
+ return dev_str;
+ }
+
+ for (pos = dev_str; *pos && *pos != '/'; pos++) {
+ *pos = toupper(*pos);
+ }
+ return dev_str;
+}
+)
+
+/*!
* \brief Compute a hash value on a string
*
* This famous hash algorithm was written by Dan Bernstein and is