Module: kamailio
Branch: master
Commit: cb3c461a48c65d61fc563c0dc2b87fd57647dae8
URL: https://github.com/kamailio/kamailio/commit/cb3c461a48c65d61fc563c0dc2b87fd…
Author: Federico Favaro <federico(a)aereo.lan.athonet.com>
Committer: Federico Favaro <federico(a)aereo.lan.athonet.com>
Date: 2015-09-03T12:01:07+02:00
Return CSCF_RETURN_FALSE if AAR is not generated
Differentiate the cases where AAR is not sent because
of an error and the cases where AAR is not sent because
it is logically wrong to sent them at that point of the Transaction
---
Modified: modules/ims_qos/mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/cb3c461a48c65d61fc563c0dc2b87fd…
Patch: https://github.com/kamailio/kamailio/commit/cb3c461a48c65d61fc563c0dc2b87fd…
---
diff --git a/modules/ims_qos/mod.c b/modules/ims_qos/mod.c
index 833532e..d826645 100644
--- a/modules/ims_qos/mod.c
+++ b/modules/ims_qos/mod.c
@@ -622,6 +622,7 @@ static int w_rx_aar(struct sip_msg *msg, char *route, char* dir, char *c_id, int
//We don't ever do AAR on request for calling scenario...
if (msg->first_line.type != SIP_REPLY) {
LM_DBG("Can't do AAR for call session in request\n");
+ result = CSCF_RETURN_FALSE;
return result;
}
@@ -634,17 +635,19 @@ static int w_rx_aar(struct sip_msg *msg, char *route, char* dir, char *c_id, int
}
//we dont apply QoS if its not a reply to an INVITE! or UPDATE or PRACK!
- if ((t->method.len == 5 && memcmp(t->method.s, "PRACK", 5) == 0)
- || (t->method.len == 6 && (memcmp(t->method.s, "INVITE", 6) == 0
- || memcmp(t->method.s, "UPDATE", 6) == 0))) {
- if (cscf_get_content_length(msg) == 0
- || cscf_get_content_length(t->uas.request) == 0) {
- LM_DBG("No SDP offer answer -> therefore we can not do Rx AAR");
- //goto aarna; //AAR na if we dont have offer/answer pair
- return result;
- }
+ if ((t->method.len == 5 && memcmp(t->method.s, "PRACK", 5) == 0)
+ || (t->method.len == 6 && (memcmp(t->method.s, "INVITE", 6) == 0
+ || memcmp(t->method.s, "UPDATE", 6) == 0))) {
+ if (cscf_get_content_length(msg) == 0
+ || cscf_get_content_length(t->uas.request) == 0) {
+ LM_DBG("No SDP offer answer -> therefore we can not do Rx AAR");
+ //goto aarna; //AAR na if we dont have offer/answer pair
+ result = CSCF_RETURN_FALSE;
+ return result;
+ }
} else {
LM_DBG("Message is not response to INVITE, PRACK or UPDATE -> therefore we do not Rx AAR");
+ result = CSCF_RETURN_FALSE;
return result;
}
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
Module: kamailio
Branch: master
Commit: 4b2d6dd7ce1a61c964f7d996c2db4428010dd478
URL: https://github.com/kamailio/kamailio/commit/4b2d6dd7ce1a61c964f7d996c2db442…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-09-07T16:35:10+02:00
tm: enable drop in onsend_route for tm replies
- skip sending out the reply by resetting the send_socket
---
Modified: modules/tm/t_reply.c
---
Diff: https://github.com/kamailio/kamailio/commit/4b2d6dd7ce1a61c964f7d996c2db442…
Patch: https://github.com/kamailio/kamailio/commit/4b2d6dd7ce1a61c964f7d996c2db442…
---
diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index 213e8a6..8240ced 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -1922,16 +1922,19 @@ enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch,
start_final_repl_retr(t);
}
if (likely(uas_rb->dst.send_sock)) {
-
if (onsend_route_enabled(SIP_REPLY) && p_msg && (p_msg != FAKED_REPLY)) {
if (run_onsend(p_msg, &uas_rb->dst, buf, res_len)==0){
su2ip_addr(&ip, &(uas_rb->dst.to));
LOG(L_ERR, "forward_reply: reply to %s:%d(%d) dropped"
" (onsend_route)\n", ip_addr2a(&ip),
su_getport(&(uas_rb->dst.to)), uas_rb->dst.proto);
+ /* workaround for drop - reset send_sock to skip sending out */
+ uas_rb->dst.send_sock = 0;
}
}
+ }
+ if (likely(uas_rb->dst.send_sock)) {
if (SEND_PR_BUFFER( uas_rb, buf, res_len ) >= 0){
if (unlikely(!totag_retr && has_tran_tmcbs(t, TMCB_RESPONSE_OUT))){
LOCK_REPLIES( t );
@@ -1950,8 +1953,9 @@ enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch,
UNLOCK_REPLIES( t );
}
}
- } else if (unlikely(uas_rb->dst.send_sock == 0))
- ERR("no resolved dst to send reply to\n");
+ } else {
+ LM_NOTICE("dst no longer set - skiped sending the reply out\n");
+ }
/* Call put_on_wait() only if we really send out
* the reply. It can happen that the reply has been already sent from
* failure_route or from a callback and the timer has been already