[asterisk-addons-commits] dcb: trunk r446 - /trunk/chan_mobile.c

SVN commits to the Asterisk addons project asterisk-addons-commits at lists.digium.com
Sat Sep 8 00:58:52 CDT 2007


Author: dcb
Date: Sat Sep  8 00:58:50 2007
New Revision: 446

URL: http://svn.digium.com/view/asterisk-addons?view=rev&rev=446
Log:
* Added manager event MobileStatus

Modified:
    trunk/chan_mobile.c

Modified: trunk/chan_mobile.c
URL: http://svn.digium.com/view/asterisk-addons/trunk/chan_mobile.c?view=diff&rev=446&r1=445&r2=446
==============================================================================
--- trunk/chan_mobile.c (original)
+++ trunk/chan_mobile.c Sat Sep  8 00:58:50 2007
@@ -67,6 +67,7 @@
 #include <asterisk/devicestate.h>
 #include <asterisk/causes.h>
 #include <asterisk/dsp.h>
+#include <asterisk/manager.h>
 
 #define AST_MODULE "chan_mobile"
 
@@ -206,6 +207,8 @@
 "  Dest - destination\n"
 "  Message - text of the message\n";
 
+/* Manager stuff */
+
 static struct ast_channel *mbl_new(int state, struct mbl_pvt *pvt, char *cid_num);
 static struct ast_channel *mbl_request(const char *type, int format, void *data, int *cause);
 static int mbl_call(struct ast_channel *ast, char *dest, int timeout);
@@ -1505,6 +1508,8 @@
 	
 	close(pvt->adapter->sco_socket);
 	
+	manager_event(EVENT_FLAG_SYSTEM, "MobileStatus", "Status: Disconnect\r\nDevice: %s\r\n", pvt->id);
+
 	pvt->adapter->inuse = 0;
 	
 	return NULL;
@@ -1584,6 +1589,7 @@
 	pvt->connected = 0;
 	pvt->monitor_thread = AST_PTHREADT_NULL;
 	
+	manager_event(EVENT_FLAG_SYSTEM, "MobileStatus", "Status: Disconnect\r\nDevice: %s\r\n", pvt->id);
 
 	pvt->adapter->inuse = 0;
 	
@@ -1631,6 +1637,7 @@
 							if (start_monitor(pvt)) {
 								pvt->connected = 1;
 								adapter->inuse = 1;
+								manager_event(EVENT_FLAG_SYSTEM, "MobileStatus", "Status: Connect\r\nDevice: %s\r\n", pvt->id);
 								if (option_verbose > 2)
 									ast_verbose(VERBOSE_PREFIX_3 "Bluetooth Device %s has connected.\n", pvt->id);
 							}




More information about the asterisk-addons-commits mailing list