Hello,
Which module can I use to have Kamailio generate a CANCEL request when it receives a certain reply code? I want to cancel a dialog when Kamailio receives a 181 Call Forwarded.
Kamailio is a proxy, and not designed to originate requests.
If you really, really want to generate a request, you can use uac_req_send():
http://kamailio.org/docs/modules/4.0.x/modules/uac.html#idp1686632
But, you'll have to spoof all the parameters, including the pertinent branch ID, From tag and CSeq, correctly. I'm not sure if $uac_req(...) lets you do that.
This is a very bad idea. CANCELs -- like most requests -- are for user agents to send, not proxies.
-- Alex
On 07/04/2013 03:30 AM, Grant Bagdasarian wrote:
Hello,
Which module can I use to have Kamailio generate a CANCEL request when it receives a certain reply code? I want to cancel a dialog when Kamailio receives a 181 Call Forwarded.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Ohh, that's gonna be tricky then.
Well, the thing is we want to do some kind of answer machine detection by catching the 181 SIP responses and CANCEL the dialogs. I've tested this with one of our suppliers and for the most mobile operators in this country a 181 response is given when the call is being forwarded to voicemail. For our purpose this covers roughly about 90% of all the calls. I know there are modules available for Asterisk and FreeSwitch which do AMD, but those consume too much resources.
-----Original Message----- From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Alex Balashov Sent: Thursday, July 4, 2013 9:33 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Sending CANCEL
Kamailio is a proxy, and not designed to originate requests.
If you really, really want to generate a request, you can use uac_req_send():
http://kamailio.org/docs/modules/4.0.x/modules/uac.html#idp1686632
But, you'll have to spoof all the parameters, including the pertinent branch ID, From tag and CSeq, correctly. I'm not sure if $uac_req(...) lets you do that.
This is a very bad idea. CANCELs -- like most requests -- are for user agents to send, not proxies.
-- Alex
On 07/04/2013 03:30 AM, Grant Bagdasarian wrote:
Hello,
Which module can I use to have Kamailio generate a CANCEL request when it receives a certain reply code? I want to cancel a dialog when Kamailio receives a 181 Call Forwarded.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Alex Balashov - Principal Evariste Systems LLC 235 E Ponce de Leon Ave Suite 106 Decatur, GA 30030 United States Tel: +1-678-954-0670 Web: http://www.evaristesys.com/, http://www.alexbalashov.com/
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On 07/04/2013 03:42 AM, Grant Bagdasarian wrote:
Ohh, that's gonna be tricky then.
Turns out it won't. Olle posted the correct solution. I was unaware of the tentacles TMX had been growing. :-)
4 jul 2013 kl. 09:32 skrev Alex Balashov abalashov@evaristesys.com:
Kamailio is a proxy, and not designed to originate requests.
If you really, really want to generate a request, you can use uac_req_send():
http://kamailio.org/docs/modules/4.0.x/modules/uac.html#idp1686632
But, you'll have to spoof all the parameters, including the pertinent branch ID, From tag and CSeq, correctly. I'm not sure if $uac_req(...) lets you do that.
This is a very bad idea. CANCELs -- like most requests -- are for user agents to send, not proxies.
Alex, Who sends a CANCEL on a fork? ;-) That's the proxy's job.
(Sorry could not resist)
But you are right that if you cancel ALL branches in the proxy so that the UA suddenly gets a 487 and is not aware of the CANCEL that can be messy.
/O
On 07/04/2013 03:45 AM, Olle E. Johansson wrote:
Alex, Who sends a CANCEL on a fork? ;-) That's the proxy's job.
(Sorry could not resist)
Yes, but that's part of "automatic" branch control as part of normal forking implementation.
When I said that, what I meant is that this sort of explicit pseudo-third party call control is not a proxy's job, methodologically speaking. :-)
-- Alex
4 jul 2013 kl. 09:46 skrev Alex Balashov abalashov@evaristesys.com:
On 07/04/2013 03:45 AM, Olle E. Johansson wrote:
Alex, Who sends a CANCEL on a fork? ;-) That's the proxy's job.
(Sorry could not resist)
Yes, but that's part of "automatic" branch control as part of normal forking implementation.
When I said that, what I meant is that this sort of explicit pseudo-third party call control is not a proxy's job, methodologically speaking. :-)
I do agree.
Kamailio has grown to be able to run in proxy mode as well as a pseudo-third-party-call-control-beast ;-) The important thing is that you know which mode you run it in and why.
Our marketing dept like to describe Kamailio as a "SIP Server" nowadays, not just a "SIP proxy".
/O
On 07/04/2013 03:51 AM, Olle E. Johansson wrote:
Our marketing dept like to describe Kamailio as a "SIP Server" nowadays, not just a "SIP proxy".
Yeah, I know. But when I actually come out and say that, people rise in righteous indignation from their cream chicken and demand to know why it can't play messages, initiate calls, and host conferences. :-)
4 jul 2013 kl. 09:53 skrev Alex Balashov abalashov@evaristesys.com:
On 07/04/2013 03:51 AM, Olle E. Johansson wrote:
Our marketing dept like to describe Kamailio as a "SIP Server" nowadays, not just a "SIP proxy".
Yeah, I know. But when I actually come out and say that, people rise in righteous indignation from their cream chicken and demand to know why it can't play messages, initiate calls, and host conferences. :-)
Hmm. I will forward this feedback to the Martini-drinking guys in the marketing dept. Maybe a hostile takeover of SEMS or another media server would be the right way to go, or just write better copy.
/O
So if I use the t_cancel_callid function, Kamailio sends a CANCEL to the UAS, but doesn't send anything to the UAC? Or do I need to handle that myself?
-----Original Message----- From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Olle E. Johansson Sent: Thursday, July 4, 2013 9:45 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Sending CANCEL
4 jul 2013 kl. 09:32 skrev Alex Balashov abalashov@evaristesys.com:
Kamailio is a proxy, and not designed to originate requests.
If you really, really want to generate a request, you can use uac_req_send():
http://kamailio.org/docs/modules/4.0.x/modules/uac.html#idp1686632
But, you'll have to spoof all the parameters, including the pertinent branch ID, From tag and CSeq, correctly. I'm not sure if $uac_req(...) lets you do that.
This is a very bad idea. CANCELs -- like most requests -- are for user agents to send, not proxies.
Alex, Who sends a CANCEL on a fork? ;-) That's the proxy's job.
(Sorry could not resist)
But you are right that if you cancel ALL branches in the proxy so that the UA suddenly gets a 487 and is not aware of the CANCEL that can be messy.
/O _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
4 jul 2013 kl. 09:58 skrev Grant Bagdasarian GB@cm.nl:
So if I use the t_cancel_callid function, Kamailio sends a CANCEL to the UAS, but doesn't send anything to the UAC? Or do I need to handle that myself?
The UAS that receives the CANCEL will send a 200 Ok on the Cancel that you need NOT to forward to the UA. At the same time it will send a 487 Request terminated that you WILL HAVE TO forward to the UAC so that it closes the transaction. Unless you have other branches, then you will have to swallow the 487 too.
I haven't tested this function so I don't know which parts of this that happens automagically in TM in the transaction context. I would assume that the 200 OK is handled properly and the 487 is forwarded only if there are not other branches that hasn't received a final response. This you will have to test. I would be happy if you report your findings back to the list!
/O
-----Original Message----- From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Olle E. Johansson Sent: Thursday, July 4, 2013 9:45 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Sending CANCEL
4 jul 2013 kl. 09:32 skrev Alex Balashov abalashov@evaristesys.com:
Kamailio is a proxy, and not designed to originate requests.
If you really, really want to generate a request, you can use uac_req_send():
http://kamailio.org/docs/modules/4.0.x/modules/uac.html#idp1686632
But, you'll have to spoof all the parameters, including the pertinent branch ID, From tag and CSeq, correctly. I'm not sure if $uac_req(...) lets you do that.
This is a very bad idea. CANCELs -- like most requests -- are for user agents to send, not proxies.
Alex, Who sends a CANCEL on a fork? ;-) That's the proxy's job.
(Sorry could not resist)
But you are right that if you cancel ALL branches in the proxy so that the UA suddenly gets a 487 and is not aware of the CANCEL that can be messy.
/O _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On 07/04/2013 04:03 AM, Olle E. Johansson wrote:
I haven't tested this function so I don't know which parts of this that happens automagically in TM in the transaction context. I would assume that the 200 OK is handled properly and the 487 is forwarded only if there are not other branches that hasn't received a final response. This you will have to test. I would be happy if you report your findings back to the list!
This is what I had in mind when I said this was a bad idea. I still think it's likely to result in a complete mess, nice TM function or not.
Will do. I'm not forking the INVITE, so there will only be a single branch.
-----Original Message----- From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Olle E. Johansson Sent: Thursday, July 4, 2013 10:04 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Sending CANCEL
4 jul 2013 kl. 09:58 skrev Grant Bagdasarian GB@cm.nl:
So if I use the t_cancel_callid function, Kamailio sends a CANCEL to the UAS, but doesn't send anything to the UAC? Or do I need to handle that myself?
The UAS that receives the CANCEL will send a 200 Ok on the Cancel that you need NOT to forward to the UA. At the same time it will send a 487 Request terminated that you WILL HAVE TO forward to the UAC so that it closes the transaction. Unless you have other branches, then you will have to swallow the 487 too.
I haven't tested this function so I don't know which parts of this that happens automagically in TM in the transaction context. I would assume that the 200 OK is handled properly and the 487 is forwarded only if there are not other branches that hasn't received a final response. This you will have to test. I would be happy if you report your findings back to the list!
/O
-----Original Message----- From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Olle E. Johansson Sent: Thursday, July 4, 2013 9:45 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Sending CANCEL
4 jul 2013 kl. 09:32 skrev Alex Balashov abalashov@evaristesys.com:
Kamailio is a proxy, and not designed to originate requests.
If you really, really want to generate a request, you can use uac_req_send():
http://kamailio.org/docs/modules/4.0.x/modules/uac.html#idp1686632
But, you'll have to spoof all the parameters, including the pertinent branch ID, From tag and CSeq, correctly. I'm not sure if $uac_req(...) lets you do that.
This is a very bad idea. CANCELs -- like most requests -- are for user agents to send, not proxies.
Alex, Who sends a CANCEL on a fork? ;-) That's the proxy's job.
(Sorry could not resist)
But you are right that if you cancel ALL branches in the proxy so that the UA suddenly gets a 487 and is not aware of the CANCEL that can be messy.
/O _______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
4 jul 2013 kl. 09:30 skrev Grant Bagdasarian GB@cm.nl:
Hello,
Which module can I use to have Kamailio generate a CANCEL request when it receives a certain reply code? I want to cancel a dialog when Kamailio receives a 181 Call Forwarded.
The TMX module has two functions you can use http://kamailio.org/docs/modules/4.0.x/modules/tmx.html#idm7888
/O
On 07/04/2013 03:41 AM, Olle E. Johansson wrote:
4 jul 2013 kl. 09:30 skrev Grant Bagdasarian <GB@cm.nl mailto:GB@cm.nl>:
Hello, Which module can I use to have Kamailio generate a CANCEL request when it receives a certain reply code? I want to cancel a dialog when Kamailio receives a 181 Call Forwarded.
The TMX module has two functions you can use http://kamailio.org/docs/modules/4.0.x/modules/tmx.html#idm7888
Ah, interesting. Who knew!
Yeah, that's pretty awesome :D
Thanks Olle!
-----Original Message----- From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Alex Balashov Sent: Thursday, July 4, 2013 9:43 AM To: sr-users@lists.sip-router.org Subject: Re: [SR-Users] Sending CANCEL
On 07/04/2013 03:41 AM, Olle E. Johansson wrote:
4 jul 2013 kl. 09:30 skrev Grant Bagdasarian <GB@cm.nl mailto:GB@cm.nl>:
Hello, Which module can I use to have Kamailio generate a CANCEL request when it receives a certain reply code? I want to cancel a dialog when Kamailio receives a 181 Call Forwarded.
The TMX module has two functions you can use http://kamailio.org/docs/modules/4.0.x/modules/tmx.html#idm7888
Ah, interesting. Who knew!
-- Alex Balashov - Principal Evariste Systems LLC 235 E Ponce de Leon Ave Suite 106 Decatur, GA 30030 United States Tel: +1-678-954-0670 Web: http://www.evaristesys.com/, http://www.alexbalashov.com/
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On Thursday 04 July 2013 09:30:21 Grant Bagdasarian wrote:
Which module can I use to have Kamailio generate a CANCEL request when it
receives a certain reply code? I want to cancel a dialog when Kamailio receives a 181 Call Forwarded.
Kamailio 1.5x. had this possibility. unfortunately, it got lost in the merger with SER's tm module. A resurrection of this function would be very welcome.
http://www.kamailio.org/docs/modules/1.5.x/tm.html#id2492468
On 7/4/13 9:52 AM, Alex Hermann wrote:
On Thursday 04 July 2013 09:30:21 Grant Bagdasarian wrote:
Which module can I use to have Kamailio generate a CANCEL request when it
receives a certain reply code? I want to cancel a dialog when Kamailio receives a 181 Call Forwarded.
Kamailio 1.5x. had this possibility. unfortunately, it got lost in the merger with SER's tm module. A resurrection of this function would be very welcome.
http://www.kamailio.org/docs/modules/1.5.x/tm.html#id2492468
It was not lost:
http://www.kamailio.org/docs/modules/4.0.x/modules/tmx.html#idp2473632
Cheers, Daniel
On Thursday 04 July 2013 09:55:12 Daniel-Constantin Mierla wrote:
On 7/4/13 9:52 AM, Alex Hermann wrote:
On Thursday 04 July 2013 09:30:21 Grant Bagdasarian wrote:
Which module can I use to have Kamailio generate a CANCEL request when it
receives a certain reply code? I want to cancel a dialog when Kamailio receives a 181 Call Forwarded.
Kamailio 1.5x. had this possibility. unfortunately, it got lost in the
merger
with SER's tm module. A resurrection of this function would be very
welcome.
http://www.kamailio.org/docs/modules/1.5.x/tm.html#id2492468
It was not lost:
http://www.kamailio.org/docs/modules/4.0.x/modules/tmx.html#idp2473632
I forgot about tmx, luckily the function is still available.
4 jul 2013 kl. 09:52 skrev Alex Hermann alex@speakup.nl:
On Thursday 04 July 2013 09:30:21 Grant Bagdasarian wrote:
Which module can I use to have Kamailio generate a CANCEL request when it
receives a certain reply code? I want to cancel a dialog when Kamailio receives a 181 Call Forwarded.
Kamailio 1.5x. had this possibility. unfortunately, it got lost in the merger with SER's tm module. A resurrection of this function would be very welcome.
http://www.kamailio.org/docs/modules/1.5.x/tm.html#id2492468
Functions that existed in Kamailio but not SER was moved to TMX, which is where you look for the old goodies.
The Corex, TMX and KEX modules are similar in that regards. Take some time to investigate them and find your friends from Kamailio. http://kamailio.org/docs/modules/4.0.x/
/O