[sr-dev] git:sr_3.0: modules/lcr: use append_branch instead of do_action for appending branch

Juha Heinanen jh at tutpro.com
Thu Nov 12 07:14:17 CET 2009


Module: sip-router
Branch: sr_3.0
Commit: e3a8a650f6b3c7a63d200c443f82c1494f6f4e07
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e3a8a650f6b3c7a63d200c443f82c1494f6f4e07

Author: Juha Heinanen <jh at tutpro.com>
Committer: Juha Heinanen <jh at tutpro.com>
Date:   Thu Nov 12 08:11:57 2009 +0200

modules/lcr: use append_branch instead of do_action for appending branch

For some reason appending branch using do_action had stopped working.
Instead of trying to find out why, replaced do_action() call with
append_branch() call.

---

 modules/lcr/lcr_mod.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/modules/lcr/lcr_mod.c b/modules/lcr/lcr_mod.c
index 2b6c719..7eb3747 100644
--- a/modules/lcr/lcr_mod.c
+++ b/modules/lcr/lcr_mod.c
@@ -2052,16 +2052,9 @@ static int next_gw(struct sip_msg* _m, char* _s1, char* _s2)
          * failure route block => append new branch. */
 	uri_str.s = r_uri;
 	uri_str.len = r_uri_len;
-	memset(&act, '\0', sizeof(act));
-	act.type = APPEND_BRANCH_T;
-	act.val[0].type = STRING_ST;
-	act.val[0].u.str = uri_str;
-	act.val[1].type = NUMBER_ST;
-	act.val[1].u.number = 0;
-	init_run_actions_ctx(&ra_ctx);
-	rval = do_action(&ra_ctx, &act, _m);
-	if (rval != 1) {
-	    LM_ERR("do_action failed with return value <%d>\n", rval);
+	LM_DBG("appending branch <%.*s>\n", uri_str.len, uri_str.s);
+	if (append_branch(_m, &uri_str, 0, 0, Q_UNSPECIFIED, 0, 0) == -1) {
+	    LM_ERR("when appending branch <%.*s>\n", rval);
 	    return -1;
 	}
     }




More information about the sr-dev mailing list