[OpenSIPS-Users] how to cancel an INVITE before the callee receive it?
merlin.li at tsingch.com
merlin.li at tsingch.com
Thu Mar 5 11:56:37 CET 2015
Hi Chircu,
Thanks
I didn't received your mail which contain the solution, because i'm in China, we have fucking GFW, so sometimes we always miss something.
I will test it , and let you know the result.
Thanks again.
merlin.li at tsingch.com
From: Liviu Chircu
Date: 2015-03-05 18:47
To: merlin.li at tsingch.com; users
Subject: Re: [OpenSIPS-Users] how to cancel an INVITE before the callee receive it?
Hello merlin,
I have already given you the solution [1], but you did not read the email. It is also A LOT more efficient than your while+sleep loop, since it does not block the OpenSIPS workers at all - they are free to process all incoming traffic. Please implement it, send "404 Not Found" to the _caller_ when you decide to stop the call, and let me know if there are any problems :)
[1] : http://lists.opensips.org/pipermail/users/2015-March/031022.html
Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com
On 05.03.2015 12:16, merlin.li at tsingch.com wrote:
Hi Chircu,
I got an idea, and tested it, but the result confuse me.
In the CANCEL processing block, i use set_dlg_flag("1") to set a dialog flag,
if (is_method("CANCEL")) # in the route block
{
if (t_check_trans()){
if(!is_dlg_flag_set("1")){
set_dlg_flag("1");
t_relay();
exit;
}
}
}
and in the while loop:
while( !lookup("location","m") ){
if(is_dlg_flag_set("1")){
t_reply("404","cancel the request!");
exit;
}
.....
}
Sometimes , it works well, but sometimes, the CANCEL process is not executed until the loop finished.
What i said is i got two result, and i don't know why.
result 1:
when opensips received the CANCEL request , the dialog flag is set, then break the while loop.
result 2:
Caller issue a CANCEL request, but opensips didn't entering the CANCEL process until the while loop is finished.
merlin.li at tsingch.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150305/43abdb11/attachment-0001.htm>
More information about the Users
mailing list