[OpenSIPS-Users] drouting, triggering action when all gateways are disabled

OCEANET - Cédric BASSAGET cedric at oceanet.com
Mon Aug 5 10:13:10 CEST 2013


Hi,

I'm trying to trigger an action if drouting exits with state 
"INFO:drouting:do_routing: All the gateways are disabled". I've tried to 
check if $du is set afterwards, but it never changes, and $ru is always 
modified with ip address of gateway (dr_gateways), even if this gw is 
unreachable.

I've found after that, with more debug, that drouting does not work as I 
expect it to when calling it with 'F' parameter.

In my dr_rules table, I have my default gw, with prefix="", and the 
dr_rule for the number I'm trying to call :

dr rules
+--------+---------+------------+---------+----------+---------+--------+-------+-----------------+
| ruleid | groupid | prefix     | timerec | priority | routeid | gwlist 
| attrs | description     |
+--------+---------+------------+---------+----------+---------+--------+-------+-----------------+
|      1 | 1       |            |         |        0 |         | 11     
| NULL  | Default route   |
|    707 | 1       | 0973011200 |         |        2 |         | gw1000 
| NULL  |                 |

gw1000 is unreachable, and as there is no rule with same prefix and 
lower priority, drouting module looks for a rule with shorter prefix, 
finds rule id 1, and sends the call back to my VISP (where it comes from).
Here's the debug of opensips :

Aug  1 15:12:56 opensips-preprod1 /sbin/opensips[20329]: 
DBG:drouting:do_routing_123: enabling rule fallback
Aug  1 15:12:56 opensips-preprod1 /sbin/opensips[20329]: 
DBG:drouting:do_routing: using dr group 1, rule_idx 0, username 0973011200
Aug  1 15:12:56 opensips-preprod1 /sbin/opensips[20329]: 
DBG:drouting:internal_check_rt: found rgid 1 (rule list 0x7ff6ed8b9fe8)
Aug  1 15:12:56 opensips-preprod1 /sbin/opensips[20329]: 
INFO:drouting:do_routing: All the gateways are disabled
Aug  1 15:12:56 opensips-preprod1 /sbin/opensips[20329]: 
DBG:drouting:do_routing: doing internal fallback, prefix_len=9,rule_idx=0
Aug  1 15:12:56 opensips-preprod1 /sbin/opensips[20329]: 
DBG:drouting:do_routing: no matching for prefix "097301120"
Aug  1 15:12:56 opensips-preprod1 /sbin/opensips[20329]: 
DBG:drouting:internal_check_rt: found rgid 1 (rule list 0x7ff6ed8b94b0)

Is there a way to disable rule fllback to a shorter prefix ?

Does anybody know how I can trigger an action when "All the gateways are 
disabled" ?

Regards,
Cédric

-- 
OCEANET
---------------------------------------------------------------
[AGENCE DU MANS]
7, rue des Frênes
ZAC de la Pointe
72190 SARGE LES LE MANS
[t] +33 (0)2.43.50.26.50
[f] +33 (0)2.43.72.21.14

[AGENCE D'ANGERS]
5, rue Fleming
Angers Technopole
49066 ANGERS
[t] +33 (0)2.41.19.28.65
[f] +33 (0)2.52.19.22.00

http://www.oceanet.com
http://www.oceanet-telecom.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20130805/c9f237de/attachment.htm>


More information about the Users mailing list