[svn-commits] mmichelson: branch group/CCSS_Monitor_Restructure r242135 - /team/group/CCSS_...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Thu Jan 21 17:45:32 CST 2010
Author: mmichelson
Date: Thu Jan 21 17:45:28 2010
New Revision: 242135
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=242135
Log:
Removed the "monitor" field from the cc_core_instance structure and all references to it.
Modified:
team/group/CCSS_Monitor_Restructure/main/ccss.c
Modified: team/group/CCSS_Monitor_Restructure/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/main/ccss.c?view=diff&rev=242135&r1=242134&r2=242135
==============================================================================
--- team/group/CCSS_Monitor_Restructure/main/ccss.c (original)
+++ team/group/CCSS_Monitor_Restructure/main/ccss.c Thu Jan 21 17:45:28 2010
@@ -246,7 +246,6 @@
* This pointer's nullity is a way of testing
* whether CC has been requested yet.
*/
- struct ast_cc_monitor *monitor;
struct ast_cc_interface_tree *monitors;
};
@@ -302,8 +301,14 @@
}
enum match_flags {
- MATCH_NO_MONITOR = (1 << 0),
- MATCH_MONITOR = (1 << 1),
+ /* Only match agents that have not yet
+ * made a CC request
+ */
+ MATCH_NO_REQUEST = (1 << 0),
+ /* Only match agents that have made
+ * a CC request
+ */
+ MATCH_REQUEST = (1 << 1),
};
/* ao2_callbacks for cc_core_instances */
@@ -325,11 +330,11 @@
unsigned long match_flags = *(unsigned long *)data;
int possible_match = 0;
- if ((match_flags & MATCH_NO_MONITOR) && !core_instance->monitor) {
+ if ((match_flags & MATCH_NO_REQUEST) && core_instance->current_state < CC_CALLER_REQUESTED) {
possible_match = 1;
}
- if ((match_flags & MATCH_MONITOR) && core_instance->monitor) {
+ if ((match_flags & MATCH_REQUEST) && core_instance->current_state >= CC_CALLER_REQUESTED) {
possible_match = 1;
}
@@ -367,7 +372,7 @@
return 0;
}
- if (core_instance->monitor && !strcmp(core_instance->agent->interface, name)) {
+ if (core_instance->current_state >= CC_CALLER_REQUESTED && !strcmp(core_instance->agent->interface, name)) {
cb_data->count++;
}
return 0;
@@ -1830,7 +1835,7 @@
}
static void kill_duplicate_offers(char *caller) {
- unsigned long match_flags = MATCH_NO_MONITOR;
+ unsigned long match_flags = MATCH_NO_REQUEST;
ao2_t_callback_data(cc_core_instances, OBJ_UNLINK | OBJ_NODATA, match_agent, caller, &match_flags, "Killing duplicate offers");
}
@@ -3081,12 +3086,7 @@
ast_free(args);
return -1;
}
- if (!core_instance->monitor) {
- cc_unref(core_instance, "Unref core instance for status response. It does not have a monitor");
- ast_free(args);
- return -1;
- }
-
+
args->core_instance = core_instance;
args->devstate = devstate;
@@ -3241,7 +3241,7 @@
ast_channel_get_device_name(chan, interface, sizeof(interface));
- match_flags = MATCH_NO_MONITOR;
+ match_flags = MATCH_NO_REQUEST;
if (!(core_instance = ao2_t_callback_data(cc_core_instances, 0, match_agent, interface, &match_flags, "Find core instance for CallCompletionRequest"))) {
ast_log_dynamic_level(cc_logger_level, "Couldn't find a core instance for caller %s\n", interface);
return -1;
@@ -3277,7 +3277,7 @@
ast_channel_get_device_name(chan, interface, sizeof(interface));
- match_flags = MATCH_MONITOR;
+ match_flags = MATCH_REQUEST;
if (!(core_instance = ao2_t_callback_data(cc_core_instances, 0, match_agent, interface, &match_flags, "Find core instance for CallCompletionCancel"))) {
ast_log(LOG_WARNING, "Cannot find CC transaction to cancel for caller %s\n", interface);
return -1;
More information about the svn-commits
mailing list