<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi. <br>
</p>
<p><br>
</p>
<p>I found the answer for my question.</p>
<p><br>
</p>
<p>When the OpenSIPS is installed and the OpenSIPS' script is created, the code of such script has the example I need. So, I just had to look at the script and find the point where it is appropriated to detect responses with codes 404, 477 and 420.</p>
<p><br>
</p>
<p>Thanks.<br>
</p>
<p><br>
</p>
<p>Regards.<br>
</p>
<p><br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div class="BodyFragment"><font size="2">
<div class="PlainText">RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: &#43;55 35 3471 9200 RAMAL 979<br>
</div>
</font></div>
</div>
</div>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>De:</b> users-bounces@lists.opensips.org &lt;users-bounces@lists.opensips.org&gt; em nome de Rodrigo Pimenta Carvalho &lt;pimenta@inatel.br&gt;<br>
<b>Enviado:</b> segunda-feira, 9 de novembro de 2015 11:55<br>
<b>Para:</b> OpenSIPS users mailling list<br>
<b>Assunto:</b> Re: [OpenSIPS-Users] How to identify a 4xx, or 5xx, or 6xx SIP response in OpenSIPS script? Almost there...</font>
<div>&nbsp;</div>
</div>
<div>
<div id="divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi.</p>
<p><br>
</p>
<p>Thank all of you! <br>
</p>
<p>I'm getting success to execute some actions in my OpenSIPS when it get some responses as 4xx, 5xx, 6xx.</p>
<p>I have read about routes and some functions to detect such responses that come from the callee peer.</p>
<p><br>
</p>
<p>In my code I have something like this:</p>
<p><br>
</p>
<p>-------------------------------------------------------------------------------------------</p>
<p><br>
</p>
<p>failure_route[missed_call] {<br>
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (t_check_status(&quot;4[0-9][0-9]&quot;)||t_check_status(&quot;5[0-9][0-9]&quot;)||t_check_status(&quot;6[0-9][0-9]&quot;) ) {<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(($fU==&quot;porteirinho&quot;) || ($fU==&quot;porteirinho2&quot;) || ($tU==&quot;porteirinho&quot;) || ($tU==&quot;porteirinho2&quot;)){<br>
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do some actions for me...<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
}</p>
<p>--------------------------------------------------------------------------------------------<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>However, some responses seems to be generated internally in OpenSIPS. Ex: 420 (bad extension), 404 (not found), 477, etc. For these internally generated responses, I still have to find a way of detecting it. I will look for it on documentation. However,
 I suspect that maybe this detection has to be done in another type of route.</p>
<p><br>
</p>
<p>Should I use another type of route, shouldn't I? If yes, is there a function there that will tells me about the type of response too?</p>
<p><br>
</p>
<p>Any hint will be very helpful!<br>
</p>
<br>
<p><br>
</p>
<p>Best regards.</p>
<p><br>
</p>
<p><br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div class="BodyFragment"><font size="2">
<div class="PlainText">RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: &#43;55 35 3471 9200 RAMAL 979<br>
</div>
</font></div>
</div>
</div>
<br>
<br>
<div style="color:rgb(0,0,0)">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>De:</b> users-bounces@lists.opensips.org &lt;users-bounces@lists.opensips.org&gt; em nome de Annus Fictus &lt;annusfictus@gmail.com&gt;<br>
<b>Enviado:</b> sexta-feira, 6 de novembro de 2015 12:22<br>
<b>Para:</b> OpenSIPS users mailling list<br>
<b>Assunto:</b> Re: [OpenSIPS-Users] How to identify a 4xx, or 5xx, or 6xx SIP response in OpenSIPS script?</font>
<div>&nbsp;</div>
</div>
<div>Hello Rodrigo,<br>
<br>
you have to use failure route:<br>
<br>
<a id="LPlnk933274" class="moz-txt-link-freetext" href="http://www.opensips.org/Documentation/Script-Routes-2-2#toc3">http://www.opensips.org/Documentation/Script-Routes-2-2#toc3</a>
<div id="LPBorder_GT_14470749435600.8699498733567448" style="margin-top:20px; margin-bottom:20px; overflow:auto; width:100%">
<table id="LPContainer_14470749435580.0005199356938120347" style="border-top:1px solid rgb(204,204,204); border-bottom:1px solid rgb(204,204,204); width:80%; background-color:rgb(255,255,255); overflow:auto">
<tbody>
<tr style="border-spacing:0px" valign="top">
<td colspan="1" id="ImageCell_14470749435590.5207518091247045" style="width:250px; display:table-cell; vertical-align:middle; padding-right:20px">
<div id="LPImageContainer_14470749435590.5032880996184133" style="margin-top:12px; background-color:rgb(255,255,255); height:88px; width:250px; padding:0px; display:table">
<a target="_blank" href="http://www.opensips.org/Documentation/Script-Routes-2-2#toc3" id="LPImageAnchor_14470749435590.6506071333528669" style="display:table-cell; text-align:center"><img style="display:inline-block; margin-left:auto; margin-right:auto; max-width:250px; max-height:250px; height:84px; width:250px; border-width:0px" height="84" width="250" src="http://www.opensips.org/pub/skins/opensips/images/logo2.jpg"></a></div>
</td>
<td>
<div id="LPTitle_14470749435600.37927044401357846" style="top:0px; margin-top:8px; font-size:21px; font-family:&quot;wf_segoe-ui_semilight&quot;,&quot;Segoe UI Semilight&quot;,&quot;Segoe WP Semilight&quot;,&quot;Segoe UI&quot;,&quot;Segoe WP&quot;,Tahoma,Arial,sans-serif; color:rgb(51,51,51); margin-left:14px; margin-right:14px">
openSIPS | Documentation / Types of routes - 2.2</div>
<div id="LPDescription_14470749435600.6939038954231516" style="margin-top:8px; font-size:13px; font-family:&quot;wf_segoe-ui_normal&quot;,&quot;Segoe UI&quot;,&quot;Segoe WP&quot;,Tahoma,Arial,sans-serif; color:rgb(102,102,102); margin-left:14px; margin-right:14px">
OpenSIPS routing logic uses several types of routes. Each type of route is triggered by a certain event and allows you to process a certain type of message (request ...</div>
<div id="LPUrlContainer_14470749435600.8724474736097807" style="margin:8px 14px 10px; height:18px; text-overflow:ellipsis; overflow:hidden; white-space:nowrap">
<a target="_blank" href="http://www.opensips.org/Documentation/Script-Routes-2-2#toc3" id="LPUrlAnchor_14470749435600.7296886187292517" style="font-size:11px; font-family:&quot;wf_segoe-ui_normal&quot;,&quot;Segoe UI&quot;,&quot;Segoe WP&quot;,Tahoma,Arial,sans-serif; text-decoration:none">Leia
 mais...</a></div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
Regards<br>
<br>
<div class="moz-cite-prefix">El 06/11/2015 a las 15:07, Rodrigo Pimenta Carvalho escribió:<br>
</div>
<blockquote type="cite">
<div id="divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p><br>
</p>
<p>Hi OpenSIPS-users,</p>
<p><br>
</p>
<p>In the OpenSIPS script I can identify SIP requests, like is_method(&quot;INVITE&quot;) or is_method(&quot;BYE&quot;).</p>
<p><br>
</p>
<p>How to identify SIP responses, based on its codes that can be 4xx, or 5xx, or 6xx?</p>
<p>For example, how to identify that occurred a SIP response with code 483?</p>
<p><br>
</p>
<p>I just need to know that a SIP INVITE didn't succeeded.</p>
<p><br>
</p>
<p>What could be a elegant way to detect that a SIP INVITE was not answered?<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>Best regards.<br>
</p>
<p><br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div class="BodyFragment"><font size="2">
<div class="PlainText">RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: &#43;55 35 3471 9200 RAMAL 979<br>
</div>
</font></div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset> <br>
<pre>_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<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>
</pre>
</blockquote>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>