<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.foxdiv20150303164323968249 { }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>Hi,</div><div><br></div><div>Or is there a way i can break the while loop in the route block when i receive the CANCEL request?</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><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><div><b>From:</b> <a href="mailto:merlin.li@tsingch.com">merlin.li@tsingch.com</a></div><div><b>Date:</b> 2015-03-03 16:14</div><div><b>To:</b> <a href="mailto:users@lists.opensips.org">users</a></div><div><b>Subject:</b> how to cancel an INVITE before the callee receive it?</div></div></div><div><div class="FoxDiv20150303164323968249">
<div><span></span>Hi all,</div><div><br></div><div>Let me describe my scenario first.</div><div><br></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 invite to it.</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;'=""> $avp(timeout) = 30 ;<br> while( !lookup("location","m") ){<br> if( $avp(timeout)==0 ){<br> send_reply("420","Can not find the callee!");<br> exit;<br> }<br> sleep("1");<br> $avp(timeout) = $avp(timeout)-1;<br> }</span></div>
<div><br></div><div>This works well, the only problem is the caller can not cancel it during that 30s</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;'="">t_cancel_branch() only can be used in onreply_route, but at that time, callee is offline.</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;'=""><br></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;'="">My question is :</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;'="">Is it possible that terminate a request in route block?</span></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>
</div></div></blockquote>
</body></html>