Re: [OpenSIPS-Users] mid_registrar work arround

2018-08-24 Thread volga629
small correction need change force_send_socket($var(src_socket)); to $fs = $var(src_socket); , becuse force_send_socket is not accepting variable expansion. volga629 On Fri, Aug 24, 2018 at 1:52 PM, volga...@networklab.ca wrote: Hello Ben, Thank you, that works. I though as final soultion

Re: [OpenSIPS-Users] mid_registrar work arround

2018-08-24 Thread volga629
Hello Ben, Thank you, that works. I though as final soultion some think like this, not sure if possibe do in more optimized way. route[SET_SOURCE_IP] { $var(i) = 0; while($var(i) < $(var(ip_lst){csv.count})) { if($Ri==$(var(ip_lst){csv.value,$var(i)})) {

Re: [OpenSIPS-Users] mid_registrar work arround

2018-08-24 Thread Ben Newlin
Volga, You are trying to use the csv transformation but your data is not comma-separated. You are using semi-colons. I think you are trying to remove the semi-colons with the regex and replace them with commas? I'm not sure what the value of that is, since you could just use commas to begin

Re: [OpenSIPS-Users] mid_registrar work arround

2018-08-24 Thread volga629
Hello Ben, I tried this. Cfgutils loadmodule "cfgutils.so" modparam("cfgutils", "shvset", "vip_lan_lst=s:192.168.10.10;192.168.10.11;192.168.10.12") modparam("cfgutils", "shvset", "vip_wan_lst=s:209.234.43.2;209.234.43.3;209.234.43.4") $avp(arr) = $shv(vip_lan_lst);

Re: [OpenSIPS-Users] mid_registrar work arround

2018-08-24 Thread Ben Newlin
Volga, I had recommended using individual variables, but if you want to use a list that will work. I would recommend using transformations [1] to manipulate the list. Depending on what you choose as your separator you can use the csv transformations (","), or the string select transformation

Re: [OpenSIPS-Users] mid_registrar work arround

2018-08-21 Thread volga629
Hello Ben, All what I am trying is introduce $shv(lan_lst) for lan vips and $shv(wan_lst) for wan vips, originaly you idea. My issue is how get define the list and how to get through all ips in list as example for filter if($Ri==$shv(lan_lst) && $avp(DLG_dir)=="topbx") { volga629 On

Re: [OpenSIPS-Users] mid_registrar work arround

2018-08-21 Thread Ben Newlin
Volga, I'm still not sure I fully understand, but it sounds like all you really need is a mapping LAN<->WAN for each set of IPs? So in the scenario you outlined, when node 1 receives a packet on the LAN interface that was previously on node 2 you want it to send out the WAN for node 2. But if

Re: [OpenSIPS-Users] mid_registrar work arround

2018-08-21 Thread Ben Newlin
Volga, You can use shared variables as I suggested to get the proper VIPs into variables. Your keepalived script can change those values when failover occurs using the MI commands for shared variables. When I suggested this you posed the question "How I can determine which vip ip address

Re: [OpenSIPS-Users] mid_registrar work arround

2018-08-21 Thread volga629
Example right now we have on each node one vip for LAN and one vip for WAN. When failover happened node 1 will hold LAN and WAN vips of node 2. If on node 2 was active registrations they will be relocated to node 1 and source ip will be vip's node 2. The question how to define all the vips

Re: [OpenSIPS-Users] mid_registrar work arround

2018-08-21 Thread volga629
Hello Ben, The script bellow is to find the way define vips in variable so if failover happends on keepalived script can process traffic and set proper vips (source ip) volga629. On Tue, Aug 14, 2018 at 4:38 PM, Ben Newlin wrote: Volga, I must be misunderstanding. If you are able to

Re: [OpenSIPS-Users] mid_registrar work arround

2018-08-14 Thread Ben Newlin
Volga, I must be misunderstanding. If you are able to determine the correct receiving interface in OpenSIPS and you are using the Path header to communicate that to the next hop destination, I'm not sure I'm clear on what the issue is you are still trying to solve? Ben Newlin On 8/14/18,

Re: [OpenSIPS-Users] mid_registrar work arround

2018-08-14 Thread volga629
Hello Ben, Yes, I create logic like this if(!has_totag() && is_method("INVITE")) { create_dialog(); if($Ri== vip1 ip addr) { set_dlg_sharing_tag("vip1"); $avp(vip) = "vip1 ip addr"; } else if($Ri==

Re: [OpenSIPS-Users] mid_registrar work arround

2018-08-14 Thread Ben Newlin
Volga, Sorry, I didn't fully understand your scenario. Even though you said it was active/active, I was assuming an active/standby scenario where only 1 IP would be active on a box at a time. I don't think this approach would work for the scenario you are describing. Is there some reason you

Re: [OpenSIPS-Users] mid_registrar work arround

2018-08-14 Thread volga629
Hello Ben, Do you mean for this modparam("cfgutils", "varset", "init=i:1") modparam("cfgutils", "varset", "gw=s:sip:11.11.11.11;transport=tcp") or this modparam("cfgutils", "shvset", "debug=i:1") modparam("cfgutils", "shvset", "pstngw=s:sip:10.10.10.10") in my case will be something like

Re: [OpenSIPS-Users] mid_registrar work arround

2018-08-02 Thread Ben Newlin
M4 will process the file before OpenSIPS runs and will not be changeable at runtime. It sounds like that will not work for you if I am understanding properly. My first thought would be to use the shared variables from CFGUTILS [1]. They can be accessed from inside the script, but can also be

Re: [OpenSIPS-Users] mid_registrar work arround

2018-08-02 Thread volga629
Hello Liviu, Yes, that correct. Right now each node in cluster have own vip from keepalived on LAN side. The issue how to specify correct vip in case of failover, so if node 2 fail and node 2 vip was relocated to node 1. All sessions should be process on node 1 and append_hf("Path: \r\n");

Re: [OpenSIPS-Users] mid_registrar work arround

2018-08-02 Thread Liviu Chircu
Hi Volga, If I understood your problem correctly, one idea would be to use m4 over opensips.cfg and define a different MAIN_VIP variable for each of your three servers: append_hf("Path: \r\n"); Liviu Chircu OpenSIPS Developer http://www.opensips-solutions.com On 09.07.2018 07:34,

[OpenSIPS-Users] mid_registrar work arround

2018-07-08 Thread volga629
Hello Everyone, I have work around on this issue # Work arround for github issue #1109 append_hf("Path: \r\n" Right now we use 3 node cluster with 3 vips in active/active mode I need some idea how to determine path header listen ip address from 3 vips. volga629