[OpenSIPS-Users] rest_client behavior change in module version 2.2.3?
Andreas Sikkema
h323 at ramdyne.nl
Tue Mar 7 06:30:18 EST 2017
Hi,
I am using the rest_client to retrieve some information about an
incoming call using the following:
if
(!rest_get("http://127.0.0.1:8888/dir/search?number_a=$fU&number_b=$rU",
"$var(name)", "$var(ct)", "$var(rcode)")) {
xlog("Error code $var(rcode) in HTTP GET!\n");
}
else {
xlog("Received $var(name) using REST for A number $fU and B number $rU\n");
# magic
}
In rest_client module versions 2.2.2 (?) and before this worked like a
charm. When the web server returned a 404 or another error, the script
would log the error and go on. When rest_get() received a 200 OK, magic
would happen.
Since we upgraded to rest_client module version 2.2.3 this morning this
behavior changed. When the server returns a 404, rest_get doesn't error
out, but goes on as before, and my script now tries to do magic on a 404
message's HTML body. Which is not what I want...
Did I use the rest_get() return values incorrectly, or is it a bug?
--
Andreas Sikkema
More information about the Users
mailing list