Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#98 do_routing sort parameter does not accept AVP

trunk
closed
modules (91)
5
2012-08-29
2012-06-27
jthebert
No

Note
- Problem encoutered on 1.7.2 but is certainly present in previous version.
- in 1.8.0, dynamic routing has changed a lot and function parameter are not the same

The problem:
In the opensips script, I tried to use the following code ( using AVP for the group and sort parameters ):
if (!do_routing("$avp(routing_group)","$(avp(sda_sort)")) {

This is working well for the group parameter but not for the sort parameter. When starting opensips, I get this error:
ERROR:core:fixup_uint: bad number <$(avp(sda_sort)>

Looking at the code, in $SRC/modules/drouting/routing.c for the fixup fonction of drouting "fixup_do_routing(void** param, int param_no)", the code for the "sort" parameter is:
if (param_no==2) {
/* sorting algorithm */
return fixup_uint(param);
}

It seems that the function can only handle a regular string like "0" or "1" and not AVP ( while the group parameter can with the fixup function using much more code to handle the group parameter and expanding AVP ).

Discussion

    • labels: 1134770 --> modules
    • milestone: 2111916 --> trunk
    • assigned_to: nobody --> bogdan_iancu
     
  • This is not a bug as the function was never designed (or documented) to accept the flags via a variable - > I will move this ticket as "feature request" and not bug.

    Regards,
    Bogdan

     
    • status: open --> closed
     
  • As you mentioned, this is only for 1.7 which is an old release - current release and 1.8 and this version does not suffer of this issue.

    Regards,
    Bogdan