<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Unfortunately, there is a small bug in the patch for selecting CIC's
from the dialplan.<br>
<br>
In stead of:<br>
<pre wrap="">+      strncpy(cics, cic_sep + 1, sep-cic_sep-1);
+      cics[sep-cic_sep] = '\0';
</pre>
This should be:<br>
<pre wrap="">+      strncpy(cics, cic_sep + 1, sep-cic_sep-1);
+      cics[sep-cic_sep<b>-1</b>] = '\0';</pre>
And the following lines:<br>
<br>
<pre>+              strncpy(last_cic, cics_sep + 1, strlen(cics) - (cics_sep-cics) - 2);
+
+        first_cic[cics_sep-cics] = '\0';
+        last_cic[strlen(cics) - (cics_sep-cics) - 2] = '\0';</pre>
Should be<br>
<br>
<pre>+              strncpy(last_cic, cics_sep + 1, strlen(cics) - (cics_sep-cics)<b> - 1</b>);
+
+        first_cic[cics_sep-cics] = '\0';
+        last_cic[strlen(cics) - (cics_sep-cics)<b> - 1</b>] = '\0';

</pre>
When trying this new patch on our ss7 link, I tried to dial a
SS7/link1:129/0031xxx number.<br>
<br>
The first 2 lines place the \0 one byte too far.<br>
This probably did not give any problems for the ones who tested the
patch,<br>
but in my case, the 'undeterimined byte was somehow in the memory a "-".<br>
This would the content of the cics = "129-".<br>
<br>
And this causes the code to try and seperate this into a first_cic and
last_cic.<br>
With incorrect information the strncpy to the last_cic resulted in a
crash with core dump.<br>
<br>
The extra byte is not a problem, when using a for example:
SS7/link1:129-159/00316xxx<br>
Because the second fix I mentioned above, normally cuts of the last
character.<br>
By using fix 1 (to make dialing with a single cic working), fix 2 is
also needed, or else, you will have cut off one character too much.<br>
<br>
The original patch was based on chan_ss7 version 1.2.1.<br>
And it's oncluded in the main branche from netfors in version 1.4.<br>
<br>
So version chan_ss7 1.4 will also have have this bug.<br>
I will inform netfors.<br>
<br>
As a workaround it's also possible to use SS7/link1:129-129/316xxxx.<br>
This should not give you any core dumps (I think, didn't test it)<br>
<br>
With kind regards,<br>
Robert Verspuy<br>
<br>
On 04/15/2010 02:05 PM, Matthias van der Vlies wrote:
<blockquote cite="mid:4BC7011D.4030509@gmail.com" type="cite">Dear all,
  <br>
  <br>
Here in the Netherlands we have a SS7 connection with the biggest local
  <br>
telco. We have 4 E1s with the following CIC usage:
  <br>
  <br>
Linkset one:
  <br>
  <br>
1-31&nbsp;&nbsp;&nbsp; Incoming
  <br>
33-58&nbsp;&nbsp;&nbsp; Outgoing
  <br>
58-63&nbsp;&nbsp;&nbsp; Emergency Traffic
  <br>
  <br>
Linkset two:
  <br>
  <br>
1-31&nbsp;&nbsp;&nbsp; Incoming
  <br>
33-58&nbsp;&nbsp;&nbsp; Outgoing
  <br>
58-63&nbsp;&nbsp;&nbsp; Emergency Traffic
  <br>
  <br>
Using the standard Dial command we cannot select on which CICs to send
out traffic, since chan_ss7 will by default use all CICs:
  <br>
  <br>
Dial(SS7/Linkset1/number)
  <br>
  <br>
To overcome this problem we have written a patch that allows you to
select the CICs when dialing, like follows:
  <br>
  <br>
Dial(SS7/Linkset1:33-58/number)
  <br>
  <br>
This way we can specify on which CICs to send. With the patch it's also
possible to specify a single CIC like:
  <br>
  <br>
Dial(SS7/Linkset1:33/number)
  <br>
  <br>
The patch attached was written for chan_ss7 1.2.1
  <br>
  <br>
Best Regards,
  <br>
  <br>
Matthias van der Vlies
  <br>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
<title></title>
<b>Exa-Omicron</b><br>
Patroonsweg 10<br>
3892 DB Zeewolde<br>
Tel.: 088-OMICRON (66 427 66)<br>
<a href="http://www.exa-omicron.nl">http://www.exa-omicron.nl</a><br>
</div>
</body>
</html>