[asterisk-commits] mattf: branch mattf/asterisk-trunk-ntptmp r217153 - /team/mattf/asterisk-trun...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 8 14:37:51 CDT 2009


Author: mattf
Date: Tue Sep  8 14:37:48 2009
New Revision: 217153

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=217153
Log:
When we start playing ringing indications on an analog channel, make sure that we don't allow incoming audio that has been received before a progress frame is discarded.

Modified:
    team/mattf/asterisk-trunk-ntptmp/channels/chan_dahdi.c
    team/mattf/asterisk-trunk-ntptmp/channels/sig_pri.c

Modified: team/mattf/asterisk-trunk-ntptmp/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/mattf/asterisk-trunk-ntptmp/channels/chan_dahdi.c?view=diff&rev=217153&r1=217152&r2=217153
==============================================================================
--- team/mattf/asterisk-trunk-ntptmp/channels/chan_dahdi.c (original)
+++ team/mattf/asterisk-trunk-ntptmp/channels/chan_dahdi.c Tue Sep  8 14:37:48 2009
@@ -5063,6 +5063,8 @@
 		return 0;
 	}
 
+	p->dialing = 0;
+
 	if (analog_lib_handles(p->sig, p->radio, p->oprmode)) {
 		res = analog_answer(p->sig_pvt, ast);
 		ast_mutex_unlock(&p->lock);
@@ -7402,6 +7404,7 @@
 		p->subs[idx].f.offset = 0;
 		p->subs[idx].f.data.ptr = NULL;
 		p->subs[idx].f.datalen= 0;
+		ast_debug(1, "Dropping frame since I'm still dialing on %s...\n",ast->name);
 	}
 	}
 	if (p->dsp && (!p->ignoredtmf || p->callwaitcas || p->busydetect || p->callprogress || p->waitingfordt.tv_sec) && !idx) {
@@ -7637,8 +7640,14 @@
 				}
 			}
 #endif
-
-			res = tone_zone_play_tone(p->subs[idx].dfd, DAHDI_TONE_RINGTONE);
+			ast_log(LOG_ERROR,"Received AST_CONTROL_RINGING on %s\n",chan->name);
+
+			if (!p->progress) {
+				p->dialing = 1;
+				res = tone_zone_play_tone(p->subs[idx].dfd, DAHDI_TONE_RINGTONE);
+				ast_log(LOG_ERROR, "Res %d on fd %d and idx %d of indication\n", res, p->subs[idx].dfd, idx);
+			}
+
 
 			if (chan->_state != AST_STATE_UP) {
 				if ((chan->_state != AST_STATE_RING) ||
@@ -7685,6 +7694,7 @@
 				}
 			}
 #endif
+			p->progress = 1;
 			/* don't continue in ast_indicate */
 			res = 0;
 			break;

Modified: team/mattf/asterisk-trunk-ntptmp/channels/sig_pri.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/mattf/asterisk-trunk-ntptmp/channels/sig_pri.c?view=diff&rev=217153&r1=217152&r2=217153
==============================================================================
--- team/mattf/asterisk-trunk-ntptmp/channels/sig_pri.c (original)
+++ team/mattf/asterisk-trunk-ntptmp/channels/sig_pri.c Tue Sep  8 14:37:48 2009
@@ -1259,6 +1259,7 @@
 				}
 				break;
 			case PRI_EVENT_RINGING:
+				ast_log(LOG_ERROR, "Ringing event received\n");
 				chanpos = pri_find_principle(pri, e->ringing.channel);
 				if (chanpos < 0) {
 					ast_log(LOG_WARNING, "Ringing requested on unconfigured channel %d/%d span %d\n", 




More information about the asterisk-commits mailing list