Hi,
I'm using t_reply if onreply_route as follow:
route { ... t_on_reply("ERROR"); ... t_relay(); }
onreply_route[ERROR] { t_reply("500", "Error"); }
I have this call flow:
CLIENT KAMAILIO CARRIER |--- INVITE ---> | |---- INVITE --->| |<---- 100 ------| |<--- 100 --------| |<---- 503 ------| |---- ACK ------>| |<--- 500 --------| |---- ACK ------->| |---- CANCEL --->| |<--- 487 -------|
Kamailio sends a CANCEL message to a branch terminated by the carrier.
I'm not sure it is the good way to fix this issue (espacially in use cases involving multiple branches) but here is a patch that work for me on current master:
diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c index b2e6e53..4b9e142 100644 --- a/modules/tm/t_reply.c +++ b/modules/tm/t_reply.c @@ -571,7 +571,7 @@ static int _reply_light( struct cell *trans, char* buf, unsigned int len, } } cleanup_uac_timers( trans ); - if (is_invite(trans)){ + if (is_invite(trans && get_route_type() != TM_ONREPLY_ROUTE)){ prepare_to_cancel(trans, &cancel_data.cancel_bitmap, 0); #ifdef CANCEL_REASON_SUPPORT cancel_data.reason.cause=code;
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/315
What version are you using (kamailio -v)?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/315#issuecomment-138291847
version: kamailio 4.3.1 (x86_64/linux) f38e67 flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, $kamailio -v DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, F_MALLOC, DBG_F_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: f38e67 compiled on 10:51:33 Sep 7 2015 with gcc 4.8.4
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/315#issuecomment-138292067
I pushed a commit to master branch b7c588dff06030a82f305b210573be5bbc961cec . Can you test and report if solves the issue? The commit can be cherry-picked in branch 4.3 locally, if you want to test that version:
``` git cherry-pick -x b7c588dff06030a82f305b210573be5bbc961cec ```
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/315#issuecomment-138306672
It looks good to me in the 4.3 branch, Thanks !
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/315#issuecomment-138316062
Thanks for feedback! Closing this one here and patch will be backported for the next release in 4.3 series.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/315#issuecomment-138318308
Closed #315.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/315#event-402865651