If your linux distribution is Centos you have to install
unixODBC-devel postgresql-odbc unixODBC then compile freeswitch.
Look at this wiki page:
http://wiki.freeswitch.org/wiki/Mod_spidermonkey_odbc
BR