Module: sip-router
Branch: master
Commit: 6c3725d5535e0b5bff5c63251d37e7139f92321c
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6c3725d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sat Mar 1 10:46:57 2014 +0100
tm: 487 Request Terminated has priority when transaction is cancelled and no reply
received from downstream
- for cancel_b_method 1, timeout was sent back even when transaction was
canceled
---
modules/tm/t_reply.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index f6fc568..7fb66b8 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -1845,8 +1845,13 @@ enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int
branch,
* or a stored message */
relayed_msg = branch==relay ? p_msg : t->uac[relay].reply;
if (relayed_msg==FAKED_REPLY) {
- relayed_code = branch==relay
- ? msg_status : t->uac[relay].last_received;
+ if(t->flags & T_CANCELED) {
+ /* transaction canceled - send 487 */
+ relayed_code = 487;
+ } else {
+ relayed_code = branch==relay
+ ? msg_status : t->uac[relay].last_received;
+ }
/* use to_tag from the original request, or if not present,
* generate a new one */
if (relayed_code>=180 && t->uas.request->to