[libpri-commits] mattf: branch 1.4 r680 - /branches/1.4/q921.c

SVN commits to the libpri project libpri-commits at lists.digium.com
Tue Jan 27 17:22:07 CST 2009


Author: mattf
Date: Tue Jan 27 17:22:06 2009
New Revision: 680

URL: http://svn.digium.com/svn-view/libpri?view=rev&rev=680
Log:
A couple of last BRI fixes in libpri... don't discard pending iframes when we call the q921_dchannel_up routine, since we need to be able to send the ones that were queued up while the D-channel went down and is being reactivated.  Also fix some buggy logic in the frame transmission decision code.

Modified:
    branches/1.4/q921.c

Modified: branches/1.4/q921.c
URL: http://svn.digium.com/svn-view/libpri/branches/1.4/q921.c?view=diff&rev=680&r1=679&r2=680
==============================================================================
--- branches/1.4/q921.c (original)
+++ branches/1.4/q921.c Tue Jan 27 17:22:06 2009
@@ -521,7 +521,7 @@
 			pri->txqueue = f;
 		/* Immediately transmit unless we're in a recovery state, or the window
 		   size is too big */
-		if ((pri->q921_state != Q921_LINK_CONNECTION_ESTABLISHED) || (!pri->retrans && !pri->busy)) {
+		if ((pri->q921_state == Q921_LINK_CONNECTION_ESTABLISHED) && (!pri->retrans && !pri->busy)) {
 			if (pri->windowlen < pri->window) {
 				pri->windowlen++;
 				q921_transmit(pri, (q921_h *)(&f->h), f->len);
@@ -538,11 +538,14 @@
 			pri_schedule_del(pri, pri->t203_timer);
 			pri->t203_timer = 0;
 		}
-		if (pri->debug & PRI_DEBUG_Q921_DUMP)
-			pri_message(pri, "Starting T_200 timer\n");
+
 		/* Check this so that we don't try to send frames while multi frame mode is down */
-		if (pri->q921_state == Q921_LINK_CONNECTION_ESTABLISHED)
+		if (pri->q921_state == Q921_LINK_CONNECTION_ESTABLISHED) {
+			if (pri->debug & PRI_DEBUG_Q921_DUMP)
+				pri_message(pri, "Starting T_200 timer\n");
+
 			reschedule_t200(pri);		
+		}
 	} else {
 		pri_error(pri, "!! Out of memory for Q.921 transmit\n");
 		return -1;
@@ -784,9 +787,6 @@
 
 static pri_event *q921_dchannel_up(struct pri *pri)
 {
-	/* Reset counters, etc */
-	q921_reset(pri);
-	
 	/* Stop any SABME retransmissions */
 	if (pri->sabme_timer) {
 		pri_schedule_del(pri, pri->sabme_timer);




More information about the libpri-commits mailing list