Patch attached.

On Tue, May 25, 2010 at 11:24:16PM -0300, Horacio J. Peña wrote:
> Looking further, Q.704 2.3.4.1 says:
> 
> Messages not related to a signalling link may be assigned any Signalling
> Link Code (SLC) to allow load sharing of the messages, or may be assigned
> a default SLC such as 0000. They are routed in accordance with the normal
> routing function, where the (SLC) is used as SLS for load sharing.
> 
> Q.704 9.1:
> 
> The MTP restart procedure uses the Traffic Restart Allowed (TRA) message
> which contains:
> – the label, indicating the originating signalling point and the
> adjacent destination signalling point;
> – the traffic restart allowed signal.
> 
> Q.704 15.2:
> 
> The Signalling Link Code (SLC) indicates the signalling link, connecting
> the destination and originating points, to which the message is related.
> If the message is not related to a signalling link, or another particular
> code is not specified, it is coded 0000.
> 
> 
> I am not sure if I understand it correctly, but it seems to me (and to
> the spc 7000's developer) that TRA is not related to a signalling link,
> so SLC may be coded as 0000 and should be accepted.
> 
> 
> mtp.3, net_mng_receive:
> 
> struct mtp2 *winner = slc_to_mtp2(mtp2->master, rl->sls);
> 
> if (!winner) {
>         /* Could not find the given slc */
>         return 0;
> }
> 
> should be changed to something like:
> 
> struct mtp2 *winner = net_mng_uses_sls(*headerptr) ? 
> slc_to_mtp2(mtp2->master, rl->sls) : first_mtp2(mtp2->master);
> 
> (and the corresponding implementation of net_mng_uses_sls and first_mtp2)
> 
> 
> Does this sound ok? What other NET_MNG messages aren't related to a 
> signalling link ?
> 
> Thanks!
> H
> 
> On Tue, May 25, 2010 at 12:32:31PM -0300, Horacio J. Peña wrote:
> > Hola!
> > 
> > I'm having a problem getting a MTP3 link up. I'm not sure what SLC
> > should be used but if I do the ss7_add_link with slc=1, it fails like:
> > (my PC is 5000, adjpc is 7000)
> > 
> > STD_TEST OPC 5000 DPC 7000 SLS 1 H0: 1 H1: 1
> > STD_TEST OPC 7000 DPC 5000 SLS 1 H0: 1 H1: 1
> > STD_TEST OPC 5000 DPC 7000 SLS 1 H0: 1 H1: 2
> > STD_TEST OPC 7000 DPC 5000 SLS 1 H0: 1 H1: 2
> > NET_MNG  OPC 5000 DPC 7000 SLS 1 H0: 7 H1: 1 TRA
> > NET_MNG  OPC 7000 DPC 5000 SLS 0 H0: 7 H1: 1 TRA (not recognized)
> > 
> > And if I use slc=0, it fails like:
> > 
> > STD_TEST OPC 5000 DPC 7000 SLS 0 H0: 1 H1: 1
> > STD_TEST OPC 7000 DPC 5000 SLS 1 H0: 1 H1: 1
> > No siganlling link available sending message!
> > 
> > STD_TEST OPC 7000 DPC 5000 SLS 1 H0: 1 H1: 1
> > No siganlling link available sending message!
> > 
> > Am I missing something?
> > 
> > Thanks!
> > -- 
> > Horacio J. Peña
> > hor...@compendium.com.ar
> > hor...@uninet.edu
> 
> -- 
> Horacio J. Peña
> hor...@compendium.com.ar
> hor...@uninet.edu
> 
> -- 
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> asterisk-ss7 mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-ss7

-- 
Horacio J. Peña
hor...@compendium.com.ar
hor...@uninet.edu
Index: mtp3.c
===================================================================
--- mtp3.c	(revision 285)
+++ mtp3.c	(working copy)
@@ -1072,12 +1072,29 @@
 	
 }
 
+static int net_mng_uses_sls(unsigned char msg)
+{
+	switch (msg) {
+		case NET_MNG_TRA:
+		case NET_MNG_TFP:
+			return 0;
+		default:
+			return 1;
+		}
+}
+
+static struct mtp2 * first_mtp2(struct ss7 *ss7)
+{
+	return ss7->numlinks > 0 ? ss7->links[0] : NULL;
+}
+
+
 static int net_mng_receive(struct ss7 *ss7, struct mtp2 *mtp2, struct routing_label *rl, unsigned char *buf, int len)
 {
 	unsigned char *headerptr = buf + rl_size(ss7);
 	unsigned char *paramptr = headerptr + 1;
 	struct routing_label rlr;
-	struct mtp2 *winner = slc_to_mtp2(mtp2->master, rl->sls);
+	struct mtp2 *winner = net_mng_uses_sls(*headerptr) ? slc_to_mtp2(mtp2->master, rl->sls) : first_mtp2(mtp2->master);
 
 	if (!winner) {
 		/* Could not find the given slc */
-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-ss7 mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-ss7

Reply via email to