[OpenSIPS-Users] dialog cluster
Slava Bendersky
volga629 at networklab.ca
Mon Jun 29 15:14:29 EST 2020
Hello Everyone,
With PgSQL dialog module in cluster latest master 3.1-dev active/active setup tries insert duplicate data from each node.
This setup contain 3 vips for each node on LAN and WAN sides.
/usr/sbin/opensips[1727986]: ERROR:db_postgres:db_postgres_submit_query: 0x7f4eb5e95e28 PQsendQuery Error: ERROR: duplicate key value violates unique constraint "dialog_pkey"#012DETAIL: Key (dlg_id)=(7546448396242) already exists.#012 Query:
Might be some miss configuration, but can find what the issue
#### Dialog
loadmodule "dialog.so"
#modparam("dialog", "db_url", "postgres:///opensips")
modparam("dialog", "db_mode", 2)
modparam("dialog","profiles_with_value","outbound; inbound")
modparam("dialog", "dlg_match_mode", 1)
modparam("dialog", "default_timeout", 3600)
modparam("dialog", "options_ping_interval", 900)
modparam("dialog", "profiles_with_value", "caller ; domain")
modparam("dialog", "dialog_replication_cluster", 1)
if(!has_totag() && is_method("INVITE") && !has_body("application/csta+xml")) {
create_dialog();
topology_hiding();
### Set profile ###
### Set profile ###
set_dlg_profile("caller",$fU@$fd);
set_dlg_profile("domain",$fd);
get_profile_size("caller",$fU@$fd,$var(ccaller));
get_profile_size("caller",$fd,$var(cdomain));
xlog("Number of calls from user $fU@$fd is $var(ccaller)");
xlog("Number of calls from domain $fd is $var(cdomain)");
xlog("Got request on ip addr [$socket_in(ip)] and call dir $avp(DLG_dir)\n");
# Wan route
$var(ip_lst) = $shv(vip_wan_lst);
route(SET_SOURCE_SOCKET);
if($avp(DLG_dir)=="topbx") {
switch($(avp(req_ip){s.select,3,.})) {
case "38":
set_dlg_sharing_tag("vip1");
xlog("[$rm] Set dialog tag vip1 ~> $(avp(req_ip){s.select,3,.})\n");
break;
case "39":
set_dlg_sharing_tag("vip2");
xlog("[$rm] Set dialog tag vip2 ~> $(avp(req_ip){s.select,3,.})\n");
break;
case "40":
set_dlg_sharing_tag("vip3");
xlog("[$rm] Set dialog tag vip3 ~> $(avp(req_ip){s.select,3,.})\n");
break;
default:
xlog("[$rm] Unknown last octet ~> $(avp(req_ip){s.select,3,.})\n");
}
}
}
Any help thank you, volga629
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20200629/52b6a358/attachment-0001.html>
More information about the Users
mailing list