Module: sems Branch: master Commit: ba2db2510a1709c088e2b554c0b93a00c9cc7951 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=ba2db2510a1709c088e2b554c0b93a00c9cc7951
Author: Raphael Coeffic <[email protected]> Committer: Stefan Sayer <[email protected]> Date: Wed Jul 9 11:02:28 2014 +0200 sip: b/f: properly send ACK to remote 503 Conflicts: core/sip/trans_layer.cpp --- core/sip/trans_layer.cpp | 32 +++++++++++++++++++++++--------- 1 files changed, 23 insertions(+), 9 deletions(-) diff --git a/core/sip/trans_layer.cpp b/core/sip/trans_layer.cpp index 003f638..72b8e70 100644 --- a/core/sip/trans_layer.cpp +++ b/core/sip/trans_layer.cpp @@ -1836,13 +1836,24 @@ int _trans_layer::update_uac_reply(trans_bucket* bucket, sip_trans* t, sip_msg* if(reply_code >= 300){ - if(reply_code == 503) { - if(default_bl_ttl) { + bool forget_reply = false; + if(reply_code == 503 && + (t->state == TS_CALLING || + t->state == TS_PROCEEDING)) { + + if(!(t->flags & TR_FLAG_DISABLE_BL)) { tr_blacklist::instance()->insert(&t->msg->remote_ip, default_bl_ttl,"503"); } - if(!try_next_ip(bucket,t,false)) - goto end; + + if(msg->local_socket) { // remote reply + if(!try_next_ip(bucket,t,true)) + forget_reply = true; + } + else { // local reply + if(!try_next_ip(bucket,t,false)) + goto end; + } } // Final error reply @@ -1860,6 +1871,9 @@ int _trans_layer::update_uac_reply(trans_bucket* bucket, sip_trans* t, sip_msg* send_non_200_ack(msg,t); t->reset_timer(STIMER_D, D_TIMER, bucket->get_id()); + if(forget_reply) + goto end; + goto pass_reply; case TS_ABANDONED: @@ -2488,7 +2502,11 @@ void _trans_layer::timer_expired(trans_timer* t, trans_bucket* bucket, } break; case STIMER_M: { - try_next_ip(bucket,tr,true); + if(!try_next_ip(bucket,tr,true)) { + // Abandon old transaction + tr->clear_timer(STIMER_A); + tr->state = TS_ABANDONED; + } } break; case STIMER_BL: @@ -2654,10 +2672,6 @@ int _trans_layer::try_next_ip(trans_bucket* bucket, sip_trans* tr, tmp_msg.release(); n_tr->msg = p_msg; - // Abandon old transaction - tr->clear_timer(STIMER_A); - tr->state = TS_ABANDONED; - // take over target set n_tr->targets = tr->targets; tr->targets = NULL; _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
