[OpenSIPS-Devel] [ opensips-Bugs-3516034 ] DROUTING - postgresql, routid param in dr_rules

SourceForge.net noreply at sourceforge.net
Mon Apr 9 13:20:17 CEST 2012


Bugs item #3516034, was opened at 2012-04-09 02:27
Message generated for change (Comment added) made by nikbyte
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3516034&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: 1.8.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nick Altmann (nikbyte)
Assigned to: Nobody/Anonymous (nobody)
Summary: DROUTING - postgresql, routid param in dr_rules

Initial Comment:
I use drouting with postgresql in 1.8 (and 1.7 too).
In documentation written that I should not define this column if I don't like to run route after rule matched.
Here Bogdan wrote that I should leave this column null:
http://lists.opensips.org/pipermail/users/2010-January/010273.html

If I do update dr_rules set routeid='', then in log I see messages like:
Apr  9 13:22:39 opensips opensips[5645]: ERROR:drouting:build_rt_info: failed to parse the destinations
Apr  9 13:22:39 opensips opensips[5645]: ERROR:drouting:dr_load_routing_info: failed to add routing info for rule id 11 -> skipping

If I allow nulls in table (alter table dr_rules alter column routeid drop not null) and do update dr_rules set routeid=null, then I see messages like:
Apr  9 13:23:50 opensips opensips[5844]: ERROR:drouting:parse_destination_list: bad char #000 (-15723487) [8,9;11,12]
Apr  9 13:23:50 opensips opensips[5844]: ERROR:drouting:add_carrier: failed to parse the destinations
Apr  9 13:23:50 opensips opensips[5844]: ERROR:drouting:dr_load_routing_info: failed to add carrier db_id 4 -> skipping
And then opensips exits (without generating core).

If I do update dr_rules set routeid='0', then I see:
Apr  9 13:24:47 opensips opensips[6020]: WARNING:drouting:dr_load_routing_info: route <0> does not exist
I think it's not correct, but in this variant drouting works.
Also I don't understand why it cannot find route 0 if it defined in my script (If it would find it it will be great bug when it will run route[0] after rule matched???)

I think it's not correct and drouting module should accept null value in db.


----------------------------------------------------------------------

>Comment By: Nick Altmann (nikbyte)
Date: 2012-04-09 04:20

Message:
Sorry about ';', db has just migrated from 1.7.
When I set routeid='0' I see
WARNING:drouting:dr_load_routing_info: route <0> does not exist, but not
overwritting(2) default request routing table. Is it okay?
I understand about useless of setting routeid to 0, but I asked why it
writes that route 0 doesn't exists?

Now I set routeid to '' and it works okay. Thank you.

----------------------------------------------------------------------

Comment By: Vladut-Stefan Paiu (vladut-paiu)
Date: 2012-04-09 04:14

Message:
Hi,

In OpenSIPS 1.8 you cannot use ';' anymore to create gw groups inside the
gwlist field of the dr_rules table, so having a ';' in the gw list is
considered as a 'bad char' ( see the errors  ).

What you can do is define different carriers ( in the dr_carriers ) table,
and then have multiple carriers for a prefix rule, like '#1,#2'.

In regards to the routeid field, simply setting it to '' should work. I
have just tested this with 1.8 and no errors are printed. Can you please
paste the full set of errors that you receive when you set routeid to '' ?

Also, you cannot have routeid as 0. If you try to have route[0] in your
script you will get an error like :
    overwritting(2) default request routing table
and you most likely would not want to re-run the main route when a rule is
matched, that's why the main route is excluded from the routes search.

Regards
Vlad


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3516034&group_id=232389



More information about the Devel mailing list