[svn-commits] mnicholson: branch mnicholson/chan-mobile-refactor r797 - /team/mnicholson/ch...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Mar 3 14:18:26 CST 2009


Author: mnicholson
Date: Tue Mar  3 14:18:23 2009
New Revision: 797

URL: http://svn.digium.com/svn-view/asterisk-addons?view=rev&rev=797
Log:
removed obsoleted CIEV handling and init code

Modified:
    team/mnicholson/chan-mobile-refactor/channels/chan_mobile.c

Modified: team/mnicholson/chan-mobile-refactor/channels/chan_mobile.c
URL: http://svn.digium.com/svn-view/asterisk-addons/team/mnicholson/chan-mobile-refactor/channels/chan_mobile.c?view=diff&rev=797&r1=796&r2=797
==============================================================================
--- team/mnicholson/chan-mobile-refactor/channels/chan_mobile.c (original)
+++ team/mnicholson/chan-mobile-refactor/channels/chan_mobile.c Tue Mar  3 14:18:23 2009
@@ -158,12 +158,6 @@
 	pthread_t monitor_thread;			/* monitor thread handle */
 	char dial_number[AST_MAX_EXTENSION];		/* number for the monitor thread to dial */
 	int dial_timeout;
-	char ciev_call_0[5];				/* dynamically built reponse strings */
-	char ciev_call_1[5];
-	char ciev_callsetup_0[5];
-	char ciev_callsetup_1[5];
-	char ciev_callsetup_2[5];
-	char ciev_callsetup_3[5];
 	unsigned int no_callsetup:1;
 	unsigned int has_sms:1;
 	unsigned int sent_answer:1;
@@ -2462,8 +2456,6 @@
 	char buf[256];
 	char cid_num[AST_MAX_EXTENSION], *clip;
 	int t, i, smsi;
-	int group, group2;
-	int callp = 0, callsetupp;
 	char brsf, nsmode, *p, *p1;
 	char sms_src[13];
 	char sms_txt[160];
@@ -2503,114 +2495,6 @@
 			ast_debug(1, "[%s] %s\n", pvt->id, buf);
 
 			switch (pvt->state) {
-			case MBL_STATE_INIT:
-				if (strstr(buf, "+BRSF:")) {
-					brsf = 1;
-				} else if (strstr(buf, "ERROR") && !nsmode) {	/* Hmmm, Non-Standard Phone, just continue */
-					rfcomm_write(pvt->rfcomm_socket, "AT+CIND=?\r");
-					pvt->state++;
-					nsmode = 1;
-				} else if (strstr(buf, "OK") && brsf) {
-					if (pvt->blackberry) {
-						rfcomm_write(pvt->rfcomm_socket, "AT+CMER=3,0,0,1\r");
-						pvt->state = MBL_STATE_INIT3;
-					} else {
-						rfcomm_write(pvt->rfcomm_socket, "AT+CIND=?\r");
-						pvt->state++;
-					}
-				}
-				break;
-			case MBL_STATE_INIT1:
-				if (strstr(buf, "+CIND:")) {
-					group = callp = callsetupp = 0;
-					group2 = 1;
-					for (i=0; i<strlen(buf); i++) {
-						if (buf[i] == '(')
-							group++;
-						if (buf[i] == ')') {
-							group--;
-							if (group == 0)
-								group2++;
-						}
-						if (strstr(buf+i, "\"call\""))
-							callp = group2;
-						if (strstr(buf+i, "\"call_setup\""))
-							callsetupp = group2;
-						if (strstr(buf+i, "\"callsetup\""))
-							callsetupp = group2;
-					}
-					snprintf(pvt->ciev_call_0, sizeof(pvt->ciev_call_0), "%d,0", callp);
-					snprintf(pvt->ciev_call_1, sizeof(pvt->ciev_call_1), "%d,1", callp);
-					snprintf(pvt->ciev_callsetup_0, sizeof(pvt->ciev_callsetup_0), "%d,0", callsetupp);
-					snprintf(pvt->ciev_callsetup_1, sizeof(pvt->ciev_callsetup_1), "%d,1", callsetupp);
-					snprintf(pvt->ciev_callsetup_2, sizeof(pvt->ciev_callsetup_2), "%d,2", callsetupp);
-					snprintf(pvt->ciev_callsetup_3, sizeof(pvt->ciev_callsetup_3), "%d,3", callsetupp);
-					if (callsetupp == 0) /* This phone has no call setup indication!! ... */
-						pvt->no_callsetup = 1;
-					ast_debug(1, "CIEV_CALL=%d CIEV_CALLSETUP=%d\n", callp, callsetupp);
-				}
-				if (strstr(buf, "OK")) {
-					rfcomm_write(pvt->rfcomm_socket, "AT+CIND?\r");
-					pvt->state++;
-				}
-				break;
-			case MBL_STATE_INIT2:
-				if ((p = strstr(buf, "+CIND:"))) {
-					p += 5;
-					if (*(p+(callp*2)) == '1') {
-						ast_verb(3, "Bluetooth Device %s has a call in progress - delaying connection.\n", pvt->id);
-						break;
-					}
-				} else if (strstr(buf, "OK")) {
-					if (pvt->blackberry) {
-						rfcomm_write(pvt->rfcomm_socket, "AT+CLIP=1\r");
-						pvt->state = MBL_STATE_INIT4;
-					} else {
-						rfcomm_write(pvt->rfcomm_socket, "AT+CMER=3,0,0,1\r");
-						pvt->state++;
-					}
-				}
-				break;
-			case MBL_STATE_INIT3:
-				if (strstr(buf, "OK")) {
-					if (pvt->blackberry) {
-						rfcomm_write(pvt->rfcomm_socket, "AT+CIND=?\r");
-						pvt->state = MBL_STATE_INIT1;
-					} else {
-						rfcomm_write(pvt->rfcomm_socket, "AT+CLIP=1\r");
-						pvt->state++;
-					}
-				}
-				break;
-			case MBL_STATE_INIT4:
-				if (strstr(buf, "OK")) {
-					rfcomm_write(pvt->rfcomm_socket, "AT+VGS=15\r");
-					pvt->state++;
-				}
-				break;
-			case MBL_STATE_INIT5:
-				if (strstr(buf, "OK")) {
-					rfcomm_write(pvt->rfcomm_socket, "AT+CMGF=1\r");
-					pvt->state++;
-				}
-				break;
-			case MBL_STATE_INIT6:
-				if (strstr(buf, "ERROR")) {	/* No SMS Support ! */
-					pvt->state = MBL_STATE_PREIDLE;
-				} else if (strstr(buf, "OK")) {
-					rfcomm_write(pvt->rfcomm_socket, "AT+CNMI=2,1,0,1,0\r");
-					pvt->state++;
-				}
-				break;
-			case MBL_STATE_INIT7:
-				if (strstr(buf, "OK")) {	/* We have SMS Support */
-					pvt->has_sms = 1;
-					pvt->state = MBL_STATE_PREIDLE;
-				} else if (strstr(buf, "ERROR")) {
-					pvt->has_sms = 0;
-					pvt->state = MBL_STATE_PREIDLE;
-				}
-				break;
 			case MBL_STATE_PREIDLE: /* Nothing handled here, wait for timeout, then off we go... */
 				break;
 			case MBL_STATE_IDLE:




More information about the svn-commits mailing list