[libss7-commits] mattf: branch mattf/bug13495 r254 - /team/mattf/bug13495/

SVN commits to the libss7 project libss7-commits at lists.digium.com
Wed Feb 11 03:50:32 CST 2009


Author: mattf
Date: Wed Feb 11 03:50:31 2009
New Revision: 254

URL: http://svn.digium.com/svn-view/libss7?view=rev&rev=254
Log:
Add support for ANSI message priority in transmission...

Modified:
    team/mattf/bug13495/isup.c
    team/mattf/bug13495/mtp3.c
    team/mattf/bug13495/mtp3.h

Modified: team/mattf/bug13495/isup.c
URL: http://svn.digium.com/svn-view/libss7/team/mattf/bug13495/isup.c?view=diff&rev=254&r1=253&r2=254
==============================================================================
--- team/mattf/bug13495/isup.c (original)
+++ team/mattf/bug13495/isup.c Wed Feb 11 03:50:31 2009
@@ -115,42 +115,43 @@
 	int mand_fixed_params;
 	int mand_var_params;
 	int opt_params;
+	int ansi_priority;
 	int *param_list;
 } messages[] = {
-	{ISUP_IAM, 4, 1, 1, iam_params},
-	{ISUP_ACM, 1, 0, 1, acm_params},
-	{ISUP_ANM, 0, 0, 1, anm_params},
-	{ISUP_CON, 1, 0, 1, con_params},
-	{ISUP_REL, 0, 1, 1, rel_params},
-	{ISUP_RLC, 0, 0, 1, empty_params},
-	{ISUP_GRS, 0, 1, 0, greset_params},
-	{ISUP_GRA, 0, 1, 0, greset_params},
-	{ISUP_CGB, 1, 1, 0, cicgroup_params},
-	{ISUP_CGU, 1, 1, 0, cicgroup_params},
-	{ISUP_CGBA, 1, 1, 0, cicgroup_params},
-	{ISUP_CGUA, 1, 1, 0, cicgroup_params},
-	{ISUP_COT, 1, 0, 0, cot_params},
-	{ISUP_CCR, 0, 0, 0, empty_params},
-	{ISUP_BLO, 0, 0, 0, empty_params},
-	{ISUP_LPA, 0, 0, 0, empty_params},
-	{ISUP_UBL, 0, 0, 0, empty_params},
-	{ISUP_BLA, 0, 0, 0, empty_params},
-	{ISUP_UBA, 0, 0, 0, empty_params},
-	{ISUP_RSC, 0, 0, 0, empty_params},
-	{ISUP_CVR, 0, 0, 0, empty_params},
-	{ISUP_CVT, 0, 0, 0, empty_params},
-	{ISUP_CPG, 1, 0, 1, cpg_params},
-	{ISUP_UCIC, 0, 0, 0, empty_params},
-	{ISUP_CQM, 0, 1, 0, greset_params},
-	{ISUP_CQR, 0, 2, 0, cqr_params},
-	{ISUP_FAA, 1, 0, 1, faa_params},
-	{ISUP_FAR, 1, 0, 1, far_params},
-	{ISUP_CFN, 0, 1, 0, rel_params},
-	{ISUP_SUS, 1, 0, 1, susres_params},
-	{ISUP_RES, 1, 0, 1, susres_params},
-	{ISUP_INR, 1, 0, 0, inr_params},
-	{ISUP_INF, 1, 0, 2, inf_params},
-	{ISUP_SAM, 0, 1, 0, sam_params}
+	{ISUP_IAM, 4, 1, 1, 0, iam_params},
+	{ISUP_ACM, 1, 0, 1, 1, acm_params},
+	{ISUP_ANM, 0, 0, 1, 2, anm_params},
+	{ISUP_CON, 1, 0, 1, -1, con_params},
+	{ISUP_REL, 0, 1, 1, 1, rel_params},
+	{ISUP_RLC, 0, 0, 1, 2, empty_params},
+	{ISUP_GRS, 0, 1, 0, 0, greset_params},
+	{ISUP_GRA, 0, 1, 0, 0, greset_params},
+	{ISUP_CGB, 1, 1, 0, 0, cicgroup_params},
+	{ISUP_CGU, 1, 1, 0, 0, cicgroup_params},
+	{ISUP_CGBA, 1, 1, 0, 0, cicgroup_params},
+	{ISUP_CGUA, 1, 1, 0, 0, cicgroup_params},
+	{ISUP_COT, 1, 0, 0, 1, cot_params},
+	{ISUP_CCR, 0, 0, 0, 1, empty_params},
+	{ISUP_BLO, 0, 0, 0, 0, empty_params},
+	{ISUP_LPA, 0, 0, 0, 1, empty_params},
+	{ISUP_UBL, 0, 0, 0, 0, empty_params},
+	{ISUP_BLA, 0, 0, 0, 0, empty_params},
+	{ISUP_UBA, 0, 0, 0, 0, empty_params},
+	{ISUP_RSC, 0, 0, 0, 0, empty_params},
+	{ISUP_CVR, 0, 0, 0, 0, empty_params},
+	{ISUP_CVT, 0, 0, 0, 0, empty_params},
+	{ISUP_CPG, 1, 0, 1, 1, cpg_params},
+	{ISUP_UCIC, 0, 0, 0, 1, empty_params},
+	{ISUP_CQM, 0, 1, 0, 0, greset_params},
+	{ISUP_CQR, 0, 2, 0, 0, cqr_params},
+	{ISUP_FAA, 1, 0, 1, -1, faa_params},
+	{ISUP_FAR, 1, 0, 1, -1, far_params},
+	{ISUP_CFN, 0, 1, 0, 0, rel_params},
+	{ISUP_SUS, 1, 0, 1, 1, susres_params},
+	{ISUP_RES, 1, 0, 1, 1, susres_params},
+	{ISUP_INR, 1, 0, 0, 1, inr_params},
+	{ISUP_INF, 1, 0, 2, 1, inf_params},
+	{ISUP_SAM, 0, 1, 0, -1, sam_params}
 };
 
 static int isup_send_message(struct ss7 *ss7, struct isup_call *c, int messagetype, int parms[]);
@@ -2855,6 +2856,7 @@
 	int offset = 0;
 	int x = 0;
 	int i = 0;
+	int priority = -1;
 
 	/* Do init stuff */
 	msg = ss7_msg_new();
@@ -2898,6 +2900,7 @@
 	fixedparams = messages[ourmessage].mand_fixed_params;
 	varparams = messages[ourmessage].mand_var_params;
 	optparams = messages[ourmessage].opt_params;
+	priority = messages[ourmessage].ansi_priority;
 
 	/* Again, the ANSI exception */
 	if (ss7->switchtype == SS7_ANSI) {
@@ -2982,7 +2985,7 @@
 
 	ss7_msg_userpart_len(msg, offset + rlsize + CIC_SIZE + 1);   /* Message type length is 1 */
 
-	return mtp3_transmit(ss7, SIG_ISUP, rl, msg);
+	return mtp3_transmit(ss7, SIG_ISUP, rl, priority, msg);
 }
 
 int isup_dump(struct ss7 *ss7, struct mtp2 *link, unsigned char *buf, int len)

Modified: team/mattf/bug13495/mtp3.c
URL: http://svn.digium.com/svn-view/libss7/team/mattf/bug13495/mtp3.c?view=diff&rev=254&r1=253&r2=254
==============================================================================
--- team/mattf/bug13495/mtp3.c (original)
+++ team/mattf/bug13495/mtp3.c Wed Feb 11 03:50:31 2009
@@ -352,7 +352,7 @@
 
 	ss7_msg_userpart_len(m, rllen + testlen + 2);
 
-	if (mtp3_transmit(link->master, (ss7->switchtype == SS7_ITU) ? SIG_STD_TEST : SIG_SPEC_TEST, rl, m) > -1 &&
+	if (mtp3_transmit(link->master, (ss7->switchtype == SS7_ITU) ? SIG_STD_TEST : SIG_SPEC_TEST, rl, 3, m) > -1 &&
 		link->master->mtp3_timers[MTP3_TIMER_Q707_T1] > 0) {
 		if (link->mtp3_timer[MTP3_TIMER_Q707_T1] > -1)
 			ss7_schedule_del(ss7, &link->mtp3_timer[MTP3_TIMER_Q707_T1]);
@@ -607,12 +607,14 @@
 	unsigned char userpart;
 	struct routing_label rl;
 	struct ss7_msg *cur = *buf, *next;
+	int priority = -1;
 	
 	while (cur) {
 		next = cur->next;
 		userpart = get_userpart(cur->buf[MTP2_SIZE]);
+		priority = get_priority(cur->buf[MTP2_SIZE]);
 		get_routinglabel(ss7->switchtype, cur->buf + MTP2_SIZE + 1, &rl);
-		mtp3_transmit(ss7, userpart, rl, cur);
+		mtp3_transmit(ss7, userpart, rl, priority, cur);
 		cur = next;
 	}
 	*buf = NULL;
@@ -1494,14 +1496,14 @@
 				ss7_error(ss7, "The adjacent SP %i sent COO, ECO on the same link: %i, we answer on another!!\n", rl.dpc, rl.sls);
 			else {
 				rl.sls = link->slc;
-				return mtp3_transmit(ss7, SIG_NET_MNG, rl, m);
+				return mtp3_transmit(ss7, SIG_NET_MNG, rl, 3, m);
 			}
 		}
 		
 		for (i = 0; i < ss7->numlinks; i++) {
 			if (ss7->links[i]->std_test_passed && ss7->links[i] != link) {
 				rl.sls = ss7->links[i]->slc;
-				return mtp3_transmit(ss7, SIG_NET_MNG, rl, m);
+				return mtp3_transmit(ss7, SIG_NET_MNG, rl, 3,m);
 			}
 		}
 		
@@ -1509,22 +1511,22 @@
 		for (i = 0; i < ss7->numlinks; i++)
 			if (ss7->links[i]->std_test_passed && ss7->links[i] != link) {
 				rl.sls = ss7->links[i]->slc;
-				return mtp3_transmit(ss7, SIG_NET_MNG, rl, m);
+				return mtp3_transmit(ss7, SIG_NET_MNG, rl, 3, m);
 			}
 		if (i == ss7->numlinks && link->std_test_passed) {
 			rl.sls = link->slc;
-			return mtp3_transmit(ss7, SIG_NET_MNG, rl, m); /* if no available another links */
+			return mtp3_transmit(ss7, SIG_NET_MNG, rl, 3, m); /* if no available another links */
 		}
 	} else {
 		if (link->std_test_passed) {
 			rl.sls = link->slc;
-			return mtp3_transmit(ss7, SIG_NET_MNG, rl, m);
+			return mtp3_transmit(ss7, SIG_NET_MNG, rl, 3, m);
 		} else {
 			/* we may use another link to the same adjacent sp */
 			for (i = 0; i < link->adj_sp->numlinks; i++) {
 				if (link->adj_sp->links[i]->std_test_passed) {
 					rl.sls = link->adj_sp->links[i]->slc;
-					return mtp3_transmit(ss7, SIG_NET_MNG, rl, m);
+					return mtp3_transmit(ss7, SIG_NET_MNG, rl, 3, m);
 				}
 			}
 		}
@@ -1612,7 +1614,7 @@
 		
 		ss7_msg_userpart_len(m, rllen + testpatsize + 2);
 
-		mtp3_transmit(ss7, (ss7->switchtype == SS7_ITU) ? SIG_STD_TEST : SIG_SPEC_TEST, drl, m);
+		mtp3_transmit(ss7, (ss7->switchtype == SS7_ITU) ? SIG_STD_TEST : SIG_SPEC_TEST, drl, 3, m);
 
 		/* Update linkstate */
 		mtp3_setstate_mtp2link(ss7, mtp2, MTP2_LINKSTATE_UP);
@@ -1684,13 +1686,12 @@
 	return link;
 }
 
-int mtp3_transmit(struct ss7 *ss7, unsigned char userpart, struct routing_label rl, struct ss7_msg *m)
+int mtp3_transmit(struct ss7 *ss7, unsigned char userpart, struct routing_label rl, int priority, struct ss7_msg *m)
 {
 	unsigned char *sio;
 	unsigned char *sif;
 	struct mtp2 *winner;
 	struct ss7_msg **buffer = NULL;
-	int priority = 3;
 
 	sio = m->buf + MTP2_SIZE;
 	sif = sio + 1;
@@ -1800,7 +1801,7 @@
 
 		ss7_msg_userpart_len(m, len);
 
-		if (mtp3_transmit(ss7, (*sio) & 0xf, rl, m)) {
+		if (mtp3_transmit(ss7, (*sio) & 0xf, rl, get_priority(*sio), m)) {
 			mtp_error(ss7, "Unable to transmit message to be forwarded\n");
 			return -1;
 		}

Modified: team/mattf/bug13495/mtp3.h
URL: http://svn.digium.com/svn-view/libss7/team/mattf/bug13495/mtp3.h?view=diff&rev=254&r1=253&r2=254
==============================================================================
--- team/mattf/bug13495/mtp3.h (original)
+++ team/mattf/bug13495/mtp3.h Wed Feb 11 03:50:31 2009
@@ -193,7 +193,7 @@
 int mtp3_dump(struct ss7 *ss7, struct mtp2 *link, void *msg, int len);
 
 /* Transmit */
-int mtp3_transmit(struct ss7 *ss7, unsigned char userpart, struct routing_label rl, struct ss7_msg *m);
+int mtp3_transmit(struct ss7 *ss7, unsigned char userpart, struct routing_label rl, int priority, struct ss7_msg *m);
 
 void mtp3_alarm(struct ss7 *ss7, int fd);
 




More information about the libss7-commits mailing list