[SR-Users] Parser error with sql_pvquery?
Anthony Messina
amessina at messinet.com
Thu Mar 12 00:08:04 CET 2015
I'm trying to do an sql_pvquery() and have PostgreSQL return the default value
using COALESCE (if the other parts of the query return NULL) rather than
placing the $null check on the return in the Kamailio script. I seem to be
coming up on a parser issue, perhaps too many nested parentheses:
sql_pvquery("kamailio",
"SELECT COALESCE((SELECT value FROM usr_preferences WHERE
attribute='callee_rtp_transport'
AND (uuid='$sht(rtpengine=>$ci::$T_branch_idx::callee_ip)'
OR username='$rU') LIMIT 1), 'RTP/AVP')",
"$sht(rtpengine=>$ci::$T_branch_idx::callee_rtp_transport)");
<core> [cfg.y:3428]: yyerror_at(): parse error in config file
/etc/kamailio/kamailio.cfg, line 1444, column 14: syntax error
Is this query "too complex" for the parser, or is there something I've missed
above?
Thanks. -A
--
Anthony - https://messinet.com/ - https://messinet.com/~amessina/gallery
8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150311/431dbad4/attachment.sig>
More information about the sr-users
mailing list