Module: sip-router
Branch: master
Commit: ade20f7c8c26e732b7e7ad89a6d2c22b71228f60
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ade20f7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sun Dec 19 11:56:49 2010 +0100
acc(k): take r-uri from winning branch for missed call acc
- only if the branch was relayed, otherwise uac struct might be
unfinished due to drop call in config. Use r-uri from uas struct
otherwise
- reported by Juha Henanen
---
modules_k/acc/acc_logic.c | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/modules_k/acc/acc_logic.c b/modules_k/acc/acc_logic.c
index 38666a1..dd2fd6f 100644
--- a/modules_k/acc/acc_logic.c
+++ b/modules_k/acc/acc_logic.c
@@ -326,13 +326,19 @@ static inline void acc_onreply_in(struct cell *t, struct sip_msg
*req,
static inline void on_missed(struct cell *t, struct sip_msg *req,
struct sip_msg *reply, int code)
{
- str new_uri_bk;
+ str new_uri_bk = {0, 0};
int flags_to_reset = 0;
/* set as new_uri the last branch */
- new_uri_bk = req->new_uri;
- req->new_uri = t->uac[t->nr_of_outgoings-1].uri;
- req->parsed_uri_ok = 0;
+ if (t->relayed_reply_branch>=0) {
+ new_uri_bk = req->new_uri;
+ req->new_uri = t->uac[t->relayed_reply_branch].uri;
+ req->parsed_uri_ok = 0;
+ } else {
+ new_uri_bk.len = -1;
+ new_uri_bk.s = 0;
+ }
+
/* set env variables */
env_set_to( get_rpl_to(t,reply) );
env_set_code_status( code, reply);
@@ -380,8 +386,11 @@ static inline void on_missed(struct cell *t, struct sip_msg *req,
*/
reset_acc_flag( req, flags_to_reset );
- req->new_uri = new_uri_bk;
- req->parsed_uri_ok = 0;
+ if (new_uri_bk.len>=0) {
+ req->new_uri = new_uri_bk;
+ req->parsed_uri_ok = 0;
+ }
+
}