[OpenSIPS-Users] how to cancel an INVITE before the callee receive it?
merlin.li at tsingch.com
merlin.li at tsingch.com
Fri Mar 6 09:52:25 CET 2015
Hi Chircu,
one more question,
Your solution:
1) set $T_fr_timeout and $T_fr_inv_timeout to 1
2) t_on_failure(...) [1]
3) t_relay() to a bogus gateway [2]
4) catch the 408 timeout in the failure route. Using an $avp counter, go
back to step 1) until 30 tries have been done. In this failure route,
you may now also use t_was_cancelled().
How can i let the opensips from step 4 to step 1?And what i want to use is t_cancel_branch(), not t_was_cancelled()
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/20150306/fc69d647/attachment.htm>
More information about the Users
mailing list