<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Aidar,<div class="">I believe $rc is the return code of the last function called (ref <a href="https://www.kamailio.org/wiki/cookbooks/4.4.x/pseudovariables#rc_-_returned_code" class="">https://www.kamailio.org/wiki/cookbooks/4.4.x/pseudovariables#rc_-_returned_code</a>)<div class=""><br class=""></div><div class="">In your example you call xwarn() and then test $rc… so by the time you test $rc it is no longer the result of the lookup() function.</div><div class=""><br class=""></div><div class="">Try storing $rc in a $var before calling xwarn() instead and see if it works the way you expect it to:</div><div class=""><blockquote type="cite" class=""><div dir="ltr" class=""><div class=""><div class="">        if (!lookup("location")) {</div><div class="">                $var(rc) = $rc;</div></div></div></blockquote><blockquote type="cite" class=""><div dir="ltr" class=""><div class=""><div class="">                xwarn("method ($rm) r-uri ($ru)\n");   ################## HERE ##########################</div><div class="">               </div><div class="">                route(TOVOICEMAIL);</div><div class="">                t_newtran();</div><div class="">                switch ($var(rc)) {</div><div class="">                        case -1:</div><div class="">                        case -3:</div><div class="">                                send_reply("404", "Not Found");</div><div class="">                                exit;</div><div class="">                        case -2:</div><div class="">                                send_reply("405", "Method Not Allowed");</div><div class="">                                exit;</div><div class="">                }</div><div class="">        }</div></div></div></blockquote></div><div class=""><div dir="ltr" class=""><div class=""><div class=""><br class=""></div></div></div></div><div class="">Paul Smith<br class=""><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><blockquote class="__pbForwardBlockQuote" cite="mid:556DE1E3.8080003@claritytele.com" type="cite" style="border: 0px none;"><div class="__pbConvBody" __pbrmquotes="false" style="margin-left: 24px; margin-right: 24px;"><font color="#680900" class=""><br class=""></font><blockquote class="__pbForwardBlockQuote" cite="mid:556DDE2F.1050400@claritytele.com" type="cite" style="border: 0px none;"><div class="__pbConvBody" __pbrmquotes="false" style="margin-left: 24px; margin-right: 24px;"><font color="#888888" class=""><br class=""></font><div class="__pbConvBody" __pbrmquotes="false" style="margin-left: 24px; margin-right: 24px;"><span style="color: rgb(136, 136, 136);" class=""> </span><br class=""></div></div></blockquote></div></blockquote></div>
</div>
<br class=""></div></div></body></html>