Hello,
I'm using Kamailio as sip redirect server where SBC forwards the calls to Kamailio which sends the routing back to SBC in 3xx response.
Now, I need to handle CANCEL requests sent from SBC to Kamailio. Here is the scenario: the client sends CANCEL request to SBC which responds with 200 OK and 487 Request Terminated and then sends CANCEL request to Kamailio. I'm not sure how Kamailio should handle the CANCEL request here, should it send only 200 OK back to SBC or also should send 487 request terminated?
Regards, Ali Taher
Unless you have created a transaction in the course of processing the redirect, there is no transaction to terminate, and accordingly no 487 to generate. However, these decisions are made by the default CANCEL handling (with hooks into TM) from the stock Kamailio config. You should not need any special logic of your own here.
— Sent from my iPad
On Jan 28, 2020, at 8:29 AM, Ali Taher ataher@vanrise.com wrote:
Hello,
I’m using Kamailio as sip redirect server where SBC forwards the calls to Kamailio which sends the routing back to SBC in 3xx response.
Now, I need to handle CANCEL requests sent from SBC to Kamailio. Here is the scenario: the client sends CANCEL request to SBC which responds with 200 OK and 487 Request Terminated and then sends CANCEL request to Kamailio. I’m not sure how Kamailio should handle the CANCEL request here, should it send only 200 OK back to SBC or also should send 487 request terminated?
Regards, Ali Taher _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hello Alex,
Kamailio sent 300 multiple choice back to SBC even after the SBC sent the CANCEL request , knowing that SBC sent the CANCEL 4 times as Kamailio didn’t respond to it , which is normal as in the routing logic I’m only handling INVITE packets (if (is_method("INVITE"))). So I’m confused whether I have to handle it or not.
Regards, Ali Taher
From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Alex Balashov Sent: Tuesday, January 28, 2020 3:37 PM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] SIP Redirect CANCEL handling
Unless you have created a transaction in the course of processing the redirect, there is no transaction to terminate, and accordingly no 487 to generate. However, these decisions are made by the default CANCEL handling (with hooks into TM) from the stock Kamailio config. You should not need any special logic of your own here.
— Sent from my iPad
On Jan 28, 2020, at 8:29 AM, Ali Taher <ataher@vanrise.commailto:ataher@vanrise.com> wrote: Hello,
I’m using Kamailio as sip redirect server where SBC forwards the calls to Kamailio which sends the routing back to SBC in 3xx response.
Now, I need to handle CANCEL requests sent from SBC to Kamailio. Here is the scenario: the client sends CANCEL request to SBC which responds with 200 OK and 487 Request Terminated and then sends CANCEL request to Kamailio. I’m not sure how Kamailio should handle the CANCEL request here, should it send only 200 OK back to SBC or also should send 487 request terminated?
Regards, Ali Taher _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
300 Redirect ends transaction When SBC creates invite based on Redirect message it becomes new transaction, which is not for kamailio for now but for point you getting from the Redirect response.
In this case SBC must send CANCEL not to kamailio but to point you got from the Redirect response.
On Tue, 28 Jan 2020, 14:46 Ali Taher, ataher@vanrise.com wrote:
Hello Alex,
Kamailio sent 300 multiple choice back to SBC even after the SBC sent the CANCEL request , knowing that SBC sent the CANCEL 4 times as Kamailio didn’t respond to it , which is normal as in the routing logic I’m only handling INVITE packets (if (is_method("INVITE"))).
So I’m confused whether I have to handle it or not.
Regards,
Ali Taher
*From:* sr-users sr-users-bounces@lists.kamailio.org * On Behalf Of *Alex Balashov *Sent:* Tuesday, January 28, 2020 3:37 PM *To:* Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org *Subject:* Re: [SR-Users] SIP Redirect CANCEL handling
Unless you have created a transaction in the course of processing the redirect, there is no transaction to terminate, and accordingly no 487 to generate. However, these decisions are made by the default CANCEL handling (with hooks into TM) from the stock Kamailio config. You should not need any special logic of your own here.
—
Sent from my iPad
On Jan 28, 2020, at 8:29 AM, Ali Taher ataher@vanrise.com wrote:
Hello,
I’m using Kamailio as sip redirect server where SBC forwards the calls to Kamailio which sends the routing back to SBC in 3xx response.
Now, I need to handle CANCEL requests sent from SBC to Kamailio. Here is the scenario:
the client sends CANCEL request to SBC which responds with 200 OK and 487 Request Terminated and then sends CANCEL request to Kamailio.
I’m not sure how Kamailio should handle the CANCEL request here, should it send only 200 OK back to SBC or also should send 487 request terminated?
Regards,
Ali Taher
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
CANCELs are hop-by-hop, so the SBC calor do that.
— Sent from mobile, with due apologies for brevity and errors.
On Jan 28, 2020, at 9:06 AM, Yuriy Gorlichenko ovoshlook@gmail.com wrote:
300 Redirect ends transaction When SBC creates invite based on Redirect message it becomes new transaction, which is not for kamailio for now but for point you getting from the Redirect response.
In this case SBC must send CANCEL not to kamailio but to point you got from the Redirect response.
On Tue, 28 Jan 2020, 14:46 Ali Taher, ataher@vanrise.com wrote: Hello Alex,
Kamailio sent 300 multiple choice back to SBC even after the SBC sent the CANCEL request , knowing that SBC sent the CANCEL 4 times as Kamailio didn’t respond to it , which is normal as in the routing logic I’m only handling INVITE packets (if (is_method("INVITE"))).
So I’m confused whether I have to handle it or not.
Regards,
Ali Taher
From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Alex Balashov Sent: Tuesday, January 28, 2020 3:37 PM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] SIP Redirect CANCEL handling
Unless you have created a transaction in the course of processing the redirect, there is no transaction to terminate, and accordingly no 487 to generate. However, these decisions are made by the default CANCEL handling (with hooks into TM) from the stock Kamailio config. You should not need any special logic of your own here.
—
Sent from my iPad
On Jan 28, 2020, at 8:29 AM, Ali Taher ataher@vanrise.com wrote:
Hello,
I’m using Kamailio as sip redirect server where SBC forwards the calls to Kamailio which sends the routing back to SBC in 3xx response.
Now, I need to handle CANCEL requests sent from SBC to Kamailio. Here is the scenario:
the client sends CANCEL request to SBC which responds with 200 OK and 487 Request Terminated and then sends CANCEL request to Kamailio.
I’m not sure how Kamailio should handle the CANCEL request here, should it send only 200 OK back to SBC or also should send 487 request terminated?
Regards,
Ali Taher
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
You should handle the cancel.
— Sent from mobile, with due apologies for brevity and errors.
On Jan 28, 2020, at 8:45 AM, Ali Taher ataher@vanrise.com wrote:
Hello Alex,
Kamailio sent 300 multiple choice back to SBC even after the SBC sent the CANCEL request , knowing that SBC sent the CANCEL 4 times as Kamailio didn’t respond to it , which is normal as in the routing logic I’m only handling INVITE packets (if (is_method("INVITE"))). So I’m confused whether I have to handle it or not.
Regards, Ali Taher
From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Alex Balashov Sent: Tuesday, January 28, 2020 3:37 PM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] SIP Redirect CANCEL handling
Unless you have created a transaction in the course of processing the redirect, there is no transaction to terminate, and accordingly no 487 to generate. However, these decisions are made by the default CANCEL handling (with hooks into TM) from the stock Kamailio config. You should not need any special logic of your own here.
— Sent from my iPad
On Jan 28, 2020, at 8:29 AM, Ali Taher ataher@vanrise.com wrote:
Hello,
I’m using Kamailio as sip redirect server where SBC forwards the calls to Kamailio which sends the routing back to SBC in 3xx response.
Now, I need to handle CANCEL requests sent from SBC to Kamailio. Here is the scenario: the client sends CANCEL request to SBC which responds with 200 OK and 487 Request Terminated and then sends CANCEL request to Kamailio. I’m not sure how Kamailio should handle the CANCEL request here, should it send only 200 OK back to SBC or also should send 487 request terminated?
Regards, Ali Taher _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hello Alex,
You mean handle the cancel from Kamailio side ? can you give me hint how to do it ?
Regards, Ali Taher
From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Alex Balashov Sent: Tuesday, January 28, 2020 4:07 PM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] SIP Redirect CANCEL handling
You should handle the cancel. — Sent from mobile, with due apologies for brevity and errors.
On Jan 28, 2020, at 8:45 AM, Ali Taher <ataher@vanrise.commailto:ataher@vanrise.com> wrote: Hello Alex,
Kamailio sent 300 multiple choice back to SBC even after the SBC sent the CANCEL request , knowing that SBC sent the CANCEL 4 times as Kamailio didn’t respond to it , which is normal as in the routing logic I’m only handling INVITE packets (if (is_method("INVITE"))). So I’m confused whether I have to handle it or not.
Regards, Ali Taher
From: sr-users <sr-users-bounces@lists.kamailio.orgmailto:sr-users-bounces@lists.kamailio.org> On Behalf Of Alex Balashov Sent: Tuesday, January 28, 2020 3:37 PM To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> Subject: Re: [SR-Users] SIP Redirect CANCEL handling
Unless you have created a transaction in the course of processing the redirect, there is no transaction to terminate, and accordingly no 487 to generate. However, these decisions are made by the default CANCEL handling (with hooks into TM) from the stock Kamailio config. You should not need any special logic of your own here.
— Sent from my iPad
On Jan 28, 2020, at 8:29 AM, Ali Taher <ataher@vanrise.commailto:ataher@vanrise.com> wrote: Hello,
I’m using Kamailio as sip redirect server where SBC forwards the calls to Kamailio which sends the routing back to SBC in 3xx response.
Now, I need to handle CANCEL requests sent from SBC to Kamailio. Here is the scenario: the client sends CANCEL request to SBC which responds with 200 OK and 487 Request Terminated and then sends CANCEL request to Kamailio. I’m not sure how Kamailio should handle the CANCEL request here, should it send only 200 OK back to SBC or also should send 487 request terminated?
Regards, Ali Taher _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Ali,
It all depends on whether you are creating a transaction in the course of redirect processing.
If you do create a transaction (i.e. with t_newtran()), and the CANCEL arrives before you have sent a final dispositive reply (2xx or higher), then the normal CANCEL processing will do the right thing and generate both a 200 OK for the CANCEL and a 487 Request Terminated for the INVITE:
route { ...
if(is_method("CANCEL")) { if(!t_relay_cancel()) { xlog("L_INFO", "No matching transaction for CANCEL\n"); sl_send_reply("500", "Internal Server Error"); }
exit; } }
If no transaction is created, i.e. you just receive the INVITE, do a lookup, and sl_send_reply() a response, then there is nothing to CANCEL and nothing needs to be handled.
If you have already sent a final reply after having created the transaction manually (the first scenario above), the transaction is terminated and there is likewise nothing to CANCEL.
-- Alex
On Tue, Jan 28, 2020 at 02:18:53PM +0000, Ali Taher wrote:
Hello Alex,
You mean handle the cancel from Kamailio side ? can you give me hint how to do it ?
Regards, Ali Taher
From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Alex Balashov Sent: Tuesday, January 28, 2020 4:07 PM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] SIP Redirect CANCEL handling
You should handle the cancel. — Sent from mobile, with due apologies for brevity and errors.
On Jan 28, 2020, at 8:45 AM, Ali Taher <ataher@vanrise.commailto:ataher@vanrise.com> wrote: Hello Alex,
Kamailio sent 300 multiple choice back to SBC even after the SBC sent the CANCEL request , knowing that SBC sent the CANCEL 4 times as Kamailio didn’t respond to it , which is normal as in the routing logic I’m only handling INVITE packets (if (is_method("INVITE"))). So I’m confused whether I have to handle it or not.
Regards, Ali Taher
From: sr-users <sr-users-bounces@lists.kamailio.orgmailto:sr-users-bounces@lists.kamailio.org> On Behalf Of Alex Balashov Sent: Tuesday, January 28, 2020 3:37 PM To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org> Subject: Re: [SR-Users] SIP Redirect CANCEL handling
Unless you have created a transaction in the course of processing the redirect, there is no transaction to terminate, and accordingly no 487 to generate. However, these decisions are made by the default CANCEL handling (with hooks into TM) from the stock Kamailio config. You should not need any special logic of your own here.
— Sent from my iPad
On Jan 28, 2020, at 8:29 AM, Ali Taher <ataher@vanrise.commailto:ataher@vanrise.com> wrote: Hello,
I’m using Kamailio as sip redirect server where SBC forwards the calls to Kamailio which sends the routing back to SBC in 3xx response.
Now, I need to handle CANCEL requests sent from SBC to Kamailio. Here is the scenario: the client sends CANCEL request to SBC which responds with 200 OK and 487 Request Terminated and then sends CANCEL request to Kamailio. I’m not sure how Kamailio should handle the CANCEL request here, should it send only 200 OK back to SBC or also should send 487 request terminated?
Regards, Ali Taher _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users