[asterisk-commits] branch oej/metermaids-trunk r36051 - in /team/oej/metermaids-trunk: ./ config...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Jun 26 09:10:29 MST 2006


Author: oej
Date: Mon Jun 26 11:10:29 2006
New Revision: 36051

URL: http://svn.digium.com/view/asterisk?rev=36051&view=rev
Log:
More cleaning up...

Modified:
    team/oej/metermaids-trunk/configs/extensions.conf.sample
    team/oej/metermaids-trunk/devicestate.c
    team/oej/metermaids-trunk/res/res_features.c

Modified: team/oej/metermaids-trunk/configs/extensions.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/configs/extensions.conf.sample?rev=36051&r1=36050&r2=36051&view=diff
==============================================================================
--- team/oej/metermaids-trunk/configs/extensions.conf.sample (original)
+++ team/oej/metermaids-trunk/configs/extensions.conf.sample Mon Jun 26 11:10:29 2006
@@ -517,7 +517,7 @@
 
 ;If you want to subscribe to the status of a parking space, this is
 ;how you do it. Subscribe to extension 6600 in sip, and you will see
-;the status of the first parking lot with this extensions help
+;the status of the first parking lot with this extensions' help
 ;exten => 6600,hint,park:701 at parkedcalls
 ;exten => 6600,1,noop
 ;

Modified: team/oej/metermaids-trunk/devicestate.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/devicestate.c?rev=36051&r1=36050&r2=36051&view=diff
==============================================================================
--- team/oej/metermaids-trunk/devicestate.c (original)
+++ team/oej/metermaids-trunk/devicestate.c Mon Jun 26 11:10:29 2006
@@ -183,16 +183,16 @@
 /*! \brief Add device state provider */
 int ast_devstate_prov_add(const char *label, ast_devstate_prov_cb_type callback)
 {
-	struct devstate_prov *dpcb;
-
-	if (!callback || !(dpcb = ast_calloc(1, sizeof(*dpcb))))
+	struct devstate_prov *devprov;
+
+	if (!callback || !(devprov = ast_calloc(1, sizeof(*devprov))))
 		return -1;
 
-	dpcb->callback = callback;
-	ast_copy_string(dpcb->label, label, sizeof(dpcb->label));
+	devprov->callback = callback;
+	ast_copy_string(devprov->label, label, sizeof(devprov->label));
 
 	AST_LIST_LOCK(&devstate_provs);
-	AST_LIST_INSERT_HEAD(&devstate_provs, dpcb, list);
+	AST_LIST_INSERT_HEAD(&devstate_provs, devprov, list);
 	AST_LIST_UNLOCK(&devstate_provs);
 
 	return 0;
@@ -240,16 +240,16 @@
 /*! \brief Add device state watcher */
 int ast_devstate_add(ast_devstate_cb_type callback, void *data)
 {
-	struct devstate_cb *devprov;
-
-	if (!callback || !(devprov = ast_calloc(1, sizeof(*devprov))))
+	struct devstate_cb *devcb;
+
+	if (!callback || !(devcb = ast_calloc(1, sizeof(*devcb))))
 		return -1;
 
-	devprov->data = data;
-	devprov->callback = callback;
+	devcb->data = data;
+	devcb->callback = callback;
 
 	AST_LIST_LOCK(&devstate_cbs);
-	AST_LIST_INSERT_HEAD(&devstate_cbs, devprov, list);
+	AST_LIST_INSERT_HEAD(&devstate_cbs, devcb, list);
 	AST_LIST_UNLOCK(&devstate_cbs);
 
 	return 0;
@@ -368,29 +368,10 @@
 	return NULL;
 }
 
-/*! \brief test for watching group:groupname - but it does not work */
-static int groupstate(const char *data)
-{
-	char *buf = ast_strdupa(data);
-	char *group = strsep(&buf, "@");
-	int count = 0;
-
-	if (option_debug > 2)
-		ast_log(LOG_DEBUG, "Group state checking for group %s Category %s\n", group, buf);
-
-	count = ast_app_group_get_count(group, buf);
-
-	if (!count)
-		return AST_DEVICE_NOT_INUSE;
-	else
-		return AST_DEVICE_INUSE;
-} 
-
 /*! \brief Initialize the device state engine in separate thread */
 int ast_device_state_engine_init(void)
 {
 	ast_cond_init(&change_pending, NULL);
-	ast_devstate_prov_add("group", groupstate);
 	if (ast_pthread_create(&change_thread, NULL, do_devstate_changes, NULL) < 0) {
 		ast_log(LOG_ERROR, "Unable to start device state change thread.\n");
 		return -1;

Modified: team/oej/metermaids-trunk/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/oej/metermaids-trunk/res/res_features.c?rev=36051&r1=36050&r2=36051&view=diff
==============================================================================
--- team/oej/metermaids-trunk/res/res_features.c (original)
+++ team/oej/metermaids-trunk/res/res_features.c Mon Jun 26 11:10:29 2006
@@ -2037,7 +2037,7 @@
 
 	for (numext = start; numext <= stop; numext++) {
 		snprintf(exten, sizeof(exten), "%d", numext);
-		snprintf(device, sizeof(device), "Local/%s@%s/park", exten, context);
+		snprintf(device, sizeof(device), "park:%s@%s", exten, context);
 		ast_add_extension(context, 1, exten, PRIORITY_HINT, NULL, NULL, device, NULL, NULL, registrar);
 	}
 }



More information about the asterisk-commits mailing list