[OpenSIPS-Devel] [opensips] strange behavior use_next_gw (#425)
Edwin-Hoff
notifications at github.com
Mon Mar 9 15:02:35 CET 2015
I see a strange behaviour using the route_to_carrier and use_next_gw function:
If I use a sip client whichs adds :5060 to the ruri and I receive a 503 Service unavailable from the first gateway, then the ruri sent to the next gateway (using the use_next_gw() function) is mixed up. The first prefix is still there preceded by the prefix from the next gateway with the original number four digets short.
Let me explain:
The way it works ok (note, no :5060)
INVITE sip:31206655443 at mysipserver.org SIP/2.0 -> INVITE sip:123431206655443 at 10.20.30.40 SIP/2.0
<- 503 Service unavailable
-> INVITE sip:876531206655443 at 20.30.40.50 SIP/2.0
The problem i see (note, :5060)
INVITE sip:31206655443 at mysipserver.org SIP/2.0 -> INVITE sip:123431206655443 at 10.20.30.40 SIP/2.0
<- 503 Service unavailable
-> INVITE sip:876512343120665 at 20.30.40.50 SIP/2.0
So I notice the first prefix is still there: 8765 1234 3120665
I can reproduce this by using a 3CX soft client (then it goes wrong).
Here below the output of 'opensipsctl dr show'
dr gateways
+----+------+------+---------------+-------+------------+-------+------------+-------+--------+-------------+
| id | gwid | type | address | strip | pri_prefix | attrs | probe_mode | state | socket | description |
+----+------+------+---------------+-------+------------+-------+------------+-------+--------+-------------+
| 1 | 1 | 1 | 10.20.30.40 | 0 | 1234 | NULL | 0 | 0 | NULL | Gateway A |
| 2 | 2 | 2 | 20.30.40.50 | 0 | 8765 | NULL | 0 | 0 | NULL | Gateway B |
+----+------+------+---------------+-------+------------+-------+------------+-------+--------+-------------+
dr groups
+----+----------+--------+---------+-------------+
| id | username | domain | groupid | description |
+----+----------+--------+---------+-------------+
| 1 | .* | .* | 1 | Inbound |
| 2 | .* | .* | 2 | Outbound |
+----+----------+--------+---------+-------------+
dr carriers
+----+-----------+--------+-------+-------+-------+---------------------------+
| id | carrierid | gwlist | flags | state | attrs | description |
+----+-----------+--------+-------+-------+-------+---------------------------+
| 1 | 1 | 1,2 | 0 | 0 | NULL | Carrier A |
| 2 | 2 | 2,1 | 0 | 0 | NULL | Carrier B |
+----+-----------+--------+-------+-------+-------+---------------------------+
dr rules
+--------+---------+------------+---------+----------+---------+--------+-------+-------------+
| ruleid | groupid | prefix | timerec | priority | routeid | gwlist | attrs | description |
+--------+---------+------------+---------+----------+---------+--------+-------+-------------+
| 1 | 1 | 4165555555 | | 0 | NULL | 1 | NULL | Inbound |
| 2 | 2 | 4165555555 | | 0 | NULL | 1 | NULL | Outbound |
+--------+---------+------------+---------+----------+---------+--------+-------+-------------+
I tested a quick 'fix' which works:
$ru = "sip:" + $rU + "@" + $rd;
if(route_to_carrier("$avp(droute)"))
{
---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/425
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20150309/2e271c78/attachment.htm>
More information about the Devel
mailing list