<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><tt>Hi, Rodrigo!</tt></p>
<p><tt><br>
</tt></p>
<p><tt>That's quite a fun question. Off the top of my head, here are
3 possible ways in which you can achieve this: </tt></p>
<p><tt><br>
</tt></p>
<p><tt>* relay over TCP: not sure if's relevant to your needs, but
if you arm a failure route and t_relay("0x02") out to the
internet, you will be able to properly tell if connectivity was
down should you hit the failure route.<br>
</tt></p>
<p><tt>* ICMP test: you </tt><tt><tt>can</tt> do an exec("/bin/ping
-w1 -c1 <ICMP-enabled public IP>") and decide from the
return code</tt></p>
<p><tt>* HTTP GET: you </tt><tt><tt>can</tt> use the rest_client
module, attempt to fetch some page, and decide from the return
code. Be sure to set a proper TCP connect timeout!</tt></p>
<p><tt><br>
</tt></p>
<p><tt>Best regards,</tt><br>
</p>
<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>
<div class="moz-cite-prefix">On 04.08.2016 16:21, Rodrigo Pimenta
Carvalho wrote:<br>
</div>
<blockquote
cite="mid:BY2PR02MB165570C1E0BB607F1367A66DB5070@BY2PR02MB1655.namprd02.prod.outlook.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<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>How to discover if OpenSIPS is connected do Internet, from
its configuration script?</p>
<p><br>
</p>
<p>Sometimes the Internet Link is down and then just local calls
will work. If I can discover if OpenSIPS is "online" on
Internet, I will use this information to implement some
specific logic in my script.<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: +55 35 3471 9200 RAMAL 979<br>
</div>
</font></div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
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>
</body>
</html>