Module: sip-router
Branch: tmp/tm_async_reply_support
Commit: 27cd1fac72c48fca1891ad24499af70f4a6b02c2
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=27cd1fa…
Author: Richard Good <richard.good(a)smilecoms.com>
Committer: Richard Good <richard.good(a)smilecoms.com>
Date: Fri Mar 15 17:49:55 2013 +0200
tm: bug fixes for t_continue on responses
- free uac branch once sent and update FR/RETR timers
---
modules/tm/t_suspend.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/modules/tm/t_suspend.c b/modules/tm/t_suspend.c
index 2408749..607be99 100644
--- a/modules/tm/t_suspend.c
+++ b/modules/tm/t_suspend.c
@@ -164,7 +164,6 @@ int t_continue(unsigned int hash_index, unsigned int label,
{
struct cell *t;
struct sip_msg faked_req;
- struct sip_msg faked_reply;
int branch;
struct ua_client *uac =NULL;
int ret;
@@ -285,13 +284,15 @@ int t_continue(unsigned int hash_index, unsigned int label,
) {
//TODO not sure if this will work yet - think we need to pass which branch to continue
when we call t_continue!
if (t->uac[branch].suspended_reply==1){
- LOG(L_DBG,"Found branch that has suspend reply
set!");
+ LOG(L_DBG,"Found branch that has suspend reply
set");
- LOG(L_DBG,"Disabling suspend branch!");
+ LOG(L_DBG,"Disabling suspend branch");
t->uac[branch].reply->flags &= ~FL_RPL_SUSPENDED;
+ if (t->uas.request) t->uas.request->flags&=
~FL_RPL_SUSPENDED;
+
t->uac[branch].suspended_reply = 0;
- LOG(L_DBG,"Running pre script!");
+ LOG(L_DBG,"Running pre script");
if (exec_pre_script_cb(t->uac[branch].reply,
ONREPLY_CB_TYPE)>0) {
LOG(L_DBG,"Success running pre script!");
if (run_top_route(route, t->uac[branch].reply,
0)<0){
@@ -306,7 +307,6 @@ int t_continue(unsigned int hash_index, unsigned int label,
LOG(L_DBG,"Failed running pre script!");
}
-
int reply_status;
if ( is_local(t) ) {
LOG(L_DBG,"t is local sending local reply with
status code: [%d]", t->uac[branch].reply->first_line.u.reply.statuscode);
@@ -364,9 +364,12 @@ int t_continue(unsigned int hash_index, unsigned int label,
( (last_uac_status<msg_status)
&&
((msg_status>=180) ||
(last_uac_status==0)) )
) ) { /* provisional now */
- restart_rb_fr(& uac->request,
t->fr_inv_timeout);
+ restart_rb_fr(& t->uac[branch].request,
t->fr_inv_timeout);
t->uac[branch].request.flags|=F_RB_FR_INV; /* mark
fr_inv */
}
+
+ sip_msg_free(t->uac[branch].reply);
+ t->uac[branch].reply = 0;
}
}