<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><tt>Typical OpenSIPS scripting mistake #37: "mixing up $var and
$avp".</tt></p>
<p><tt>Regards,<br>
</tt></p>
<pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 11.05.2017 15:35, Andreas Bøckmann
wrote:<br>
</div>
<blockquote
cite="mid:CAN1RbiBFWj3TGR_5dVs8Vc5PrBv5s2whHR2MenDLkp21D_th-w@mail.gmail.com"
type="cite">
<div dir="ltr">Hello
<div><br>
</div>
<div>I am running OpenSIPS 2.3 and using something along these
lines:</div>
<div><br>
</div>
<div>
<div> async(rest_get("$var(push_url)",
"$var(push_response)"), handle_push_response);</div>
<div> ..</div>
<div> xlog("L_NOTICE","L16.02, PUSHRESPONSE cid=$ci,
RESPONSE=$var(push_response)\n");</div>
<div> ..</div>
<div> if (pcre_match("$avp(push_response)","OK")) {</div>
<div> ..</div>
<div> }</div>
<div> </div>
<div>The xlog entry shows /usr/local/sbin/opensips[415]:
L16.02, PUSHRESPONSE cid=9ad0Ads0duSAUdj0asd39,
RESPONSE={"response":"OK"}</div>
<div><br>
</div>
<div>I observe the following errors in logs (see below). </div>
<div>Wouldn't make sense to cast it to int I guess and I see
no s.string?</div>
<div><br>
</div>
<div>: ERROR:core:fixup_get_svalue: no valid PV value found
(error in scripts)</div>
<div>: ERROR:regex:w_pcre_match: cannot print the format for
string</div>
<div><br>
</div>
<div>The pcre_match does not seem to be able to match "OK". </div>
<div><br>
</div>
<div>Any suggestions as to what I am doing wrong here or how I
should do it? </div>
<div><br>
</div>
<div>The same script seems to work with 2.1/2.2.</div>
<div><br>
</div>
<div>Thanks!</div>
<div><br>
</div>
<div><br>
</div>
<div>Kind regards,</div>
<div><br>
</div>
<div>Andy Thompson</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>