<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix"><tt>merlin,<br>
<br>
The SIP CANCEL must be sent by the caller, since "he wants to
undo his INVITE request", not by the proxy. In order to break
the call on the UAC side, have your proxy send him a generic
"404 - Not Found" SIP reply, after your have done enough
lookup() tries:<br>
</tt><tt><br>
...<br>
t_reply("404", "Not Found");<br>
exit;<br>
...<br>
<br>
Best regards,<br>
</tt>
<pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
On 04.03.2015 13:30, <a class="moz-txt-link-abbreviated" href="mailto:merlin.li@tsingch.com">merlin.li@tsingch.com</a> wrote:<br>
</div>
<blockquote cite="mid:201503041930185190809@tsingch.com" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
<style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }body { font-size: 10.5pt; font-family: 'Microsoft YaHei UI'; color: rgb(0, 0, 0); line-height: 1.5; }</style>
<div><span></span>Hi Chircu,</div>
<div><br>
</div>
<div>Thanks for your reply.</div>
<div>The 30s just my test value.</div>
<div>And maybe i didn't discribe my problem clearly.</div>
<div>I can understand that t_newtran() can create the transaction
first , and i already did it before i send the first email.</div>
<div>But as i said, the caller still can not cancel it, because i
don't know how to do it.</div>
<div>t_cancel_branch() only can be used in onreply_route <span
style="font-size: 10.5pt; line-height: 1.5; background-color:
window;"> </span><span style="font-size: 10.5pt; line-height:
1.5; background-color: window;">but at that</span><span
style="font-size: 10.5pt; line-height: 1.5; background-color:
window;"> time, callee is offline.</span></div>
<div><span style="font-size: 10.5pt; line-height: 1.5;
background-color: window;"><br>
</span></div>
<div><span style="font-size: 10.5pt; line-height: 1.5;
background-color: window;">Here is my cancel processing in the
route , would you please tell me how can i cancel the invite
which still in the while loop?</span></div>
<div><br>
</div>
<div><span style="font-family: "" microsoft="" yahei=""
ui'";="" font-size:="" 14px;="" color:="" rgb(0,="" 0,=""
0);="" background-color:="" rgba(0,="" font-weight:=""
normal;="" font-style:="" normal;text-decoration:="" none;'="">
# CANCEL processing<br>
if (is_method("CANCEL"))<br>
{<br>
if (t_check_trans()){<br>
t_relay();<br>
exit;<br>
}<br>
<br>
}</span></div>
<div><br>
</div>
<hr style="width: 210px; height: 1px;" size="1" align="left"
color="#b5c4df">
<div><span>
<div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE:
10pt">
<div><a class="moz-txt-link-abbreviated" href="mailto:merlin.li@tsingch.com">merlin.li@tsingch.com</a></div>
</div>
</span></div>
<blockquote style="margin-top: 0px; margin-bottom: 0px;
margin-left: 0.5em;">
<div><br>
</div>
<div>
<div> </div>
<div>Message: 1</div>
<div>Date: Tue, 03 Mar 2015 14:57:32 +0200</div>
<div>From: Liviu Chircu <a class="moz-txt-link-rfc2396E" href="mailto:liviu@opensips.org"><liviu@opensips.org></a></div>
<div>Subject: Re: [OpenSIPS-Users] how to cancel an INVITE
before the</div>
<div> callee receive it?</div>
<div>To: <a class="moz-txt-link-abbreviated" href="mailto:users@lists.opensips.org">users@lists.opensips.org</a></div>
<div>Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:54F5AFBC.1000200@opensips.org"><54F5AFBC.1000200@opensips.org></a></div>
<div>Content-Type: text/plain; charset="windows-1252";
Format="flowed"</div>
<div> </div>
<div>Hello merlin,</div>
<div> </div>
<div>First of all, from a user's perspective, a Post-Dial
Delay of up to 30 </div>
<div>seconds should be quite annoying. Your SIP logic will
also increase the </div>
<div>amount of traffic received by your platform, due to lots
of </div>
<div>retransmissions for all failed calls.</div>
<div> </div>
<div>That being said, here is what you should add in order to
make it work:</div>
<div> </div>
<div>t_newtran();</div>
<div>...</div>
<div>while (...) {</div>
<div> if (t_was_cancelled()) {</div>
<div> t_reply("487", "Request Cancelled");</div>
<div> exit;</div>
<div> }</div>
<div> ...</div>
<div>}</div>
<div> </div>
<div>Best regards,</div>
<div> </div>
<div>Liviu Chircu</div>
<div>OpenSIPS Developer</div>
<div><a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></div>
<div> </div>
<div>On 03.03.2015 10:45, <a class="moz-txt-link-abbreviated" href="mailto:merlin.li@tsingch.com">merlin.li@tsingch.com</a> wrote:</div>
<div>> Hi,</div>
<div>></div>
<div>> Or is there a way i can break the while loop in the
route block when i </div>
<div>> receive the CANCEL request?</div>
<div>></div>
<div>>
------------------------------------------------------------------------</div>
<div>> <a class="moz-txt-link-abbreviated" href="mailto:merlin.li@tsingch.com">merlin.li@tsingch.com</a></div>
<div>></div>
<div>> *From:* <a class="moz-txt-link-abbreviated" href="mailto:merlin.li@tsingch.com">merlin.li@tsingch.com</a>
<a class="moz-txt-link-rfc2396E" href="mailto:merlin.li@tsingch.com"><mailto:merlin.li@tsingch.com></a></div>
<div>> *Date:* 2015-03-03 16:14</div>
<div>> *To:* users
<a class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org"><mailto:users@lists.opensips.org></a></div>
<div>> *Subject:* how to cancel an INVITE before the
callee receive it?</div>
<div>> Hi all,</div>
<div>></div>
<div>> Let me describe my scenario first.</div>
<div>></div>
<div>> if the callee is not online, opensips will wait
for 30s.</div>
<div>> During the 30s, if the callee be online,
opensips will send the</div>
<div>> invite to it.</div>
<div>></div>
<div>> $avp(timeout) = 30 ;</div>
<div>> while(
!lookup("location","m") ){</div>
<div>> if(
$avp(timeout)==0 ){</div>
<div>>
send_reply("420","Can not find the callee!");</div>
<div>> exit;</div>
<div>> }</div>
<div>> sleep("1");</div>
<div>> $avp(timeout) =
$avp(timeout)-1;</div>
<div>> }</div>
<div>></div>
<div>> This works well, the only problem is the caller
can not cancel it</div>
<div>> during that 30s</div>
<div>> t_cancel_branch() only can be used in
onreply_route, but at that</div>
<div>> time, callee is offline.</div>
<div>></div>
<div>> My question is :</div>
<div>> Is it possible that terminate a request in route
block?</div>
<div>></div>
<div>></div>
<div>>
------------------------------------------------------------------------</div>
<div>> <a class="moz-txt-link-abbreviated" href="mailto:merlin.li@tsingch.com">merlin.li@tsingch.com</a></div>
<div>></div>
<div>></div>
<div>></div>
<div>> _______________________________________________</div>
<div>> Users mailing list</div>
<div>> <a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a></div>
<div>>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></div>
<div> </div>
<div>-------------- next part --------------</div>
<div>An HTML attachment was scrubbed...</div>
<div>URL:
<a class="moz-txt-link-rfc2396E" href="http://lists.opensips.org/pipermail/users/attachments/20150303/a9747213/attachment-0001.htm"><http://lists.opensips.org/pipermail/users/attachments/20150303/a9747213/attachment-0001.htm></a></div>
<div> </div>
<div>------------------------------</div>
<div> </div>
<div>Message: 2</div>
<div>Date: Tue, 03 Mar 2015 15:15:23 +0200</div>
<div>From: Liviu Chircu <a class="moz-txt-link-rfc2396E" href="mailto:liviu@opensips.org"><liviu@opensips.org></a></div>
<div>Subject: Re: [OpenSIPS-Users] how to cancel an INVITE
before the</div>
<div> callee receive it?</div>
<div>To: <a class="moz-txt-link-abbreviated" href="mailto:users@lists.opensips.org">users@lists.opensips.org</a></div>
<div>Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:54F5B3EB.9050808@opensips.org"><54F5B3EB.9050808@opensips.org></a></div>
<div>Content-Type: text/plain; charset="windows-1252";
Format="flowed"</div>
<div> </div>
<div>The previous solution won't work because you can't call </div>
<div>t_was_cancelled() in the main route... You should:</div>
<div> </div>
<div>1) set $T_fr_timeout and $T_fr_inv_timeout to 1</div>
<div>2) t_on_failure(...) [1]</div>
<div>3) t_relay() to a bogus gateway [2]</div>
<div>4) catch the 408 timeout in the failure route. Using an
$avp counter, go </div>
<div>back to step 1) until 30 tries have been done. In this
failure route, </div>
<div>you may now also use t_was_cancelled().</div>
<div> </div>
<div>[1] :
<a class="moz-txt-link-freetext" href="http://www.opensips.org/Documentation/Script-Routes-2-1#toc3">http://www.opensips.org/Documentation/Script-Routes-2-1#toc3</a></div>
<div>[2] :
<a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/2.1.x/tm.html#trelay-1">http://www.opensips.org/html/docs/modules/2.1.x/tm.html#trelay-1</a></div>
<div> </div>
<div>On 03.03.2015 14:57, Liviu Chircu wrote:</div>
<div>> Hello merlin,</div>
<div>></div>
<div>> First of all, from a user's perspective, a Post-Dial
Delay of up to 30 </div>
<div>> seconds should be quite annoying. Your SIP logic
will also increase </div>
<div>> the amount of traffic received by your platform, due
to lots of </div>
<div>> retransmissions for all failed calls.</div>
<div>></div>
<div>> That being said, here is what you should add in
order to make it work:</div>
<div>></div>
<div>> t_newtran();</div>
<div>> ...</div>
<div>> while (...) {</div>
<div>> if (t_was_cancelled()) {</div>
<div>> t_reply("487", "Request Cancelled");</div>
<div>> exit;</div>
<div>> }</div>
<div>> ...</div>
<div>> }</div>
<div>></div>
<div>> Best regards,</div>
<div>> Liviu Chircu</div>
<div>> OpenSIPS Developer</div>
<div>> <a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></div>
<div>> On 03.03.2015 10:45, <a class="moz-txt-link-abbreviated" href="mailto:merlin.li@tsingch.com">merlin.li@tsingch.com</a> wrote:</div>
<div>>> Hi,</div>
<div>>></div>
<div>>> Or is there a way i can break the while loop in
the route block when </div>
<div>>> i receive the CANCEL request?</div>
<div>>></div>
<div>>>
------------------------------------------------------------------------</div>
<div>>> <a class="moz-txt-link-abbreviated" href="mailto:merlin.li@tsingch.com">merlin.li@tsingch.com</a></div>
<div>>></div>
<div>>> *From:* <a class="moz-txt-link-abbreviated" href="mailto:merlin.li@tsingch.com">merlin.li@tsingch.com</a>
<a class="moz-txt-link-rfc2396E" href="mailto:merlin.li@tsingch.com"><mailto:merlin.li@tsingch.com></a></div>
<div>>> *Date:* 2015-03-03 16:14</div>
<div>>> *To:* users
<a class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org"><mailto:users@lists.opensips.org></a></div>
<div>>> *Subject:* how to cancel an INVITE before
the callee receive it?</div>
<div>>> Hi all,</div>
<div>>></div>
<div>>> Let me describe my scenario first.</div>
<div>>></div>
<div>>> if the callee is not online, opensips will
wait for 30s.</div>
<div>>> During the 30s, if the callee be online,
opensips will send the</div>
<div>>> invite to it.</div>
<div>>></div>
<div>>> $avp(timeout) = 30 ;</div>
<div>>> while(
!lookup("location","m") ){</div>
<div>>> if(
$avp(timeout)==0 ){</div>
<div>>>
send_reply("420","Can not find the callee!");</div>
<div>>> exit;</div>
<div>>> }</div>
<div>>> sleep("1");</div>
<div>>> $avp(timeout) =
$avp(timeout)-1;</div>
<div>>> }</div>
<div>>></div>
<div>>> This works well, the only problem is the
caller can not cancel it</div>
<div>>> during that 30s</div>
<div>>> t_cancel_branch() only can be used in
onreply_route, but at that</div>
<div>>> time, callee is offline.</div>
<div>>></div>
<div>>> My question is :</div>
<div>>> Is it possible that terminate a request in
route block?</div>
<div>>></div>
<div>>></div>
<div>>>
------------------------------------------------------------------------</div>
<div>>> <a class="moz-txt-link-abbreviated" href="mailto:merlin.li@tsingch.com">merlin.li@tsingch.com</a></div>
<div>>></div>
<div>>></div>
<div>>></div>
<div>>> _______________________________________________</div>
<div>>> Users mailing list</div>
<div>>> <a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a></div>
<div>>>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></div>
<div>></div>
<div>></div>
<div>></div>
<div>> _______________________________________________</div>
<div>> Users mailing list</div>
<div>> <a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a></div>
<div>>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></div>
<div> </div>
<div>-------------- next part --------------</div>
<div>An HTML attachment was scrubbed...</div>
<div>URL:
<a class="moz-txt-link-rfc2396E" href="http://lists.opensips.org/pipermail/users/attachments/20150303/31768207/attachment-0001.htm"><http://lists.opensips.org/pipermail/users/attachments/20150303/31768207/attachment-0001.htm></a></div>
<div> </div>
<div>------------------------------</div>
<div> </div>
<div>Message: 3</div>
<div>Date: Tue, 3 Mar 2015 17:02:44 +0100</div>
<div>From: Adri? Vidal <a class="moz-txt-link-rfc2396E" href="mailto:adriavidal@gmail.com"><adriavidal@gmail.com></a></div>
<div>Subject: Re: [OpenSIPS-Users] CDRtool 9.3 web interface</div>
<div>To: OpenSIPS users mailling list
<a class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a></div>
<div>Message-ID:</div>
<div>
<a class="moz-txt-link-rfc2396E" href="mailto:CAFYw3-dR_RcmaN=yXsm3gRB2urSWw325ANAcvm+VE_-kaoA15A@mail.gmail.com"><CAFYw3-dR_RcmaN=yXsm3gRB2urSWw325ANAcvm+VE_-kaoA15A@mail.gmail.com></a></div>
<div>Content-Type: text/plain; charset="utf-8"</div>
<div> </div>
<div>2015-03-03 11:30 GMT+01:00 Tijmen de Mes
<a class="moz-txt-link-rfc2396E" href="mailto:tijmen@ag-projects.com"><tijmen@ag-projects.com></a>:</div>
<div> </div>
<div>> Hi,</div>
<div>></div>
<div>> Clicking on the icons does not work. If you click on
the input field you</div>
<div>> should get a date picker.</div>
<div>></div>
<div>> If you don?t get it please take a look at the
webbrowsers console if get</div>
<div>> any error or exception.</div>
<div>></div>
<div>> Best regards,</div>
<div>></div>
<div>> Tijmen de Mes</div>
<div>></div>
<div> </div>
<div>I see no input field to click on</div>
<div> </div>
<div><a class="moz-txt-link-freetext" href="https://www.dropbox.com/s/w55ynwrc1kbps6d/Captura%20de%20pantalla%202015-03-03%2017.02.14.png?dl=0">https://www.dropbox.com/s/w55ynwrc1kbps6d/Captura%20de%20pantalla%202015-03-03%2017.02.14.png?dl=0</a></div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>-- </div>
<div>--</div>
<div>Adri? Vidal</div>
<div> </div>
<div>T. 93 150 31 80 | M 607 28 89 56</div>
<div> </div>
<div>@ <a class="moz-txt-link-abbreviated" href="mailto:adria@gmail.com">adria@gmail.com</a></div>
<div> </div>
<div>www <a class="moz-txt-link-abbreviated" href="http://www.xpreme.net">www.xpreme.net</a> | centralitaip.xpreme.net</div>
<div> </div>
<div>twitter xpreme_it
<a class="moz-txt-link-rfc2396E" href="https://twitter.com/intent/user?screen_name=xpreme_it"><https://twitter.com/intent/user?screen_name=xpreme_it></a></div>
<div>-------------- next part --------------</div>
<div>An HTML attachment was scrubbed...</div>
<div>URL:
<a class="moz-txt-link-rfc2396E" href="http://lists.opensips.org/pipermail/users/attachments/20150303/7b382bc0/attachment.htm"><http://lists.opensips.org/pipermail/users/attachments/20150303/7b382bc0/attachment.htm></a></div>
<div> </div>
<div>------------------------------</div>
<div> </div>
<div>_______________________________________________</div>
<div>Users mailing list</div>
<div><a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a></div>
<div><a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></div>
<div> </div>
<div> </div>
<div>End of Users Digest, Vol 80, Issue 6</div>
<div>************************************</div>
</div>
</blockquote>
</blockquote>
<br>
</body>
</html>