[asterisk-addons-commits] dcb: trunk r450 - in /trunk: chan_mobile.c configs/mobile.conf.sample

SVN commits to the Asterisk addons project asterisk-addons-commits at lists.digium.com
Thu Sep 20 04:25:22 CDT 2007


Author: dcb
Date: Thu Sep 20 04:25:21 2007
New Revision: 450

URL: http://svn.digium.com/view/asterisk-addons?view=rev&rev=450
Log:
* Added support for phones that mis-represent their ability to supply call progress indications.
  Motorola L6 is a good example.
  see mobile.conf for details.

Modified:
    trunk/chan_mobile.c
    trunk/configs/mobile.conf.sample

Modified: trunk/chan_mobile.c
URL: http://svn.digium.com/view/asterisk-addons/trunk/chan_mobile.c?view=diff&rev=450&r1=449&r2=450
==============================================================================
--- trunk/chan_mobile.c (original)
+++ trunk/chan_mobile.c Thu Sep 20 04:25:21 2007
@@ -1752,7 +1752,7 @@
 	struct ast_config *cfg = NULL;
 	char *cat = NULL;
 	struct ast_variable *var;
-	const char *id, *address, *useadapter, *port, *context, *type, *skip, *group, *master;
+	const char *id, *address, *useadapter, *port, *context, *type, *skip, *group, *master, *nocallsetup;
 	struct mbl_pvt *pvt;
 	struct adapter_pvt *adapter;
 	uint16_t vs;
@@ -1777,14 +1777,13 @@
 			address = ast_variable_retrieve(cfg, cat, "address");
 			master = ast_variable_retrieve(cfg, cat, "forcemaster");
 			ast_debug(1, "Loading adapter %s %s.\n", id, address);
-			if (id && address) {
+			if (!ast_strlen_zero(id) && !ast_strlen_zero(address)) {
 				if ((adapter = ast_malloc(sizeof(struct adapter_pvt)))) {
 					ast_copy_string(adapter->id, id, sizeof(adapter->id));
 					str2ba(address, &adapter->addr);
 					adapter->inuse = 0;
 					adapter->dev_id = hci_devid(address);
 					adapter->hci_socket = hci_open_dev(adapter->dev_id);
-										
 					if (adapter->dev_id < 0 || adapter->hci_socket < 0) {
 						ast_log(LOG_ERROR, "Unable to open adapter %s. It wont be enabled.\n", adapter->id);
 						free(adapter);
@@ -1833,7 +1832,8 @@
 			type = ast_variable_retrieve(cfg, cat, "type");
 			skip = ast_variable_retrieve(cfg, cat, "dtmfskip");
 			group = ast_variable_retrieve(cfg, cat, "group");
-			if (address && port && useadapter) {
+			nocallsetup = ast_variable_retrieve(cfg, cat, "nocallsetup");
+			if (!ast_strlen_zero(address) && !ast_strlen_zero(port) && !ast_strlen_zero(useadapter)) {
 				/* find the adapter */
 				AST_LIST_TRAVERSE(&adapters, adapter, entry) {
 					if (!strcmp(adapter->id, useadapter))
@@ -1865,6 +1865,12 @@
 					pvt->sco_listener_thread = AST_PTHREADT_NULL;
 					pvt->owner = NULL;
 					pvt->no_callsetup = 0;
+					if (!ast_strlen_zero(nocallsetup)) {
+						if ((*nocallsetup == 'y') || (*nocallsetup == 'Y')) {
+							pvt->no_callsetup = 1;
+							ast_debug(1, "Setting nocallsetup mode for device %s.\n", pvt->id);
+						}
+					}
 					pvt->has_sms = 0;
 					pvt->dsp = ast_dsp_new();
 					if (skip) {

Modified: trunk/configs/mobile.conf.sample
URL: http://svn.digium.com/view/asterisk-addons/trunk/configs/mobile.conf.sample?view=diff&rev=450&r1=449&r2=450
==============================================================================
--- trunk/configs/mobile.conf.sample (original)
+++ trunk/configs/mobile.conf.sample Thu Sep 20 04:25:21 2007
@@ -35,6 +35,7 @@
 context=incoming-mobile		; dialplan context for incoming calls
 adapter=dlink			; adapter to use
 group=1				; this phone is in channel group 1
+;nocallsetup=yes		; set this only if your phone reports that it supports call progress notification, but does not do it. Motorola L6 for example.
 
 [6310i]
 address=00:60:57:32:7E:B1




More information about the asterisk-addons-commits mailing list