[svn-commits] rmudgett: branch 1.4 r1853 - /branches/1.4/q931.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Aug 6 13:35:39 CDT 2010


Author: rmudgett
Date: Fri Aug  6 13:35:35 2010
New Revision: 1853

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=1853
Log:
No audio on inbound J1 calls.

Incoming calls specifying the channel using a slot map could not negotiate
a B channel correctly.  Libpri historically has handled this as an any
channel request.  However, when chan_dahdi picked a new channel, libpri
sent out the recorded slot map and not the new channel selected.  Thus the
two endpoints would be attached to different B channels and the parties
would not hear anything or would hear the wrong parties.

This patch restores the historical preference of sending out the channel
id using the channel number method if a channel number is available.

JIRA LIBPRI-35
Patches:
      libpri-35_v1.4.11.3.patch uploaded by rmudgett (license 664)
      libpri-35_v1.4.patch uploaded by rmudgett (license 664)
Tested by: rmudgett

Modified:
    branches/1.4/q931.c

Modified: branches/1.4/q931.c
URL: http://svnview.digium.com/svn/libpri/branches/1.4/q931.c?view=diff&rev=1853&r1=1852&r2=1853
==============================================================================
--- branches/1.4/q931.c (original)
+++ branches/1.4/q931.c Fri Aug  6 13:35:35 2010
@@ -1003,7 +1003,12 @@
 			return -1;
 		}
 		if (ie->data[pos] & 0x10) {
-			/* Expect Slot Map */
+			/*
+			 * Expect Slot Map
+			 * Note that we are assuming only T1's use slot maps which is wrong
+			 * but oh well...  We would need to know what type of line we are
+			 * connected with (T1 or E1) to interpret the map correctly anyway.
+			 */
 			call->slotmap = 0;
 			pos++;
 			for (x=0;x<3;x++) {
@@ -1085,22 +1090,26 @@
 		&& !(call->chanflags & FLAG_WHOLE_INTERFACE)) {
 		/* The 3.2 and 3.3 octets need to be present */
 		ie->data[pos] = 0x83;
-		if (call->slotmap != -1) {
-			int octet;
-
-			/* We have to send a channel map */
-			ie->data[pos++] |= 0x10;
-			for (octet = 3; octet--;) {
-				ie->data[pos++] = (call->slotmap >> (8 * octet)) & 0xff;
-			}
-		} else {
-			/* Channel number specified */
+		if (0 < call->channelno && call->channelno != 0xff) {
+			/* Channel number specified and preferred over slot map if we have one. */
 			++pos;
 			if (ctrl->chan_mapping_logical && call->channelno > 16) {
 				ie->data[pos++] = 0x80 | (call->channelno - 1);
 			} else {
 				ie->data[pos++] = 0x80 | call->channelno;
 			}
+		} else if (call->slotmap != -1) {
+			int octet;
+
+			/* We have to send a slot map */
+			ie->data[pos++] |= 0x10;
+			for (octet = 3; octet--;) {
+				ie->data[pos++] = (call->slotmap >> (8 * octet)) & 0xff;
+			}
+		} else {
+			pri_error(ctrl, "XXX We need either a channelno or slotmap but have neither!\n");
+			/* Discard this malformed ie. */
+			return 0;
 		}
 	}
 




More information about the svn-commits mailing list