#98 do_routing sort parameter does not accept AVP

modules (91)

- 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 ).


  • Bogdan-Andrei Iancu

    • labels: 1134770 --> modules
    • milestone: 2111916 --> trunk
    • assigned_to: nobody --> bogdan_iancu
  • Bogdan-Andrei 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.


  • Bogdan-Andrei Iancu

    • status: open --> closed
  • Bogdan-Andrei Iancu

    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.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks