[Freeswitch-users] No calls recovery using postgresql in HA

Francisco Carmona Ramírez franciscocarmona777 at gmail.com
Wed May 22 07:58:13 UTC 2019


Hi all,

I'm working in a HA in Freeswitch v1.8, but i found a lot of troubles for
do that, i follow the guide that I found here
https://freeswitch.org/confluence/display/FREESWITCH/High+Availability ,
but i can't solve my problem, following I will present my configuration

I use keepalived to solve the problem with the floating IP, now the IP
starts in master, when that goes down, the IP change to the slave, and when
the master goes up, the IP comes other time to him, in that part I don't
have problems.

Then I use PostgreSQL for the database that i need to recover calls, in bot
servers i have the same configuration of postgresql

----------------------------------------------------------------------------------------------------------
 /var/lib/pgsql/data/postgresql.conf

 listen_addresses = '*'

 and in

  /var/lib/pgsql/data/pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             all                     md5
# IPv6 local connections:
host    all             all             ::1/128                 md5

----------------------------------------------------------------------------------------------------------------

Both databases are accessible both from freeswitch and from the other server


Then that is my configuration in master
--------------------------------------------------------------------------------------------------------------------
In /usr/local/freeswitch/conf/sip_profiles/internal.xml and in
/usr/local/freeswitch/conf/sip_profiles/external.xml i have


    <param name="track-calls" value="true"/>

/usr/local/freeswitch/conf/autoload_configs/switch.conf.xml

    <param name="core-db-dsn" value="pgsql://hostaddr= ip_master
dbname=freeswitch user=postgres password='password' options='-c
client_min_messages=NOTICE'  application_name='freeswitch'"/>
    <param name="core-recovery-db-dsn" value="pgsql://hostaddr= ip_slave
dbname=freeswitch user=postgres password='password' options='-c
client_min_messages=NOTICE'  application_name='freeswitch'"/>

----------------------------------------------------------------------------------

That is the configuration in slave
In /usr/local/freeswitch/conf/sip_profiles/internal.xml and in
/usr/local/freeswitch/conf/sip_profiles/external.xml i have
    <param name="track-calls" value="true"/>

/usr/local/freeswitch/conf/autoload_configs/switch.conf.xml

    <param name="core-db-dsn" value="pgsql://hostaddr= ip_slave
dbname=freeswitch user=postgres password='password' options='-c
client_min_messages=NOTICE'  application_name='freeswitch'"/>
    <param name="core-recovery-db-dsn" value="pgsql://hostaddr= ip_master
dbname=freeswitch user=postgres password='password' options='-c
client_min_messages=NOTICE'  application_name='freeswitch'"/>

--------------------------------------------------------------------------------------------------------------
When i make a call, i can see it in the local database of the server that
perfors it, but no in the other

when i goes to fs_cli and make a db_cache status i recieved that

------------------------------------------------------------------------------------------------------


freeswitch at freeswitch> db_cache status
db="freeswitch",type="core_db"
        Type: CORE_DB
        Last used: 1
        Total used: 5372
        Flags: Unlocked, Detached(0)
        Creator: sofia_glue.c:2499
        Last User: sofia_glue.c:2535
db="hostaddr= ip dbname=freeswitch user=postgres password=",type="odbc"
        Type: PGSQL
        Last used: 0
        Total used: 6477
        Flags: Unlocked, Detached(0)
        Creator: src/switch_console.c:255
        Last User: src/switch_console.c:255
db="fifo",type="core_db"
        Type: CORE_DB
        Last used: 64648
        Total used: 1
        Flags: Locked, Attached(1)
        Creator: src/switch_core_sqldb.c:2058
        Last User:
db="freeswitch",type="core_db"
        Type: CORE_DB
        Last used: 64650
        Total used: 2
        Flags: Locked, Attached(1)
        Creator: sofia_glue.c:2268
        Last User: src/switch_core_sqldb.c:2058
db="freeswitch",type="core_db"
        Type: CORE_DB
        Last used: 64650
        Total used: 2
        Flags: Locked, Attached(1)
        Creator: sofia_glue.c:2268
        Last User: src/switch_core_sqldb.c:2058
db="hostaddr= ip dbname=freeswitch user=postgres password=",type="odbc"
        Type: PGSQL
        Last used: 64650
        Total used: 2
        Flags: Locked, Attached(1)
        Creator: src/switch_core_sqldb.c:3375
        Last User: src/switch_core_sqldb.c:2058
6 total. 4 in use.


---------------------------------------------------------------------------------------------------------
With this information, i think the problem is with the
"core-recovery-db-dsn" but i can solve it, someone know how to solve this
issue?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20190522/2f45dd9d/attachment-0001.html>


More information about the FreeSWITCH-users mailing list