? ast_expr.c
? ast_expr.h
? ast_expr.output
? mycore
Index: channels/chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.528
diff -u -r1.528 chan_zap.c
--- channels/chan_zap.c	29 Sep 2005 03:25:25 -0000	1.528
+++ channels/chan_zap.c	29 Sep 2005 21:14:54 -0000
@@ -576,6 +576,8 @@
 	unsigned int alerting:1;
 	unsigned int alreadyhungup:1;
 	unsigned int isidlecall:1;
+	unsigned int proceeding:1;
+	unsigned int progress:1;
 	unsigned int resetting:1;
 	unsigned int setup_ack:1;
 #endif
@@ -664,7 +666,6 @@
 	q931_call *call;
 	int prioffset;
 	int logicalspan;
-	int proceeding;
 	int dsp_features;
 #endif	
 #ifdef ZAPATA_R2
@@ -1006,7 +1007,7 @@
 	index = zt_get_index(ast, p, 0);
 	if ((index == SUB_REAL) && p->owner) {
 #ifdef ZAPATA_PRI
-		if (p->sig == SIG_PRI && ast->_state == AST_STATE_DIALING && (p->proceeding < 2)) {
+		if ((p->sig == SIG_PRI) && (ast->_state == AST_STATE_DIALING) && !p->proceeding) {
 			if (p->setup_ack) {
 				if (!pri_grab(p, p->pri)) {
 					pri_information(p->pri->pri,p->call,digit);
@@ -2428,6 +2429,7 @@
 		p->onhooktime = time(NULL);
 #ifdef ZAPATA_PRI
 		p->proceeding = 0;
+		p->progress = 0;
 		p->alerting = 0;
 		p->setup_ack = 0;
 #endif		
@@ -2657,7 +2659,7 @@
 	case SIG_PRI:
 		/* Send a pri acknowledge */
 		if (!pri_grab(p, p->pri)) {
-			p->proceeding = 2;
+			p->proceeding = 1;
 			res = pri_answer(p->pri->pri, p->call, 0, !p->digital);
 			pri_rel(p->pri);
 		} else {
@@ -3491,7 +3493,7 @@
 			p->pulsedial = 0;
 		ast_log(LOG_DEBUG, "Detected %sdigit '%c'\n", p->pulsedial ? "pulse ": "", res & 0xff);
 #ifdef ZAPATA_PRI
-		if ((p->proceeding < 2) && p->sig == SIG_PRI && p->pri && p->pri->overlapdial) {
+		if (!p->proceeding && p->sig == SIG_PRI && p->pri && p->pri->overlapdial) {
 			p->subs[index].f.frametype = AST_FRAME_NULL;
 			p->subs[index].f.subclass = 0;
 		} else {
@@ -4554,7 +4556,7 @@
 				}
 			} else if (f->frametype == AST_FRAME_DTMF) {
 #ifdef ZAPATA_PRI
-				if ((p->proceeding < 2) && p->sig==SIG_PRI && p->pri && p->pri->overlapdial) {
+				if (!p->proceeding && p->sig==SIG_PRI && p->pri && p->pri->overlapdial) {
 					/* Don't accept in-band DTMF when in overlap dial mode */
 					f->frametype = AST_FRAME_NULL;
 					f->subclass = 0;
@@ -4765,7 +4767,7 @@
 				chan->hangupcause = AST_CAUSE_USER_BUSY;
 				chan->_softhangup |= AST_SOFTHANGUP_DEV;
 				res = 0;
-			} else if (!p->proceeding && p->sig==SIG_PRI && p->pri && !p->outgoing) {
+			} else if (!p->progress && p->sig==SIG_PRI && p->pri && !p->outgoing) {
 				if (p->pri->pri) {		
 					if (!pri_grab(p, p->pri)) {
 						pri_progress(p->pri->pri,p->call, PVT_TO_CHANNEL(p), 1);
@@ -4774,7 +4776,7 @@
 					else
 						ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span);
 				}
-				p->proceeding=1;
+				p->progress = 1;
 				res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_BUSY);
 			} else
 #endif
@@ -4791,7 +4793,7 @@
 					else
 						ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span);
 				}
-				p->alerting=1;
+				p->alerting = 1;
 			}
 #endif
 			res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_RINGTONE);
@@ -4802,11 +4804,11 @@
 					 (p->sig != SIG_FXSGS)))
 					ast_setstate(chan, AST_STATE_RINGING);
 			}
-            break;
+			break;
 		case AST_CONTROL_PROCEEDING:
 			ast_log(LOG_DEBUG,"Received AST_CONTROL_PROCEEDING on %s\n",chan->name);
 #ifdef ZAPATA_PRI
-			if ((p->proceeding < 2) && p->sig==SIG_PRI && p->pri && !p->outgoing) {
+			if (!p->proceeding && p->sig==SIG_PRI && p->pri && !p->outgoing) {
 				if (p->pri->pri) {		
 					if (!pri_grab(p, p->pri)) {
 						pri_proceeding(p->pri->pri,p->call, PVT_TO_CHANNEL(p), !p->digital);
@@ -4815,7 +4817,7 @@
 					else
 						ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span);
 				}
-				p->proceeding=2;
+				p->proceeding = 1;
 			}
 #endif
 			/* don't continue in ast_indicate */
@@ -4825,7 +4827,7 @@
 			ast_log(LOG_DEBUG,"Received AST_CONTROL_PROGRESS on %s\n",chan->name);
 #ifdef ZAPATA_PRI
 			p->digital = 0;	/* Digital-only calls isn't allows any inband progress messages */
-			if ((p->proceeding < 2) && p->sig==SIG_PRI && p->pri && !p->outgoing) {
+			if (!p->progress && p->sig==SIG_PRI && p->pri && !p->outgoing) {
 				if (p->pri->pri) {		
 					if (!pri_grab(p, p->pri)) {
 						pri_progress(p->pri->pri,p->call, PVT_TO_CHANNEL(p), 1);
@@ -4834,7 +4836,7 @@
 					else
 						ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span);
 				}
-				p->proceeding=1;
+				p->progress = 1;
 			}
 #endif
 			/* don't continue in ast_indicate */
@@ -4847,7 +4849,7 @@
 				chan->hangupcause = AST_CAUSE_SWITCH_CONGESTION;
 				chan->_softhangup |= AST_SOFTHANGUP_DEV;
 				res = 0;
-			} else if (!p->proceeding && p->sig==SIG_PRI && p->pri && !p->outgoing) {
+			} else if (!p->progress && p->sig==SIG_PRI && p->pri && !p->outgoing) {
 				if (p->pri) {		
 					if (!pri_grab(p, p->pri)) {
 						pri_progress(p->pri->pri,p->call, PVT_TO_CHANNEL(p), 1);
@@ -4855,7 +4857,7 @@
 					} else
 						ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span);
 				}
-				p->proceeding=1;
+				p->progress = 1;
 				res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_CONGESTION);
 			} else
 #endif
@@ -8531,7 +8533,7 @@
 						if (ast_strlen_zero(pri->pvts[chanpos]->dop.dialstr)) {
 							zt_enable_ec(pri->pvts[chanpos]);
 							pri->pvts[chanpos]->subs[SUB_REAL].needringing =1;
-							pri->pvts[chanpos]->proceeding=2;
+							pri->pvts[chanpos]->proceeding=1;
 						} else
 							ast_log(LOG_DEBUG, "Deferring ringing notification because of extra digits to dial...\n");
 #ifdef PRI_PROGRESS_MASK
