[OpenSIPS-Users] Parsing response from rest_client
Andreas Bøckmann
monkeilas at gmail.com
Thu May 11 08:35:56 EDT 2017
Hello
I am running OpenSIPS 2.3 and using something along these lines:
async(rest_get("$var(push_url)", "$var(push_response)"),
handle_push_response);
..
xlog("L_NOTICE","L16.02, PUSHRESPONSE cid=$ci,
RESPONSE=$var(push_response)\n");
..
if (pcre_match("$avp(push_response)","OK")) {
..
}
The xlog entry shows /usr/local/sbin/opensips[415]: L16.02, PUSHRESPONSE
cid=9ad0Ads0duSAUdj0asd39, RESPONSE={"response":"OK"}
I observe the following errors in logs (see below).
Wouldn't make sense to cast it to int I guess and I see no s.string?
: ERROR:core:fixup_get_svalue: no valid PV value found (error in scripts)
: ERROR:regex:w_pcre_match: cannot print the format for string
The pcre_match does not seem to be able to match "OK".
Any suggestions as to what I am doing wrong here or how I should do it?
The same script seems to work with 2.1/2.2.
Thanks!
Kind regards,
Andy Thompson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20170511/f0791746/attachment.html>
More information about the Users
mailing list