contact <a href="mailto:ab@netfors.com">ab@netfors.com</a><div><br></div><div><br><br><div class="gmail_quote">On Wed, Mar 24, 2010 at 10:18 AM, Robert Verspuy <span dir="ltr"><<a href="mailto:robert@exa-omicron.nl">robert@exa-omicron.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">All,<br>
<br>
Here in the Netherlands we have a SS7 connection with the biggest local<br>
telco.<br>
This local telco has 2 redundant networks, and uses different point<br>
codes for signaling and the audio streams.<br>
<br>
we have 6 E1's connected on one server.<br>
port 1 -> network A, with signaling link<br>
port 2 -> network B, with signaling link<br>
port 3 -> network A<br>
port 4 -> network B<br>
port 5 -> network A<br>
port 6 -> network B<br>
<br>
The signaling link on network A is connected to point code 123 (just an<br>
example, I'm not using the real point codes)<br>
The signaling link on network B is connected to point code 124<br>
<br>
Through both networks we receive calls from point code 201 and 202.<br>
But this can be received through signaling link from network A or from<br>
network B.<br>
<br>
In the chan_ss7 source (l4isup.c) there is a function called find_pvt.<br>
This function gets the signaling link and cic code as argument, and<br>
returns the pvt from the ciclist.<br>
But when I receive a call for a cic on network B, through the signaling<br>
link from network A, this will not work, because the incorrect pvt will<br>
be selected.<br>
<br>
With the patch (see below) I've changed the source a bit, to take into<br>
account the originating point code.<br>
The patch below is for version 1.2.1. and I use these changes since<br>
December 2008, it's fully stable, and the server processed more then<br>
2.000.000 calls since.<br>
Having a quick look at the source of 1.3, it appears that these changes<br>
can be patched without any problems into this version too.<br>
<br>
So besides placing this patch in this mailing list,<br>
is there a contact person / location where I can deliver this patch?<br>
<br>
With kind regards,<br>
Robert Verspuy<br>
<br>
--- l4isup.c.orig 2010-03-24 09:12:46.000000000 +0100<br>
+++ l4isup.c 2010-03-24 09:00:43.000000000 +0100<br>
@@ -474,6 +474,28 @@<br>
return NULL;<br>
}<br>
<br>
+static struct ss7_chan* find_pvt_with_pc(struct link* slink, int cic,<br>
int pc)<br>
+{<br>
+ struct linkset* ls;<br>
+ int lsi;<br>
+<br>
+ ls = slink->linkset;<br>
+ if (ls->dpc == pc) {<br>
+ if (ls->cic_list[cic])<br>
+ return ls->cic_list[cic];<br>
+ for (lsi = 0; lsi < n_linksets; lsi++)<br>
+ if (is_combined_linkset(ls, &linksets[lsi]))<br>
+ if (linksets[lsi].cic_list[cic])<br>
+ return linksets[lsi].cic_list[cic];<br>
+ } else {<br>
+ for (lsi = 0; lsi < n_linksets; lsi++)<br>
+ if (is_combined_linkset(ls, &linksets[lsi]))<br>
+ if (linksets[lsi].dpc == pc)<br>
+ if (linksets[lsi].cic_list[cic])<br>
+ return linksets[lsi].cic_list[cic];<br>
+ }<br>
+ return NULL;<br>
+}<br>
<br>
/* This function must be called with the global lock mutex held. */<br>
static void remove_from_idlelist(struct ss7_chan *pvt) {<br>
@@ -2669,7 +2691,8 @@<br>
return;<br>
}<br>
lock_global();<br>
- pvt = find_pvt(slink, cic);<br>
+// pvt = find_pvt(slink, cic);<br>
+ pvt = find_pvt_with_pc(slink, cic, inmsg->opc);<br>
ast_log(LOG_DEBUG, "Process circuit message %s, CIC=%d, state=%d,<br>
reset_done=%d\n", isupmsg(inmsg->typ), cic, pvt->state, pvt->reset_done);<br>
if(!pvt->equipped) {<br>
ast_log(LOG_ERROR, "Received CIC=%d for not equipped circuit<br>
(typ=%s), link '%s'.\n", cic, isupmsg(inmsg->typ), slink->name);<br>
@@ -2743,7 +2766,8 @@<br>
return;<br>
}<br>
lock_global();<br>
- pvt = find_pvt(slink, cic);<br>
+// pvt = find_pvt(slink, cic);<br>
+ pvt = find_pvt_with_pc(slink, cic, inmsg->opc);<br>
if(!(pvt->equipped || (inmsg->typ == ISUP_CGA) || (inmsg->typ ==<br>
ISUP_CUA) || (inmsg->typ == ISUP_GRA))) {<br>
ast_log(LOG_ERROR, "Received CIC=%d for not equipped circuit<br>
(typ=%s), link '%s'.\n", cic, isupmsg(inmsg->typ), slink->name);<br>
unlock_global();<br>
@@ -4616,7 +4640,8 @@<br>
unlock_global();<br>
return;<br>
}<br>
- pvt = find_pvt(linkset->links[0], cic);<br>
+// pvt = find_pvt(linkset->links[0], cic);<br>
+ pvt = find_pvt_with_pc(linkset->links[0], cic, isup_msg.opc);<br>
ast_log(LOG_DEBUG, "Got ISUP event, typ=%s, cic=%d, dpc=%d,<br>
linkset=%s, pvt=0x%08lx, pvt.eq=%d \n", isupmsg(isup_msg.typ), cic, dpc,<br>
linkset->name, (unsigned long int) pvt, pvt ? pvt->equipped : -1);<br>
unlock_global();<br>
<br>
@@ -4665,7 +4690,8 @@<br>
/* Q.764 (2.9.5): Discard invalid message.*/<br>
ast_log(LOG_NOTICE, "ISUP decoding error, message discarded.<br>
(typ=%d)\n", isup_msg.typ);<br>
} else {<br>
- struct ss7_chan* pvt = find_pvt(event->isup.slink, isup_msg.cic);<br>
+// struct ss7_chan* pvt = find_pvt(event->isup.slink, isup_msg.cic);<br>
+ struct ss7_chan* pvt = find_pvt_with_pc(event->isup.slink,<br>
isup_msg.cic, isup_msg.opc);<br>
if (pvt) {<br>
if(pvt->equipped)<br>
process_isup_message(pvt->link, &isup_msg);<br>
<br>
<br>
--<br>
*Exa-Omicron*<br>
Patroonsweg 10<br>
3892 DB Zeewolde<br>
Tel.: 088-OMICRON (66 427 66)<br>
<a href="http://www.exa-omicron.nl" target="_blank">http://www.exa-omicron.nl</a><br>
<font color="#888888"><br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-ss7 mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-ss7" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-ss7</a><br>
</font></blockquote></div><br></div>