SOLVED Use PostgreSQL In Dialplan

Status
Not open for further replies.

Sunny Gosain

New Member
Oct 27, 2020
11
0
1
52
Hi I am pretty new to FusionPBX. I'd like my Diaplan to query the fusionpbx PG db to check a condition/set a variable in the dial-plan. I'm in early stages and I followed the steps:
on my Debian 9.9 FusionPBX v 4.4.11

1. Create the database dsn Advance-->Databases | Save
2. I then go to the file system to see the change in config.lua but did not find any change there (The Advanced -->Script Editor is no longer available by default hence I wanted to check config.lua) I checked both
/etc/fusionpbx/config.lua
/usr/share/freeswitch/scripts/resources/config.lua

Nonetheless. My question is:

#1Whats the best practice to query db from the dial plan in other words what are the the steps involved in using SQL statements in the dial plan? Is there a way I can test in fs_cli or command line that I can connect to the database? I can write a lua script but I's wondering if there is a direct way to write a SQL in the dialplan.
I've been looking at some example (like below) . Is that the an acceptable way to query the PG db in fusion PBX. I've searched but could not find a concrete example. Please advise or point me to a resource link. Much appreciated.


<param name="odbc-dsn" value="$${dsn_system}"/>
<!--<param name="odbc-dsn" value="/var/www/fusionpbx/secure/fusionpbx.db"/>-->


<param name="sql" value="pgsql://hostaddr=127.0.0.1 dbname=fusionpbx user=fusionpbx password=xxxxxx"/>
<param name="sql" value="....
1609883958091.png
 
Last edited:
Status
Not open for further replies.