[asterisk-addons-commits] mnicholson: branch 1.6.1 r728 - in /branches/1.6.1: ./ channels/ configs/

SVN commits to the Asterisk addons project asterisk-addons-commits at lists.digium.com
Wed Jan 21 12:24:10 CST 2009


Author: mnicholson
Date: Wed Jan 21 12:24:10 2009
New Revision: 728

URL: http://svn.digium.com/svn-view/asterisk-addons?view=rev&rev=728
Log:
Merged revisions 725-726 via svnmerge from 
https://origsvn.digium.com/svn/asterisk-addons/trunk

........
  r725 | mnicholson | 2009-01-21 12:09:44 -0600 (Wed, 21 Jan 2009) | 7 lines
  
  Add a 'blackberry' option for devices in chan_mobile to support blackberry
  devices' non standard HFP behavior.
  
  (closes issue #13744)
  Reported by: ciaranm
  Tested by: ciaranm, davidste, mnicholson, jongerenchaos
........
  r726 | mnicholson | 2009-01-21 12:22:33 -0600 (Wed, 21 Jan 2009) | 2 lines
  
  Added an example for the new blackberry option in mobile.conf.sample
........

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/channels/chan_mobile.c
    branches/1.6.1/configs/mobile.conf.sample

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
--- trunk-merged (original)
+++ trunk-merged Wed Jan 21 12:24:10 2009
@@ -1,1 +1,1 @@
-/trunk:1-690,707,711,715,719
+/trunk:1-690,707,711,715,719,725-726

Modified: branches/1.6.1/channels/chan_mobile.c
URL: http://svn.digium.com/svn-view/asterisk-addons/branches/1.6.1/channels/chan_mobile.c?view=diff&rev=728&r1=727&r2=728
==============================================================================
--- branches/1.6.1/channels/chan_mobile.c (original)
+++ branches/1.6.1/channels/chan_mobile.c Wed Jan 21 12:24:10 2009
@@ -160,6 +160,7 @@
 	unsigned int do_alignment_detection:1;
 	unsigned int alignment_detection_triggered:1;
 	unsigned int do_hangup:1;
+	unsigned int blackberry:1;
 	short alignment_samples[4];
 	int alignment_count;
 	char sms_txt[160];
@@ -1350,8 +1351,13 @@
 					pvt->state++;
 					nsmode = 1;
 				} else if (strstr(buf, "OK") && brsf) {
-					rfcomm_write(pvt, "AT+CIND=?\r");
-					pvt->state++;
+					if (pvt->blackberry) {
+						rfcomm_write(pvt, "AT+CMER=3,0,0,1\r");
+						pvt->state = MBL_STATE_INIT3;
+					} else {
+						rfcomm_write(pvt, "AT+CIND=?\r");
+						pvt->state++;
+					}
 				}
 				break;
 			case MBL_STATE_INIT1:
@@ -1396,14 +1402,24 @@
 						monitor = 0;
 					}
 				} else if (strstr(buf, "OK")) {
-					rfcomm_write(pvt, "AT+CMER=3,0,0,1\r");
-					pvt->state++;
+					if (pvt->blackberry) {
+						rfcomm_write(pvt, "AT+CLIP=1\r");
+						pvt->state = MBL_STATE_INIT4;
+					} else {
+						rfcomm_write(pvt, "AT+CMER=3,0,0,1\r");
+						pvt->state++;
+					}
 				}
 				break;
 			case MBL_STATE_INIT3:
 				if (strstr(buf, "OK")) {
-					rfcomm_write(pvt, "AT+CLIP=1\r");
-					pvt->state++;
+					if (pvt->blackberry) {
+						rfcomm_write(pvt, "AT+CIND=?\r");
+						pvt->state = MBL_STATE_INIT1;
+					} else {
+						rfcomm_write(pvt, "AT+CLIP=1\r");
+						pvt->state++;
+					}
 				}
 				break;
 			case MBL_STATE_INIT4:
@@ -1896,7 +1912,7 @@
 	struct ast_config *cfg = NULL;
 	char *cat = NULL;
 	struct ast_variable *var;
-	const char *id, *address, *useadapter, *port, *context, *type, *skip, *group, *master, *nocallsetup, *aligndetect;
+	const char *id, *address, *useadapter, *port, *context, *type, *skip, *group, *master, *nocallsetup, *aligndetect, *blackberry;
 	struct mbl_pvt *pvt;
 	struct adapter_pvt *adapter;
 	uint16_t vs;
@@ -1983,6 +1999,7 @@
 			skip = ast_variable_retrieve(cfg, cat, "dtmfskip");
 			group = ast_variable_retrieve(cfg, cat, "group");
 			nocallsetup = ast_variable_retrieve(cfg, cat, "nocallsetup");
+			blackberry = ast_variable_retrieve(cfg, cat, "blackberry");
 			if (!ast_strlen_zero(address) && !ast_strlen_zero(port) && !ast_strlen_zero(useadapter)) {
 				/* find the adapter */
 				AST_RWLIST_RDLOCK(&adapters);
@@ -2000,6 +2017,10 @@
 						pvt->type = MBL_TYPE_HEADSET;
 					else
 						pvt->type = MBL_TYPE_PHONE;
+
+					if (blackberry)
+						pvt->blackberry = ast_true(blackberry);
+
 					ast_copy_string(pvt->id, cat, sizeof(pvt->id));
 					str2ba(address, &pvt->addr);
 					ast_copy_string(pvt->context, S_OR(context, "default"), sizeof(pvt->context));

Modified: branches/1.6.1/configs/mobile.conf.sample
URL: http://svn.digium.com/svn-view/asterisk-addons/branches/1.6.1/configs/mobile.conf.sample?view=diff&rev=728&r1=727&r2=728
==============================================================================
--- branches/1.6.1/configs/mobile.conf.sample (original)
+++ branches/1.6.1/configs/mobile.conf.sample Wed Jan 21 12:24:10 2009
@@ -40,6 +40,14 @@
 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.
 
+[blackberry]
+address=00:60:57:32:7E:B2
+port=2
+context-incoming-mobile
+adapter=dlink
+group=1
+;blackberry=yes			; set this if you are using a blackberry device
+
 [6310i]
 address=00:60:57:32:7E:B1
 port=13




More information about the asterisk-addons-commits mailing list