a PGSQL app addon exactly like that of app_addon_sql_mysql.c in asterisk-addon
We should be able to use the command Pgsql in traditional dialplans .conf or new .ael by first setting a querystring and executing it.
Please see files attached.
Example ael code:
Set(QUERYSTRING=SELECT ROUND(${RATE}*${CALLDURATION},4) AS debit|RETURNVARS=DEBIT);
&mysql-selectquery();