[libpri-commits] rmudgett: branch rmudgett/link_q931 r2034 - /team/rmudgett/link_q931/

SVN commits to the libpri project libpri-commits at lists.digium.com
Fri Oct 15 14:23:06 CDT 2010


Author: rmudgett
Date: Fri Oct 15 14:23:02 2010
New Revision: 2034

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=2034
Log:
Fix PTMP TE call record creation linkage.

Modified:
    team/rmudgett/link_q931/pri_internal.h
    team/rmudgett/link_q931/q931.c

Modified: team/rmudgett/link_q931/pri_internal.h
URL: http://svnview.digium.com/svn/libpri/team/rmudgett/link_q931/pri_internal.h?view=diff&rev=2034&r1=2033&r2=2034
==============================================================================
--- team/rmudgett/link_q931/pri_internal.h (original)
+++ team/rmudgett/link_q931/pri_internal.h Fri Oct 15 14:23:02 2010
@@ -450,7 +450,7 @@
 struct q931_call {
 	struct pri *pri;	/* D channel controller (master) */
 	struct pri *link;	/* Q.921 link associated with this call. */
-	q931_call *next;
+	struct q931_call *next;
 	int cr;				/* Call Reference */
 	/* Slotmap specified (bitmap of channels 31/24-1) (Channel Identifier IE) (-1 means not specified) */
 	int slotmap;

Modified: team/rmudgett/link_q931/q931.c
URL: http://svnview.digium.com/svn/libpri/team/rmudgett/link_q931/q931.c?view=diff&rev=2034&r1=2033&r2=2034
==============================================================================
--- team/rmudgett/link_q931/q931.c (original)
+++ team/rmudgett/link_q931/q931.c Fri Oct 15 14:23:02 2010
@@ -3788,6 +3788,8 @@
  */
 void q931_init_call_record(struct pri *link, struct q931_call *call, int cr)
 {
+	struct pri *ctrl;
+
 	call->cr = cr;
 	call->slotmap = -1;
 	call->channelno = -1;
@@ -3823,8 +3825,14 @@
 	q931_party_redirecting_init(&call->redirecting);
 
 	/* The call is now attached to whoever called us */
-	call->pri = PRI_MASTER(link);
-	call->link = link;
+	ctrl = PRI_MASTER(link);
+	call->pri = ctrl;
+	if (BRI_TE_PTMP(ctrl)) {
+		/* Always uses the specific TEI link. */
+		call->link = ctrl->subchannel;
+	} else {
+		call->link = link;
+	}
 }
 
 /*!
@@ -3945,6 +3953,14 @@
 	return q931_create_call_record(link, cr);
 }
 
+/*!
+ * \brief Create a new call record for an outgoing call.
+ *
+ * \param ctrl D channel controller.
+ *
+ * \retval call on success.
+ * \retval NULL on error.
+ */
 struct q931_call *q931_new_call(struct pri *ctrl)
 {
 	struct q931_call *cur;
@@ -3954,12 +3970,6 @@
 
 	/* Find the master - He has the call pool */
 	ctrl = PRI_MASTER(ctrl);
-
-	if (BRI_TE_PTMP(ctrl)) {
-		link = ctrl->subchannel;
-	} else {
-		link = ctrl;
-	}
 
 	/* Find a new call reference value. */
 	first_cref = ctrl->cref;
@@ -3991,6 +4001,7 @@
 		}
 	} while (cur);
 
+	link = ctrl;
 	return q931_create_call_record(link, cref);
 }
 
@@ -4637,6 +4648,7 @@
 	int pd = MAINTENANCE_PROTOCOL_DISCRIMINATOR_1;
 	int mt = ATT_SERVICE;
 
+/* BUGBUG need a link */
 	c = q931_getcall(ctrl, 0 | Q931_CALL_REFERENCE_FLAG);
 	if (!c) {
 		return -1;
@@ -5137,6 +5149,7 @@
 {
 	struct q931_call *c;
 
+/* BUGBUG need a link */
 	c = q931_getcall(ctrl, 0 | Q931_CALL_REFERENCE_FLAG);
 	if (!c)
 		return -1;
@@ -6572,7 +6585,7 @@
 
 	if (ctrl->debug & PRI_DEBUG_Q931_STATE) {
 		pri_message(ctrl,
-			"Received message for call %p on %p TEI/SAPI %d/%d\n",
+			"Received message for call %p on link %p TEI/SAPI %d/%d\n",
 			c, link, link->tei, link->sapi);
 	}
 




More information about the libpri-commits mailing list