[OpenSIPS-Users] Issue Using avp_db_query()

Mark Farmer farmorg at gmail.com
Thu Feb 4 10:03:22 EST 2021


Thank you Alain. Almost - this worked:

avp_db_query("SELECT customer FROM customer_sbcs WHERE sbc1 = '$avp(sbc)'",
"$avp(custID)", 1);

Slightly irritating as I was sure I'd tried that :)

Thanks again!
Mark.


On Wed, 3 Feb 2021 at 17:42, Alain Bieuzent <alain.bieuzent at free.fr> wrote:

> Hi Mark,
>
>
>
> For me correct syntax will be :
>
> avp_db_query("SELECT customer FROM customer_sbcs WHERE sbc1 =
> $avp(sbc)", "$avp(custID)", 1);
>
>
>
> Regards
>
>
>
>
>
> *De : *Users <users-bounces at lists.opensips.org> au nom de Mark Farmer <
> farmorg at gmail.com>
> *Répondre à : *OpenSIPS users mailling list <users at lists.opensips.org>
> *Date : *mercredi 3 février 2021 à 18:22
> *À : *OpenSIPS users mailling list <users at lists.opensips.org>
> *Objet : *[OpenSIPS-Users] Issue Using avp_db_query()
>
>
>
> Hello everyone.
>
>
>
> I am trying to do a database lookup using avp_db_query() and getting an
> error in my log:
>
>
>
> ERROR:core:get_cmd_fixups: Variable in param [2] is not a string
>
> ERROR:core:do_action: Failed to get fixups for command <avp_db_query>
>
>
>
> It seems the query is erroring as $rc is always -1
>
>
>
> CUSTOM_LOG: DB Query Return Code: -1
>
>
>
> I have a database connection setup with a numerical ID.
>
> This is my avp_db_query() line:
>
>
>
> avp_db_query("SELECT customer FROM customer_sbcs WHERE sbc1 =
> '$avp(sbc)'",$avp(custID), 1);
>
>
>
> $avp(sbc) is set just before and has a valid text value that should match.
>
>
>
> Is anyone able to tell me where I am going wrong please?
>
>
>
> Many thanks!
>
> Mark.
>
>
>
> _______________________________________________ Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>


-- 
Mark Farmer
farmorg at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20210204/7605d975/attachment.html>


More information about the Users mailing list