[OpenSIPS-Devel] [ opensips-Bugs-3538311 ] do_routing sort parameter does not accept AVP

SourceForge.net noreply at sourceforge.net
Wed Jun 27 09:24:09 CEST 2012


Bugs item #3538311, was opened at 2012-06-27 00:24
Message generated for change (Tracker Item Submitted) made by jthebert
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3538311&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.7.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: jthebert (jthebert)
Assigned to: Nobody/Anonymous (nobody)
Summary: do_routing sort parameter does not accept AVP

Initial Comment:
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 ). 





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

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



More information about the Devel mailing list