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

Joseph Waite joelists at tm.net.uk
Wed May 22 20:31:36 UTC 2019


Have you setup replication in your databases??

You say that when you make a call on master you can see it in the database there but not on the other.

This sounds like the databases are not replicated or something is wrong in the database replication. If the second server has no details of the call in the database then it can not recover.

Regards

Joe Waite

> On 22 May 2019, at 08:58, Francisco Carmona Ramírez <franciscocarmona777 at gmail.com> wrote:
> 
> 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?
> _________________________________________________________________________
> 
> The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
> Build your next product on our scalable cloud platform.
> 
> Join our online community to chat in real time https://signalwire.community
> 
> Professional FreeSWITCH Services
> sales at freeswitch.com
> https://freeswitch.com
> 
> Official FreeSWITCH Sites
> https://freeswitch.com/oss
> https://freeswitch.org/confluence
> https://cluecon.com
> 
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> https://freeswitch.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20190522/a6c6fbdd/attachment.html>


More information about the FreeSWITCH-users mailing list