Hey all,
Question regarding the type of retcode.
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:
xlog("L_INFO", "[$ci][$mi][CSeq $cs] Validating meeting ($rU). Result: $var(result) Return code: $retcode \n");
if(is_int($retcode))
{
xlog("L_INFO", "[$ci][$mi][CSeq $cs] retcode is an integer \n");
}
if(typeof("$retcode", "str"))
{
xlog("L_INFO", "[$ci][$mi][CSeq $cs] retcode is a string \n");
}
None of these xlog outputed.
How do I check for $retcode in if or switch statement?
Thanks
Sorry ignore this. Turns out I had the following sequence of events:
- http_query - xlog my result - check $retcode
turns out the $retcode was for the xlog,
My bad.
On Tue, Apr 9, 2019 at 5:03 PM Andrew Chen achen@fuze.com wrote:
Hey all,
Question regarding the type of retcode.
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:
xlog("L_INFO", "[$ci][$mi][CSeq $cs] Validating meeting ($rU). Result:
$var(result) Return code: $retcode \n");
if(is_int($retcode)) { xlog("L_INFO", "[$ci][$mi][CSeq $cs] retcode is an
integer \n");
} if(typeof("$retcode", "str")) { xlog("L_INFO", "[$ci][$mi][CSeq $cs] retcode is a string
\n");
}
None of these xlog outputed.
How do I check for $retcode in if or switch statement?
Thanks
-- Andy Chen Sr. Telephony Lead Engineer achen@ achen@thinkingphones.comfuze.com
Try to remove the first Xlog because Xlog returns also a $retcode.
________________________________ De : sr-users sr-users-bounces@lists.kamailio.org de la part de Andrew Chen achen@fuze.com Envoyé : mardi 9 avril 2019 23:03:08 À : Kamailio (SER) - Users Mailing List Objet : [SR-Users] Question regarding retcode
Hey all,
Question regarding the type of retcode.
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:
xlog("L_INFO", "[$ci][$mi][CSeq $cs] Validating meeting ($rU). Result: $var(result) Return code: $retcode \n");
if(is_int($retcode))
{
xlog("L_INFO", "[$ci][$mi][CSeq $cs] retcode is an integer \n");
}
if(typeof("$retcode", "str"))
{
xlog("L_INFO", "[$ci][$mi][CSeq $cs] retcode is a string \n");
}
None of these xlog outputed.
How do I check for $retcode in if or switch statement?
Thanks
-- Andy Chen Sr. Telephony Lead Engineer achen@mailto:achen@thinkingphones.comfuze.comhttp://fuze.com
*Confidentiality Notice: The information contained in this e-mail and any attachments may be confidential. If you are not an intended recipient, you are hereby notified that any dissemination, distribution or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender and permanently delete the e-mail and any attachments immediately. You should not retain, copy or use this e-mail or any attachment for any purpose, nor disclose all or any part of the contents to any other person. Thank you.*