[SR-Users] Sending CANCEL

Olle E. Johansson oej at edvina.net
Thu Jul 4 10:03:44 CEST 2013


4 jul 2013 kl. 09:58 skrev Grant Bagdasarian <GB at 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 at lists.sip-router.org [mailto:sr-users-bounces at 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 at 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 at 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 at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users




More information about the sr-users mailing list