On Wednesday, March 11, 2015 06:08:04 PM Anthony Messina wrote:
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
Nevermind... I was missing a '}' earlier in the script :( Sorry for the noise. -A