Переглянути джерело

tm: update T msg flags after {branch/failure}_route

- after execution of branch_route or failure_route, set the message
  flags of the temporary request back to transaction request
- 1.x behaviour
- reported and partial patch by Alex Hermann
Daniel-Constantin Mierla 14 роки тому
батько
коміт
c589ca35b2
2 змінених файлів з 6 додано та 1 видалено
  1. 3 0
      modules/tm/t_fwd.c
  2. 3 1
      modules/tm/t_reply.c

+ 3 - 0
modules/tm/t_fwd.c

@@ -1511,6 +1511,9 @@ int t_forward_nonack( struct cell *t, struct sip_msg* p_msg ,
 
 	setbflagsval(0, backup_bflags);
 
+	/* update message flags, if changed in branch route */
+	t->uas.request->flags = p_msg->flags;
+
 	/* don't forget to clear all branches processed so far */
 
 	/* things went wrong ... no new branch has been fwd-ed at all */

+ 3 - 1
modules/tm/t_reply.c

@@ -968,11 +968,13 @@ int run_failure_handlers(struct cell *t, struct sip_msg *rpl,
 		on_failure = t->on_negative;
 		t->on_negative=0;
 		if (exec_pre_script_cb(&faked_req, FAILURE_CB_TYPE)>0) {
-			/* run a reply_route action if some was marked */
+			/* run a failure_route action if some was marked */
 			if (run_top_route(failure_rt.rlist[on_failure], &faked_req, 0)<0)
 				LOG(L_ERR, "ERROR: run_failure_handlers: Error in run_top_route\n");
 			exec_post_script_cb(&faked_req, FAILURE_CB_TYPE);
 		}
+		/* update message flags, if changed in failure route */
+		t->uas.request->flags = faked_req.flags;
 	}
 
 	/* restore original environment and free the fake msg */