Greetings,<br><br>..we are experiencing the following problem:<br><br>We
use 2 gateways from/to the PSTN, both are datafilled in the table
dr_gateways with type = 1. In our routing script we use
is_from_gw("1") to filter requests coming from the PSTN
gateways. <br>
<br>Unfortunately the function does not detect these requests.<br><br>It
seems that the code in drouting.c (is_from_gw_1) uses not only the ip
address but also the source-port of the request to compare/match/find
the gateway. As the gateways do not use 5060 as their source port when
forwarding requests to OpenSIPS, is_from_gw_1 does not find a match
in the gateway list.<br>
<br>Is this intended per design ?<br>And if it is intended, could you please be so kind and advice a workaround ?<br>Please
no "if ($si == 'x.x.x.x')" based workarounds, as this should be
provisioned via database (eg. mysql), without the need to rewrite the
routing script every time a change is required.<br>
<br>Our drouting datafill looks like this:<br><br><span style="font-family: courier new,monospace;">>select * from dr_gateways;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+------+------+--------------------+-------+------------+-------+-------------+</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">| gwid | type | address | strip | pri_prefix | attrs | description |</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+------+------+--------------------+-------+------------+-------+-------------+</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">| 1 | 1 | 10.0.1.75 | 0 | | | pstn1 |</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">| 2 | 1 | 10.0.1.76 | 0 | | | pstn2 |</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">| 3 | 2 | 10.0.2.61 | 0 | | | ocs |</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">| 4 | 4 | 10.0.2.107 | 0 | | | pbx1 |</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">| 5 | 4 | 10.0.2.207 | 0 | | | pbx2 |</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">| 6 | 4 | 10.0.2.109 | 0 | | | pbx3 |</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">| 7 | 4 | 10.0.2.209 | 0 | | | pbx4 |</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+------+------+--------------------+-------+------------+-------+-------------+</span><br>
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">>select * from dr_rules;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+--------+---------+-------------+---------+----------+---------+---------+---------------+</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">| ruleid | groupid | prefix | timerec | priority | routeid | gwlist | description |</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+--------+---------+-------------+---------+----------+---------+---------+---------------+</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">| 1 | 0 | | | 50 | 0 | 1,2 | pstn1+pstn2 |</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">| 2 | 0 | 0043222254 | | 50 | 0 | 3 | ocs |</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">| 3 | 0 | 00432220045 | | 50 | 0 | 4,5,6,7 | pbx |</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+--------+---------+-------------+---------+----------+---------+---------+---------------+</span><br style="font-family: courier new,monospace;">
<br>We are using OpenSIPS 1.5.1 on Red Hat Enterprise Linux 5.<br><br>Looking forward to hear/read your answers and best regards,<br><br>René de Vall