[OpenSIPS-Users] how to cancel an INVITE before the callee receive it?

Liviu Chircu liviu at opensips.org
Thu Mar 5 11:47:13 CET 2015


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/6ac4c06b/attachment.htm>


More information about the Users mailing list