<html><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }div.foxdiv20150305181618155747 { }body { font-size: 10.5pt; font-family: 'Microsoft YaHei UI'; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span><br></div><blockquote style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em;"><div><div class="FoxDiv20150305181618155747">
<div><span></span>Hi Chircu,</div><div><br></div><div>I got an idea, and tested it, but the result confuse me. </div><div>In the CANCEL processing block, i use <span style="font-family: ''; font-size: 10.5pt; line-height: 1.5; background-color: window;"> set_dlg_flag("1") to set a dialog flag,</span></div><div><span style="font-family: ''; font-size: 10.5pt; line-height: 1.5; background-color: window;"><br></span></div><div><span style="font-family: "" microsoft="" yahei="" ui'";="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgb(255,="" 255,="" 255);="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'="">if (is_method("CANCEL")) # in the route block<br> {<br> if (t_check_trans()){<br> if(!is_dlg_flag_set("1")){<br> <b> set_dlg_flag("1");</b><br> t_relay();<br> exit;<br> }</span></div><div><span style="font-family: ''; font-size: 10.5pt; line-height: 1.5; background-color: window;">}</span></div><div><span style="font-family: ''; font-size: 10.5pt; line-height: 1.5; background-color: window;">}</span></div><div><span style="font-family: ''; font-size: 10.5pt; line-height: 1.5; background-color: window;"><br></span></div><div><span style="font-family: ''; font-size: 10.5pt; line-height: 1.5; background-color: window;">and in the while loop:</span></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;'="">while( !lookup("location","m") ){<br> if(is_dlg_flag_set("1")){<br> t_reply("404","cancel the request!");<br> exit;<br> }</span></div>
<div> .....</div><div>}</div><div><br></div><div>Sometimes , it works well, but sometimes, the CANCEL process is not executed until the loop finished.</div><div>What i said is i got two result, and i don't know why.</div><div>result 1:</div><div>when opensips received the CANCEL request , the dialog flag is set, then break the while loop.</div><div><br></div><div>result 2:</div><div>Caller issue a CANCEL request, but opensips didn't entering the CANCEL process until the while loop is finished.</div><div><br></div><div><br></div><hr style="width: 210px; height: 1px;" color="#b5c4df" size="1" align="left">
<div><span><div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt"><div>merlin.li@tsingch.com</div></div></span></div>
<blockquote style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em;"><div><div class="FoxDiv20150305145914717007"><blockquote style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em;"><div><div class="FoxDiv20150305133500088028"><br>
</div></div></blockquote>
</div></div></blockquote>
</div></div></blockquote>
</body></html>