[asterisk-commits] mmichelson: branch group/CCSS r219889 - /team/group/CCSS/main/ccss.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 22 18:24:56 CDT 2009


Author: mmichelson
Date: Tue Sep 22 18:24:52 2009
New Revision: 219889

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=219889
Log:
Fix some faulty logic regarding subscription
to device states.


Modified:
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=219889&r1=219888&r2=219889
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Tue Sep 22 18:24:52 2009
@@ -1584,10 +1584,6 @@
 	enum ast_cc_service_type service = parent_link->service;
 	int when;
 
-	if (gen_mon_pvt->sub) {
-		return 0;
-	}
-	
 	/* We can monitor a device for one of two services, CCBS or CCNR.
 	 *
 	 * In the case of CCBS, When the state of the device changes to "not in use" then
@@ -1615,10 +1611,9 @@
 	parent_link->child_avail_id = ast_sched_thread_add(cc_sched_thread, when * 1000,
 			ast_cc_available_timer_expire, parent_link);
 
-	if (!(gen_mon_pvt->sub = ast_event_subscribe(
+	if (!gen_mon_pvt->sub && !(gen_mon_pvt->sub = ast_event_subscribe(
 			AST_EVENT_DEVICE_STATE, generic_monitor_devstate_cb, "Requesting CC", monitor, 
 			AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, monitor->interface->name,
-			AST_EVENT_IE_STATE, AST_EVENT_IE_PLTYPE_UINT, AST_DEVICE_NOT_INUSE,
 			AST_EVENT_IE_END))) {
 		return -1;
 	}




More information about the asterisk-commits mailing list