<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">but that table layout is like that because you imported the tables, i was asking what is in the recreated sqlite ones.  If it fails to connect like you later describe, its going to fall back, you should see stuff in the fs logs on startup about this.  the odbc configs go in the normal place they go in the os, not in fs specific dirs.  Those errors tell me something is up, but not sure what, might need to turn on some debug on pg side to see.  some of our tests like to see if table schema is right throw errors then we act on them, if you restart a second time you should get a more useful set of errors.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 24, 2018, at 1:11 PM, Blackhold <<a href="mailto:blackholdmailer@gmail.com" class="">blackholdmailer@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi,<div class="">The tables are:</div><div class=""><br class=""></div><div class=""><div class="">ostgres@freeswitch-capa8:~/sql$ psql freeswitch_db</div><div class="">freeswitch_db-# \dt</div><div class=""><br class=""></div><div class="">                        List of relations</div><div class=""> Schema |                Name                 | Type  |  Owner   </div><div class="">--------+-------------------------------------+-------+----------</div><div class=""> public | aliases                             | table | postgres</div><div class=""> public | calls                               | table | postgres</div><div class=""> public | channels                            | table | postgres</div><div class=""> public | complete                            | table | postgres</div><div class=""> public | db_data                             | table | postgres</div><div class=""> public | fifo_bridge                         | table | postgres</div><div class=""> public | fifo_callers                        | table | postgres</div><div class=""> public | fifo_outbound                       | table | postgres</div><div class=""> public | group_data                          | table | postgres</div><div class=""> public | interfaces                          | table | postgres</div><div class=""> public | json_store                          | table | postgres</div><div class=""> public | limit_data                          | table | postgres</div><div class=""> public | nat                                 | table | postgres</div><div class=""> public | recovery                            | table | postgres</div><div class=""> public | registrations                       | table | postgres</div><div class=""> public | sip_authentication                  | table | postgres</div><div class=""> public | sip_dialogs                         | table | postgres</div><div class=""> public | sip_presence                        | table | postgres</div><div class=""> public | sip_registrations                   | table | postgres</div><div class=""> public | sip_shared_appearance_dialogs       | table | postgres</div><div class=""> public | sip_shared_appearance_subscriptions | table | postgres</div><div class=""> public | sip_subscriptions                   | table | postgres</div><div class=""> public | tasks                               | table | postgres</div><div class=""> public | voicemail_msgs                      | table | postgres</div><div class=""> public | voicemail_prefs                     | table | postgres</div><div class="">(25 rows)</div></div><div class=""><br class=""></div><div class="">I continued testing and found that if I configure switch.conf.xml file like this:</div><div class=""><br class=""></div><div class=""><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class=""><param name="core-db-dsn" value="<a href="pgsql://hostaddr=127.0" class="">pgsql://hostaddr=127.0</a>.</span><wbr style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial" class=""><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class="">0.1 dbname=freeswitch_db user=freeswitch_user password='****' options='-c client_min_messages=NOTICE'" /></span><br class=""></div><div class=""><br class=""></div><div class="">When I turn on freeswitch, postgresql don't output nothing. Then I tried to configure freeswitch using odbc I then YES I get something in postgresql logs</div><div class=""><br class=""></div><div class="">For odbc I have something not clear, it is mandatory to put files in /usr/local/freeswitch/etc ? or leaving them at default directory (/etc) is enough?</div><div class=""><br class=""></div><div class="">Here I show the config of odbc files:</div><div class=""><div class="">root@freeswitch-capa8:/etc# cat odbc.ini </div><div class="">[freeswitch]</div><div class="">; WARNING: The old psql odbc driver psqlodbc.so is now renamed psqlodbcw.so</div><div class="">; in version 08.x. Note that the library can also be installed under an other</div><div class="">; path than /usr/local/lib/ following your installation.</div><div class="">; Driver = /usr/lib64/odbc/psqlodbcw.so</div><div class="">; Driver = /usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so</div><div class="">Driver = /usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so</div><div class="">Description=Connection to LDAP/POSTGRESQL</div><div class="">Servername=localhost </div><div class="">Port=5432 </div><div class="">Protocol=6.4</div><div class="">FetchBufferSize=99</div><div class="">Username=freeswitch_user</div><div class="">Password=XXX</div><div class="">Database=freeswitch_db</div><div class="">ReadOnly=no</div><div class="">Debug=0</div><div class="">CommLog=0</div></div><div class=""><br class=""></div><div class=""><div class="">root@freeswitch-capa8:/etc# cat odbcinst.ini </div><div class="">[PostgreSQL]</div><div class="">Description = PostgreSQL driver for Linux & Win32</div><div class="">;Driver = /usr/lib64/odbc/psqlodbcw.so</div><div class="">Driver = /usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so</div><div class="">Threading = 0</div><div class="">MaxLongVarcharSize=65536</div></div><div class=""><br class=""></div><div class="">And then connect to psql through odbc</div><div class=""><br class=""></div><div class=""><div class="">root@freeswitch-capa8:/etc# isql -v freeswitch</div><div class="">+---------------------------------------+</div><div class="">| Connected!                            |</div><div class="">|                                       |</div><div class="">| sql-statement                         |</div><div class="">| help [tablename]                      |</div><div class="">| quit                                  |</div><div class="">|                                       |</div><div class="">+---------------------------------------+</div><div class="">SQL> </div></div><div class=""><br class=""></div><div class="">Then in file switch.conf.xml I changed db connection configuration</div><div class=""><br class=""></div><div class=""><div class="">root@freeswitch-capa8:/usr/local/freeswitch/conf/autoload_configs# cat switch.conf.xml |grep core-db-dsn</div><div class="">    <param name="core-db-dsn" value="<a href="pgsql://hostaddr=127.0.0.1" class="">pgsql://hostaddr=127.0.0.1</a> dbname=freeswitch_db user=freeswitch_user password='XXX' options='-c client_min_messages=NOTICE'" /></div><div class="">    <!--<param name="core-db-dsn" value="freeswitch:freeswitch_user:XXX"/>--></div></div><div class=""><br class=""></div><div class="">Last night SwK user at freenode channel told me that freeswitch on turning on, it creates tables at database (thanks SwK).</div><div class=""><br class=""></div><div class="">I spect that configuration of odbc is working but drops lot of errors (here you have some lines):</div><div class=""><br class=""></div><div class=""><div class="">2018-05-24 02:03:25 CEST [3099-338780] freeswitch_user@freeswitch_db STATEMENT:  PREPARE "_PLAN0x140bf90" as CREATE TABLE nat (</div><div class=""><span style="white-space:pre" class="">      </span>   sticky  INTEGER,</div><div class=""><span style="white-space:pre" class="">              </span>port<span style="white-space:pre" class="">      </span>INTEGER,</div><div class=""><span style="white-space:pre" class="">                </span>proto<span style="white-space:pre" class="">     </span>INTEGER,</div><div class=""><span style="white-space:pre" class="">        </span>   hostname VARCHAR(256)</div><div class=""><span style="white-space:pre" class="">      </span>);</div><div class=""><span style="white-space:pre" class="">      </span>;EXECUTE "_PLAN0x140bf90"</div><div class="">2018-05-24 02:03:25 CEST [3099-338781] freeswitch_user@freeswitch_db WARNING:  there is already a transaction in progress</div><div class="">2018-05-24 02:03:25 CEST [3099-338782] freeswitch_user@freeswitch_db ERROR:  relation "registrations" does not exist at character 41</div><div class="">2018-05-24 02:03:25 CEST [3099-338783] freeswitch_user@freeswitch_db STATEMENT:  PREPARE "_PLAN0x140bf90" as delete from registrations where reg_user='';EXECUTE "_PLAN0x140bf90"</div><div class="">2018-05-24 02:03:25 CEST [3099-338784] freeswitch_user@freeswitch_db WARNING:  there is already a transaction in progress</div><div class="">2018-05-24 02:03:25 CEST [3099-338785] freeswitch_user@freeswitch_db ERROR:  syntax error at or near "DROP" at character 29</div><div class="">2018-05-24 02:03:25 CEST [3099-338786] freeswitch_user@freeswitch_db STATEMENT:  PREPARE "_PLAN0x140bf90" as DROP TABLE registrations;EXECUTE "_PLAN0x140bf90"</div><div class="">2018-05-24 02:03:25 CEST [3099-338787] freeswitch_user@freeswitch_db WARNING:  there is already a transaction in progress</div><div class="">2018-05-24 02:03:25 CEST [3099-338788] freeswitch_user@freeswitch_db ERROR:  syntax error at or near "CREATE" at character 29</div><div class="">2018-05-24 02:03:25 CEST [3099-338789] freeswitch_user@freeswitch_db STATEMENT:  PREPARE "_PLAN0x140bf90" as CREATE TABLE registrations (</div><div class=""><span style="white-space:pre" class="">       </span>   reg_user      VARCHAR(256),</div><div class=""><span style="white-space:pre" class=""> </span>   realm     VARCHAR(256),</div><div class=""><span style="white-space:pre" class="">     </span>   token     VARCHAR(256),</div><div class=""><span style="white-space:pre" class="">     </span>   url      TEXT,</div><div class=""><span style="white-space:pre" class="">      </span>   expires  INTEGER,</div><div class=""><span style="white-space:pre" class="">     </span>   network_ip VARCHAR(256),</div><div class=""><span style="white-space:pre" class="">   </span>   network_port VARCHAR(256),</div><div class=""><span style="white-space:pre" class=""> </span>   network_proto VARCHAR(256),</div><div class=""><span style="white-space:pre" class="">        </span>   hostname VARCHAR(256),</div><div class=""><span style="white-space:pre" class="">     </span>   metadata VARCHAR(256)</div><div class=""><span style="white-space:pre" class="">      </span>);</div><div class=""><span style="white-space:pre" class="">      </span>;EXECUTE "_PLAN0x140bf90"</div><div class="">2018-05-24 02:03:25 CEST [3099-338790] freeswitch_user@freeswitch_db WARNING:  there is already a transaction in progress</div><div class="">2018-05-24 02:03:25 CEST [3099-338791] freeswitch_user@freeswitch_db LOG:  unexpected EOF on client connection with an open transaction</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I tested with tables in psql database and without tables in psql database.</div><div class=""><span style="color:rgb(80,0,80);font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="color:rgb(80,0,80);font-size:12.8px" class="">freeswitch@freeswitch-capa8> version</span><br class=""></div><div class=""><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class="">FreeSWITCH Version 1.9.0+git~20180516T211208Z~</span><wbr style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial" class=""><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class="">3c7db639fd~64bit (git 3c7db63 2018-05-16 21:12:08Z 64bit)</span><br class=""></div><div class=""><br class=""></div><div class="">As I told in last mail, I'm working with last git version.</div><div class=""><br class=""></div><div class="">Then I have a last question, related to that (db), when it will work, all mods will save the information to pgsql or a mix some to sqlite and some to pgsql? I saw in other files the availibility to configure also db, like <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class="">/usr/local/freeswitch/conf/sip_profiles/internal.xml</span></div><div class=""><br class=""></div><div class=""><div class="">root@freeswitch-capa8:/usr/local/freeswitch/conf# cat /usr/local/freeswitch/conf/sip_profiles/internal.xml |grep db</div><div class="">    <!-- Name of the db to use for this profile --></div><div class="">    <!--<param name="dbname" value="share_presence"/>--></div><div class="">    <!--<param name="odbc-dsn" value="dsn:user:pass"/>--></div><div class="">    <!--<param name="odbc-dsn" value="freeswitch:freeswitch_user:XXX"/>--></div><div class="">    <!--    <param name="odbc-dsn" value="<a href="pgsql://hostaddr=127.0.0.1" class="">pgsql://hostaddr=127.0.0.1</a> dbname=freeswitch_db user=freeswitch_user password='XXX' options='-c client_min_messages=NOTICE' application_name='freeswitch'" /> --></div><div class="">    <!--all inbound reg will stored in the db using this domain --></div><div class="">    <param name="force-register-db-domain" value="$${domain}"/></div></div><div class=""><br class=""></div><div class="">The config you see in the mail is the last configuration I defined. Yesterday I get lost with wich config work or wich one no...</div><div class=""><br class=""></div><div class="">I feel I'm almost at end of this installation! I'm doing a step by step manual in spanish to how to install last version of freeswitch, this will be public and if you want I could upload to wiki.</div><div class=""><br class=""></div><div class="">Thanks you much for your help :)</div><div class=""><br class=""></div><div class="">References: </div><div class=""><a href="https://freeswitch.org/confluence/display/FREESWITCH/PostgreSQL+in+the+core" class="">https://freeswitch.org/confluence/display/FREESWITCH/PostgreSQL+in+the+core</a></div><div class=""><a href="https://freeswitch.org/confluence/display/FREESWITCH/ODBC+DSN" class="">https://freeswitch.org/confluence/display/FREESWITCH/ODBC+DSN</a><br class=""></div><div class=""><a href="https://freeswitch.org/confluence/display/FREESWITCH/FreeSWITCH+Databases" class="">https://freeswitch.org/confluence/display/FREESWITCH/FreeSWITCH+Databases</a><br class=""></div><div class=""><br class=""></div></div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature" data-smartmail="gmail_signature"><br class="">- Blackhold<br class=""><a href="http://blackhold.nusepas.com/" target="_blank" class="">http://blackhold.nusepas.com</a><br class="">@blackhold_<br class="">~> cal lluitar contra el fort per deixar de ser febles, i contra nosaltres mateixos quan siguem forts (Xirinacs)<br class=""><°((( ><</div></div>
<br class=""><div class="gmail_quote">2018-05-24 18:21 GMT+02:00 Michael Jerris <span dir="ltr" class=""><<a href="mailto:mike@jerris.com" target="_blank" class="">mike@jerris.com</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">what tables are ending up in the recreated sqlite db?  You need to set it for the modules that use sqlite too (like for mod_sofia).  we have a global var for this in default configs.<br class="">
<span class=""><br class="">
> On May 23, 2018, at 6:13 PM, Blackhold <<a href="mailto:blackholdmailer@gmail.com" class="">blackholdmailer@gmail.com</a>> wrote:<br class="">
> <br class="">
> Hi,<br class="">
> I have just installed freeswitch 1.9<br class="">
> <br class="">
> freeswitch@freeswitch-capa8> version<br class="">
> FreeSWITCH Version 1.9.0+git~20180516T211208Z~<wbr class="">3c7db639fd~64bit (git 3c7db63 2018-05-16 21:12:08Z 64bit)<br class="">
> <br class="">
> And I'm trying to freeswitch use postgresql instead sqlitedb.<br class="">
> <br class="">
> I have configured the file switch.conf.xml of /usr/local/freeswitch/conf/<wbr class="">autoload_configs with uncomenting and configuring this line<br class="">
> <br class="">
>     <param name="core-db-dsn" value="<a href="pgsql://hostaddr=127.0" class="">pgsql://hostaddr=127.0</a>.<wbr class="">0.1 dbname=freeswitch_db user=freeswitch_user password='****' options='-c client_min_messages=NOTICE'" /><br class="">
> <br class="">
> then I exported all sqlitedbs to sql and then imported to a database that I have created in postgresql<br class="">
> <br class="">
> I have run again /etc/init.d/freeswitch.sh start<br class="">
> <br class="">
> But seems it still is taking sqlitedb.<br class="">
> <br class="">
> I tried to move the sqlitedbs files to other side and turned on again freeswitch, but it creates sqlitedbs again.<br class="">
> <br class="">
> What I'm missing? what I'm doing wrong? what could I check?<br class="">
<br class="">
<br class="">
</span>______________________________<wbr class="">______________________________<wbr class="">_____________<br class="">
Professional FreeSWITCH Consulting Services:<br class="">
<a href="mailto:consulting@freeswitch.org" class="">consulting@freeswitch.org</a><br class="">
<a href="http://www.freeswitchsolutions.com/" rel="noreferrer" target="_blank" class="">http://www.<wbr class="">freeswitchsolutions.com</a><br class="">
<br class="">
Official FreeSWITCH Sites<br class="">
<a href="http://www.freeswitch.org/" rel="noreferrer" target="_blank" class="">http://www.freeswitch.org</a><br class="">
<a href="http://confluence.freeswitch.org/" rel="noreferrer" target="_blank" class="">http://confluence.freeswitch.<wbr class="">org</a><br class="">
<a href="http://www.cluecon.com/" rel="noreferrer" target="_blank" class="">http://www.cluecon.com</a><br class="">
<br class="">
FreeSWITCH-users mailing list<br class="">
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" class="">FreeSWITCH-users@lists.<wbr class="">freeswitch.org</a><br class="">
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank" class="">http://lists.freeswitch.org/<wbr class="">mailman/listinfo/freeswitch-<wbr class="">users</a><br class="">
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank" class="">http://lists.<wbr class="">freeswitch.org/mailman/<wbr class="">options/freeswitch-users</a><br class="">
<a href="http://www.freeswitch.org/" rel="noreferrer" target="_blank" class="">http://www.freeswitch.org</a></blockquote></div><br class=""></div>
_________________________________________________________________________<br class="">Professional FreeSWITCH Consulting Services:<br class=""><a href="mailto:consulting@freeswitch.org" class="">consulting@freeswitch.org</a><br class="">http://www.freeswitchsolutions.com<br class=""><br class="">Official FreeSWITCH Sites<br class="">http://www.freeswitch.org<br class="">http://confluence.freeswitch.org<br class="">http://www.cluecon.com<br class=""><br class="">FreeSWITCH-users mailing list<br class="">FreeSWITCH-users@lists.freeswitch.org<br class="">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br class="">UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br class="">http://www.freeswitch.org</div></blockquote></div><br class=""></body></html>