[OpenSIPS-Devel] [ opensips-Bugs-2187777 ] do_routing is not allowed in FAILURE_ROUTE

SourceForge.net noreply at sourceforge.net
Mon Oct 27 17:51:52 CET 2008


Bugs item #2187777, was opened at 2008-10-23 00:52
Message generated for change (Settings changed) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2187777&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: trunk
>Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Jason Shugart (jasonshugart)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: do_routing is not allowed in FAILURE_ROUTE

Initial Comment:
Hi,
The README for the drouting module says the do_routing function can be used in failure routes, but the code is not there to handle this.  This is the message I get when checking my config:

Oct 22 15:40:06 [25024] DBG:core:find_cmd_export_t: <do_routing> not found
Oct 22 15:40:06 [25024] DBG:core:find_cmd_export_t: found <do_routing>(1) in module drouting [/lib/opensips/modules/]
Oct 22 15:40:06 [25024] CRITICAL:core:yyerror: parse error in config file, line 423, column 19-20: Command cannot be used in the block

Thanks.


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

>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2008-10-27 18:51

Message:
Hi Jason,

Thanks for the patch - I made some changes into the function
implementation:
1) do not return 0 ever - this will stop the script execution
2) skip bogus AVPs that might have numerical values (be more safe)
3) instead of creating a branch, the function just sets the new RURI
(gives you more liberty in script - like setting a socket or other params
for the new branch)
4) use a more flexible function (rewrite_uri) instead of heavy do_action.

Please test it and let me know if everything ok.

Thanks and regards,
Bogdan

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

Comment By: Jason Shugart (jasonshugart)
Date: 2008-10-24 22:36

Message:
I attached a patch that works how I would like.  It adds a next_routing
function that pops the next avp from the message and appends it to the
list.  It would return 1 if it appended a new branch, 0 if nothing was
left, and -1 on error.  This function could also be merged into the
do_routing function.  Thanks for taking a look at this.

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

Comment By: Jason Shugart (jasonshugart)
Date: 2008-10-24 20:16

Message:
Your fix was not what I was expecting.  Based on the LCR module, and my
past use of other functions in the FAILURE_ROUTE, I was expecting a
function that would pop the next URI off the AVP and do an append_branch. 
This function can be accomplished using the tools available in other
modules, so it is not entirely needed.  However I think most people who use
this module would find it easier to use a single function.  I would be
happy to send write the code and send a patch.

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

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2008-10-24 10:37

Message:
Hi Jason,

it is fixed now on SVN trunk - please update and test again.

Thanks and regards,
Bogdan

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

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



More information about the Devel mailing list