summaryrefslogtreecommitdiff
path: root/main/ccss.c
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 /main/ccss.c
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 'main/ccss.c')
-rw-r--r--main/ccss.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/main/ccss.c b/main/ccss.c
index 31270c41e..fe748e98c 100644
--- a/main/ccss.c
+++ b/main/ccss.c
@@ -1232,7 +1232,10 @@ static int generic_monitor_cmp_fn(void *obj, void *arg, int flags)
static struct generic_monitor_instance_list *find_generic_monitor_instance_list(const char * const device_name)
{
- struct generic_monitor_instance_list finder = {.device_name = device_name};
+ struct generic_monitor_instance_list finder = {0};
+ char *uppertech = ast_strdupa(device_name);
+ ast_tech_to_upper(uppertech);
+ finder.device_name = uppertech;
return ao2_t_find(generic_monitors, &finder, OBJ_POINTER, "Finding generic monitor instance list");
}
@@ -1254,15 +1257,18 @@ static struct generic_monitor_instance_list *create_new_generic_list(struct ast_
{
struct generic_monitor_instance_list *generic_list = ao2_t_alloc(sizeof(*generic_list),
generic_monitor_instance_list_destructor, "allocate generic monitor instance list");
+ char * device_name;
if (!generic_list) {
return NULL;
}
- if (!(generic_list->device_name = ast_strdup(monitor->interface->device_name))) {
+ if (!(device_name = ast_strdup(monitor->interface->device_name))) {
cc_unref(generic_list, "Failed to strdup the monitor's device name");
return NULL;
}
+ ast_tech_to_upper(device_name);
+ generic_list->device_name = device_name;
if (!(generic_list->sub = ast_event_subscribe(AST_EVENT_DEVICE_STATE,
generic_monitor_devstate_cb, "Requesting CC", NULL,