<html><head></head><body><div class="yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir="ltr" data-setdir="false"><div><div>Hello,</div><div><br></div><div>I am trying to test a REST API call using the example code provided in the documentation. I am experiencing the following error and opensips would not start. I am running opensips 3.1.1 (x86_64/linux) on Debian 10. Any help would be appreciated. Curl is also installed and i am able to query a URL successfully Thank you</div><div><br></div><div>...</div><div># Example of querying a REST service to get the credit of an account</div><div>$var(rc) = rest_get("https://getcredit.org/?account=$fU",</div><div>                    $var(credit),</div><div>                    $var(ct),</div><div>                    $var(rcode));</div><div>if ($var(rc) < 0) {</div><div><span style="white-space: pre-wrap;">  </span>xlog("rest_get() failed with $var(rc), acc=$fU\n");</div><div><span style="white-space: pre-wrap;">  </span>send_reply(500, "Server Internal Error");</div><div><span style="white-space: pre-wrap;">    </span>exit;</div><div>}</div><div><br></div><div>if ($var(rcode) != 200) {</div><div><span style="white-space: pre-wrap;"> </span>xlog("L_INFO", "rest_get() rcode=$var(rcode), acc=$fU\n");</div><div><span style="white-space: pre-wrap;"> </span>send_reply(403, "Forbidden");</div><div><span style="white-space: pre-wrap;">        </span>exit;</div><div>}</div><div><br></div><div><br></div><div><br></div><div>Jan 24 22:20:48 OpenSIPS /usr/sbin/opensips[739]: INFO:rest_client:mod_init: Module initialized!</div><div>Jan 24 22:20:48 OpenSIPS /usr/sbin/opensips[739]: INFO:auth:mod_init: initializing...</div><div>Jan 24 22:20:48 OpenSIPS /usr/sbin/opensips[739]: ERROR:core:fix_cmd: Param [2] expected to be a variable</div><div>Jan 24 22:20:48 OpenSIPS /usr/sbin/opensips[739]: ERROR:core:fix_actions: Failed to fix command <rest_get></div><div>Jan 24 22:20:48 OpenSIPS /usr/sbin/opensips[739]: ERROR:core:fix_actions: fixing failed (code=-6) at /etc/opensips/opensips.cfg:232</div><div>Jan 24 22:20:48 OpenSIPS /usr/sbin/opensips[739]: CRITICAL:core:fix_expr: fix_actions error</div><div>Jan 24 22:20:48 OpenSIPS /usr/sbin/opensips[739]: ERROR:core:main: failed to fix configuration with err code -6</div><div><br></div><div>Thank you,</div><div>Dinesh</div></div><br></div></div></body></html>