Module: sip-router
Branch: tmp/ruri_branch
Commit: 914a4c04220cb6ee569e45d6d37c141d38f206a3
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=914a4c0…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Thu May 27 10:55:18 2010 +0200
core: mark uri as new on new message or seturi()
Each time a new message is received the r-uri is marked as "new"
(available for forking). The same happens when the uri is changed
or modified in the script (seturi(), rewrite_uri(), setuser(),
sethost() a.s.o.).
---
action.c | 3 +++
receive.c | 1 +
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/action.c b/action.c
index 70cec69..5e1aed1 100644
--- a/action.c
+++ b/action.c
@@ -545,6 +545,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg*
msg)
msg->new_uri.len=0;
msg->new_uri.s=0;
msg->parsed_uri_ok=0; /* invalidate current parsed uri*/
+ ruri_mark_new(); /* available for forking */
};
ret=1;
break;
@@ -593,6 +594,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg*
msg)
memcpy(msg->new_uri.s, a->val[0].u.string, len);
msg->new_uri.s[len]=0;
msg->new_uri.len=len;
+ ruri_mark_new(); /* available for forking */
ret=1;
break;
@@ -870,6 +872,7 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg*
msg)
msg->new_uri.s=new_uri;
msg->new_uri.len=crt-new_uri;
msg->parsed_uri_ok=0;
+ ruri_mark_new(); /* available for forking */
ret=1;
break;
case IF_T:
diff --git a/receive.c b/receive.c
index df26196..7f49fdc 100644
--- a/receive.c
+++ b/receive.c
@@ -149,6 +149,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info*
rcv_info)
clear_branches();
if (msg->first_line.type==SIP_REQUEST){
+ ruri_mark_new(); /* ruri is usable for forking (not consumed yet) */
if (!IS_SIP(msg)){
if ((ret=nonsip_msg_run_hooks(msg))!=NONSIP_MSG_ACCEPT){
if (unlikely(ret==NONSIP_MSG_ERROR))