Hey All,
I have a weird issue. I’m sending a SIP INVITE to a SIP Service that send’s me back a 433, which let’s me know that the number is invalid. I then send an INVITE to a media server (FreeSwitch) to play a message that the number can’t be called, which looks to be working. But, the final ACK from the SIP client is sent back to the SIP Service versus the media server. The following diagram below depicts this: https://snag.gy/qMWfvk.jpg. The code snippet in the failure_route for the the SIP Service has this:
if (t_check_status("403|433")) { if ($avp(s:teleblock_media_enabled) == "1") { # make sure media server can route back to kamailio record_route(); revert_uri(); $ru = "sip:" + $T_reply_code + $rU + "@" + $sel(cfg_get.teleblock.media_ip) + ":" + $sel(cfg_get.teleblock.media_port); append_branch(); t_relay(); exit;
}
Hi,
ACKs in response to negative replies are what are called hop-by-hop ACKs, and should be addressed to the next hop.
Also, it is not necessary to explicitly do an append_branch() in failure_route nowadays if manipulating the RURI. It'll be done for you.
-- Alex
On Tue, Apr 17, 2018 at 02:22:39PM -0400, mack@dopensource.com wrote:
Hey All,
I have a weird issue. I’m sending a SIP INVITE to a SIP Service that send’s me back a 433, which let’s me know that the number is invalid. I then send an INVITE to a media server (FreeSwitch) to play a message that the number can’t be called, which looks to be working. But, the final ACK from the SIP client is sent back to the SIP Service versus the media server. The following diagram below depicts this: https://snag.gy/qMWfvk.jpg. The code snippet in the failure_route for the the SIP Service has this:
if (t_check_status("403|433")) { if ($avp(s:teleblock_media_enabled) == "1") { # make sure media server can route back to kamailio record_route(); revert_uri(); $ru = "sip:" + $T_reply_code + $rU + "@" + $sel(cfg_get.teleblock.media_ip) + ":" + $sel(cfg_get.teleblock.media_port); append_branch(); t_relay(); exit;
}
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Thanks Alex…
Maybe, I’m not understanding. How do I get Kamailio to send the ACK to the media server versus sending it to the SIP service. It seems that Kamailio is remembering the negative ACK, which was already sent back to the SIP service and it’s sending it again versus sending the ACK to the Media Server.
On Apr 17, 2018, at 2:26 PM, Alex Balashov abalashov@evaristesys.com wrote:
Hi,
ACKs in response to negative replies are what are called hop-by-hop ACKs, and should be addressed to the next hop.
Also, it is not necessary to explicitly do an append_branch() in failure_route nowadays if manipulating the RURI. It'll be done for you.
-- Alex
On Tue, Apr 17, 2018 at 02:22:39PM -0400, mack@dopensource.com wrote:
Hey All,
I have a weird issue. I’m sending a SIP INVITE to a SIP Service that send’s me back a 433, which let’s me know that the number is invalid. I then send an INVITE to a media server (FreeSwitch) to play a message that the number can’t be called, which looks to be working. But, the final ACK from the SIP client is sent back to the SIP Service versus the media server. The following diagram below depicts this: https://snag.gy/qMWfvk.jpg. The code snippet in the failure_route for the the SIP Service has this:
if (t_check_status("403|433")) { if ($avp(s:teleblock_media_enabled) == "1") { # make sure media server can route back to kamailio record_route(); revert_uri(); $ru = "sip:" + $T_reply_code + $rU + "@" + $sel(cfg_get.teleblock.media_ip) + ":" + $sel(cfg_get.teleblock.media_port); append_branch(); t_relay(); exit;
}
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hi Mack,
On Tue, Apr 17, 2018 at 03:03:37PM -0400, mack@dopensource.com wrote:
Maybe, I’m not understanding. How do I get Kamailio to send the ACK to the media server versus sending it to the SIP service. It seems that Kamailio is remembering the negative ACK, which was already sent back to the SIP service and it’s sending it again versus sending the ACK to the Media Server.
For a negative ACK, the sequence of events should be something like:
UA 1 Kamailio UA 2 ===================================== --- INVITE --->
<- 100 Trying - -- INVITE -->
<- 100 Trying -
<---- 433 -----
----- ACK ---->
<---- 433 ----
---- ACK ---->
Kamailio's transaction layer (TM) should absorb the negative ACK from UA 1 as part and parcel of t_check_trans().
This is all laid out in the stock config file boilerplate.
-- Alex
Thanks for the info Alex!
But, I don’t seem to get that behavior. My sngrep graphical flow located here: https://snag.gy/qMWfvk.jpg https://snag.gy/qMWfvk.jpg shows that Kamailio absorbs that negative ACK and then does an INVITE to the media server, which is what I want it to do (because I have a failure route defined) But, 200 OK from the media server is being passed back to the UA and then the ACK from the UA is being sent to the SIP service versus the media server, which doesn’t make any sense to me. I must be looking at this wrong.
Oh, you're referring to the end-to-end ACK following the 200 OK.
What is the Contact URI in the 200 OK received by the calling UA? Does the domain portion reflect the "SIP service", or the "Media server"? Is there a Record-Route set?
On Tue, Apr 17, 2018 at 11:41:14PM -0400, mack@dopensource.com wrote:
Thanks for the info Alex!
But, I don’t seem to get that behavior. My sngrep graphical flow located here: https://snag.gy/qMWfvk.jpg https://snag.gy/qMWfvk.jpg shows that Kamailio absorbs that negative ACK and then does an INVITE to the media server, which is what I want it to do (because I have a failure route defined) But, 200 OK from the media server is being passed back to the UA and then the ACK from the UA is being sent to the SIP service versus the media server, which doesn’t make any sense to me. I must be looking at this wrong.
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users