[svn-commits] mnicholson: branch 1.6.0 r729 - in /branches/1.6.0: ./ channels/ configs/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jan 21 12:24:48 CST 2009


Author: mnicholson
Date: Wed Jan 21 12:24:47 2009
New Revision: 729

URL: http://svn.digium.com/svn-view/asterisk-addons?view=rev&rev=729
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.0/   (props changed)
    branches/1.6.0/channels/chan_mobile.c
    branches/1.6.0/configs/mobile.conf.sample

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
--- trunk-merged (original)
+++ trunk-merged Wed Jan 21 12:24:47 2009
@@ -1,1 +1,1 @@
-/trunk:540-559,575,579,583,586,588,590,592,594,603,607,612,615,617,627,647,653,659,662,707,715,719
+/trunk:540-559,575,579,583,586,588,590,592,594,603,607,612,615,617,627,647,653,659,662,707,715,719,725-726

Modified: branches/1.6.0/channels/chan_mobile.c
URL: http://svn.digium.com/svn-view/asterisk-addons/branches/1.6.0/channels/chan_mobile.c?view=diff&rev=729&r1=728&r2=729
==============================================================================
--- branches/1.6.0/channels/chan_mobile.c (original)
+++ branches/1.6.0/channels/chan_mobile.c Wed Jan 21 12:24:47 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];
@@ -1334,8 +1335,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:
@@ -1380,14 +1386,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:
@@ -1874,7 +1890,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;
@@ -1959,6 +1975,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_LIST_TRAVERSE(&adapters, adapter, entry) {
@@ -1974,6 +1991,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.0/configs/mobile.conf.sample
URL: http://svn.digium.com/svn-view/asterisk-addons/branches/1.6.0/configs/mobile.conf.sample?view=diff&rev=729&r1=728&r2=729
==============================================================================
--- branches/1.6.0/configs/mobile.conf.sample (original)
+++ branches/1.6.0/configs/mobile.conf.sample Wed Jan 21 12:24:47 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 svn-commits mailing list