<html><head></head><body bgcolor="#FFFFFF"><div>Gary,</div><div><br></div><div>&nbsp; Please elaborate on "did not work". &nbsp;Also have you logged the actual value of this var before the if/else statement?<br><br>Sent from my iPhone</div><div><br>On Jul 16, 2012, at 7:32 AM, Gary Chen &lt;<a href="mailto:Gary.Chen@lightyear.net">Gary.Chen@lightyear.net</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><meta name="Generator" content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--><div class="WordSection1"><p class="MsoNormal">Kamailio 3.3.0<o:p></o:p></p><p class="MsoNormal"><o:p>&nbsp;</o:p></p><p class="MsoNormal">I have a variable&nbsp; $var(s:dst). It can store either a number or IP.<o:p></o:p></p><p class="MsoNormal">How do I check to determine whether it is a number of IP?<o:p></o:p></p><p class="MsoNormal">I tried the following and it did not work:<o:p></o:p></p><pre>If ($var(s:dst) =~ “^\d+\.\d+\.\d+\.\d+$”){<o:p></o:p></pre><pre>It is a IP.<o:p></o:p></pre><pre>}else{<o:p></o:p></pre><pre>It is a Number<o:p></o:p></pre><pre>}<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Thanks<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre>Gary<o:p></o:p></pre><pre><o:p>&nbsp;</o:p></pre><pre><o:p>&nbsp;</o:p></pre></div></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list</span><br><span><a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a></span><br><span><a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a></span><br></div></blockquote></body></html>