<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;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Try to remove the first Xlog because Xlog returns also a $retcode.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>De :</b> sr-users <sr-users-bounces@lists.kamailio.org> de la part de Andrew Chen <achen@fuze.com><br>
<b>Envoyé :</b> mardi 9 avril 2019 23:03:08<br>
<b>À :</b> Kamailio (SER) - Users Mailing List<br>
<b>Objet :</b> [SR-Users] Question regarding retcode</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hey all,
<div><br>
</div>
<div>Question regarding the type of retcode.</div>
<div><br>
</div>
<div>I ran a curl command and $retcode returned 200.  I check against that variable if it's 200 or not.  I tried to check 200 as a string and integer but never matches so I ran these lines of code:</div>
<div><br>
</div>
<div>
<p class="x_gmail-p1" style="margin:0px; font-variant-numeric:normal; font-variant-east-asian:normal; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span class="x_gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="x_gmail-Apple-converted-space">        </span>xlog("L_INFO", "</span><span class="x_gmail-s2" style="font-variant-ligatures:no-common-ligatures; color:rgb(52,188,38)">[$ci][$mi][CSeq
 $cs]</span><span class="x_gmail-s1" style="font-variant-ligatures:no-common-ligatures"> Validating meeting ($rU).<span class="x_gmail-Apple-converted-space"> 
</span>Result: $var(result)<span class="x_gmail-Apple-converted-space">  </span>Return code: $retcode \n")</span><span class="x_gmail-s3" style="font-variant-ligatures:no-common-ligatures; color:rgb(82,48,225)">;</span></p>
<p class="x_gmail-p2" style="margin:0px; font-variant-numeric:normal; font-variant-east-asian:normal; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0); min-height:13px">
<span class="x_gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br>
</p>
<p class="x_gmail-p1" style="margin:0px; font-variant-numeric:normal; font-variant-east-asian:normal; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span class="x_gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="x_gmail-Apple-converted-space">       
</span>if(is_int($retcode))</span></p>
<p class="x_gmail-p1" style="margin:0px; font-variant-numeric:normal; font-variant-east-asian:normal; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span class="x_gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="x_gmail-Apple-converted-space">       
</span>{</span></p>
<p class="x_gmail-p1" style="margin:0px; font-variant-numeric:normal; font-variant-east-asian:normal; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span class="x_gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="x_gmail-Apple-converted-space">               
</span>xlog("L_INFO", "</span><span class="x_gmail-s2" style="font-variant-ligatures:no-common-ligatures; color:rgb(52,188,38)">[$ci][$mi][CSeq $cs]</span><span class="x_gmail-s1" style="font-variant-ligatures:no-common-ligatures"> retcode is an integer \n")</span><span class="x_gmail-s3" style="font-variant-ligatures:no-common-ligatures; color:rgb(82,48,225)">;</span></p>
<p class="x_gmail-p1" style="margin:0px; font-variant-numeric:normal; font-variant-east-asian:normal; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span class="x_gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="x_gmail-Apple-converted-space">       
</span>}</span></p>
<p class="x_gmail-p2" style="margin:0px; font-variant-numeric:normal; font-variant-east-asian:normal; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0); min-height:13px">
<span class="x_gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br>
</p>
<p class="x_gmail-p1" style="margin:0px; font-variant-numeric:normal; font-variant-east-asian:normal; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span class="x_gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="x_gmail-Apple-converted-space">       
</span>if(typeof("$retcode", "str"))</span></p>
<p class="x_gmail-p1" style="margin:0px; font-variant-numeric:normal; font-variant-east-asian:normal; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span class="x_gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="x_gmail-Apple-converted-space">       
</span>{</span></p>
<p class="x_gmail-p1" style="margin:0px; font-variant-numeric:normal; font-variant-east-asian:normal; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span class="x_gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="x_gmail-Apple-converted-space">               
</span>xlog("L_INFO", "</span><span class="x_gmail-s2" style="font-variant-ligatures:no-common-ligatures; color:rgb(52,188,38)">[$ci][$mi][CSeq $cs]</span><span class="x_gmail-s1" style="font-variant-ligatures:no-common-ligatures"> retcode is a string \n")</span><span class="x_gmail-s3" style="font-variant-ligatures:no-common-ligatures; color:rgb(82,48,225)">;</span></p>
<p class="x_gmail-p1" style="margin:0px; font-variant-numeric:normal; font-variant-east-asian:normal; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span class="x_gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="x_gmail-Apple-converted-space">       
</span>}</span></p>
<p class="x_gmail-p1" style="margin:0px; font-variant-numeric:normal; font-variant-east-asian:normal; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span class="x_gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br>
</span></p>
<p class="x_gmail-p1" style="margin:0px; font-variant-numeric:normal; font-variant-east-asian:normal; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span class="x_gmail-s1" style="font-variant-ligatures:no-common-ligatures">None of these xlog outputed.</span></p>
<p class="x_gmail-p1" style="margin:0px; font-variant-numeric:normal; font-variant-east-asian:normal; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span class="x_gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br>
</span></p>
<p class="x_gmail-p1" style="margin:0px; font-variant-numeric:normal; font-variant-east-asian:normal; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">How do I check for $retcode in if or switch statement?</span></p>
<p class="x_gmail-p1" style="margin:0px; font-variant-numeric:normal; font-variant-east-asian:normal; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures"><br>
</span></p>
<p class="x_gmail-p1" style="margin:0px; font-variant-numeric:normal; font-variant-east-asian:normal; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures">Thanks</span></p>
<div><br>
</div>
-- <br>
<div dir="ltr" class="x_gmail_signature">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr" style="font-size:12.8px">Andy Chen</div>
<div dir="ltr" style="font-size:12.8px">
<div>Sr. Telephony Lead Engineer</div>
<div><a href="mailto:achen@thinkingphones.com" target="_blank">achen@</a><a href="http://fuze.com" target="_blank">fuze.com</a><br>
</div>
<div><br>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">*Confidentiality Notice: The information contained in this e-mail and any</span><br style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">attachments may be confidential. If you are not an intended recipient, you</span><br style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">are hereby notified that any dissemination, distribution or copying of this</span><br style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">e-mail is strictly prohibited. If you have received this e-mail in error,</span><br style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">please notify the sender and permanently delete the e-mail and any</span><br style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">attachments immediately. You should not retain, copy or use this e-mail or</span><br style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">any attachment for any purpose, nor disclose all or any part of the</span><br style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">
<span style="color:rgb(51,51,51); font-family:Arial,sans-serif; font-size:14px; background-color:rgb(255,255,255)">contents to any other person. Thank you.*</span></div>
</body>
</html>