[libss7-commits] mattf: trunk r149 - in /trunk: isup.c isup.h mtp3.c mtp3.h

SVN commits to the libss7 project libss7-commits at lists.digium.com
Fri Mar 21 16:34:01 CDT 2008


Author: mattf
Date: Fri Mar 21 16:34:01 2008
New Revision: 149

URL: http://svn.digium.com/view/libss7?view=rev&rev=149
Log:
Fix ANSI sls so that is actually keeps the same sls for the duration of a call

Modified:
    trunk/isup.c
    trunk/isup.h
    trunk/mtp3.c
    trunk/mtp3.h

Modified: trunk/isup.c
URL: http://svn.digium.com/view/libss7/trunk/isup.c?view=diff&rev=149&r1=148&r2=149
==============================================================================
--- trunk/isup.c (original)
+++ trunk/isup.c Fri Mar 21 16:34:01 2008
@@ -2031,6 +2031,10 @@
 {
 	c->cic = cic;
 	c->dpc = dpc;
+	if (ss7->switchtype == SS7_ANSI)
+		c->sls = ansi_sls_next(ss7);
+	else
+		c->sls = cic & 0xf;
 }
 
 static struct isup_call * isup_find_call(struct ss7 *ss7, struct routing_label *rl, int cic)
@@ -2210,16 +2214,12 @@
 	}
 
 	rlptr = ss7_msg_userpart(msg);
+
+
 	rl.opc = ss7->pc;
-
-	if (ss7->switchtype == SS7_ANSI) {
-		rl.sls = sls_next(ss7);
-	} else
-		rl.sls = c->cic & 0xf;
-
 	/* use CIC's DPC instead of linkset's DPC */
-
 	rl.dpc = c->dpc;
+	rl.sls = c->sls;
 	rl.type = ss7->switchtype;
 	rlsize = set_routinglabel(rlptr, &rl);
 	mh = (struct isup_h *)(rlptr + rlsize); /* Note to self, do NOT put a typecasted pointer next to an addition operation */

Modified: trunk/isup.h
URL: http://svn.digium.com/view/libss7/trunk/isup.h?view=diff&rev=149&r1=148&r2=149
==============================================================================
--- trunk/isup.h (original)
+++ trunk/isup.h Fri Mar 21 16:34:01 2008
@@ -181,7 +181,7 @@
 	int cicgroupsupervisiontype;
 	unsigned char event_info;
 	unsigned short cic;
-	unsigned short sls;
+	unsigned char sls;
 	struct isup_call *next;
 	/* set DPC according to CIC's DPC, not linkset */
 	unsigned int dpc;

Modified: trunk/mtp3.c
URL: http://svn.digium.com/view/libss7/trunk/mtp3.c?view=diff&rev=149&r1=148&r2=149
==============================================================================
--- trunk/mtp3.c (original)
+++ trunk/mtp3.c Fri Mar 21 16:34:01 2008
@@ -82,13 +82,12 @@
 	}
 }
 
-unsigned char sls_next(struct ss7 *ss7)
+unsigned char ansi_sls_next(struct ss7 *ss7)
 {
 	unsigned char res = ss7->sls;
-	if (ss7->switchtype == SS7_ITU)
-		ss7->sls = (ss7->sls + 1) % ss7->numlinks;
-	else
-		ss7->sls = (ss7->sls + 1) % 256;
+
+	ss7->sls = (ss7->sls + 1) % 256;
+
 	return res;
 }
 

Modified: trunk/mtp3.h
URL: http://svn.digium.com/view/libss7/trunk/mtp3.h?view=diff&rev=149&r1=148&r2=149
==============================================================================
--- trunk/mtp3.h (original)
+++ trunk/mtp3.h Fri Mar 21 16:34:01 2008
@@ -59,7 +59,7 @@
 
 void mtp3_start(struct ss7 *ss7);
 
-unsigned char sls_next(struct ss7 *ss7);
+unsigned char ansi_sls_next(struct ss7 *ss7);
 
 int set_routinglabel(unsigned char *sif, struct routing_label *rl);
 




More information about the libss7-commits mailing list