[OpenSIPS-Users] Central database

Bogdan-Andrei Iancu bogdan at opensips.org
Wed Jan 19 07:35:42 UTC 2022


Hi Alberto,

For the dialog replications, the noSQL is used only for counters on the 
dialog profiles, not for sharing the calls. The calls are shared 
directly via the clustering layer and you will see the same of dialogs 
on all OpenSIPs nodes (via MI dlg_list). Of course, you can combine a 
SQL DB in dialog module, for dumping the dialogs into DB. In this way, 
whatever is in memory (either calls started by the node, either calls 
received via replication) will also end up in the SQL DB.

Best regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS eBootcamp 2021
   https://opensips.org/training/OpenSIPS_eBootcamp_2021/

On 1/18/22 6:26 PM, Alberto wrote:
> Hi,
>
> Thanks, I was playing around with the clusterer module, but I can't 
> quite figure something out.
>
> In the database I have this entry in the clusterer table:
> id: 1
> cluster_id: 1
> node_id: 1
> url: bin:10.0.0.184:5555 <http://10.0.0.184:5555>
> state: 1
> no_ping_retries: 3
> priority: 50
> sip_addr: 10.0.0.184
> flags: seed
>
> And here's my configuration:
>
> loadmodule "clusterer.so"
> modparam("clusterer", "db_url", 
> "unixodbc://opensips:opensipsrw@localhost/opensips")
> modparam("clusterer", "my_node_id", 1)
>
> loadmodule "dialog.so"
> modparam("dialog", "default_timeout", 14400) # 4 hours
> modparam("dialog", "dlg_match_mode", 1)
> modparam("dialog", "enable_stats", 0)
> modparam("dialog", "profiles_with_value", "caller")
> modparam("dialog", "cachedb_url", "mongodb://db.dialog")
> modparam("dialog", "dialog_replication_cluster", 1)
>
> loadmodule "usrloc.so"
> modparam("usrloc", "nat_bflag", "NAT")
> modparam("usrloc", "use_domain", 1)
> modparam("usrloc", "cachedb_url", "mongodb://db.usrloc")
> modparam("usrloc", "working_mode_preset", "federation-cachedb-cluster")
> modparam("usrloc", "location_cluster", 1)
>
>
> Now when a user registers, the usrloc collection in mongodb gets 
> populated with some details.
> But when I start a call instead, the dialog collection stays empty. 
> What do I need to do to write the dialogs?
> I'm testing with only one opensips server for now, so that's the only 
> entry in the clusterer table.
> Thanks.
>
> On Tue, 18 Jan 2022 at 12:50, Bogdan-Andrei Iancu <bogdan at opensips.org 
> <mailto:bogdan at opensips.org>> wrote:
>
>     Hi Aberto,
>
>     It is not a good strategy to blindly share the tables for usrloc
>     or dialog between multiple opensips instances, as this will lead
>     to data conflicts. Of course, you can have all pointing to the
>     same DB, but one table per opensips server.
>
>     If you want to aggregate the data (between all opensips
>     instances), there is no other way than using the clustering .
>
>     Regards,
>
>     Bogdan-Andrei Iancu
>
>     OpenSIPS Founder and Developer
>        https://www.opensips-solutions.com  <https://www.opensips-solutions.com>
>     OpenSIPS eBootcamp 2021
>        https://opensips.org/training/OpenSIPS_eBootcamp_2021/  <https://opensips.org/training/OpenSIPS_eBootcamp_2021/>
>
>     On 1/16/22 1:47 PM, Alberto wrote:
>>     Hi,
>>     I need several opensips servers to save usrloc and dialog to the
>>     same central database, not for clustering/ha, but for reporting
>>     and billing.
>>     Is it safe to point multiple usrloc and dialog modules to a
>>     central database using the db_url? Or would they cause conflicts?
>>     Since it's not a cluster where they use the shared information, I
>>     would prefer to avoid the complexity of the clusterer module. But
>>     I need to know one server won't cancel another server location or
>>     dialog.
>>     Thanks
>>
>>     _______________________________________________
>>     Users mailing list
>>     Users at lists.opensips.org  <mailto:Users at lists.opensips.org>
>>     http://lists.opensips.org/cgi-bin/mailman/listinfo/users  <http://lists.opensips.org/cgi-bin/mailman/listinfo/users>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20220119/1182fee5/attachment.html>


More information about the Users mailing list