[OpenSIPS-Users] mid_registrar and nathelper problem

2023-09-01 Thread Alejandro Mejia Evertsz
Hi!
This is my first OpenSIPS installation, and I'm trying to achieve a simple
sip proxy for extensions to register to a PBX.
Got some configurations from samples all over docs and google searches and
everything seems to work fine until there's a call from the PBX to a
registered endpoint.
The endpoint rings, but when it answers the call, it sends OK to proxy, and
proxy to PBX, but when PBX sends ACK and proxy to endpoint, the ACK gets
lost on the proxy (never reaching the endpoint).

Same problem reported by another user on Dec. 2020 here:
https://opensips.org/pipermail/users/2020-December/044146.html
He didn't got any replies to his thread, so I would appreciate anyone's
help here.

Configuration file:
https://pastebin.com/GaQEMzmb

SIP Trace:
https://pastebin.com/3cREhszJ

As you can see, the ACK doesn't even try to leave the public (WAN)
interface of the proxy.

Thanks in advance for your help.

Alejandro
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid_registrar and nathelper problem

2023-09-01 Thread Alejandro Mejia Evertsz
Hi!
This is my first OpenSIPS installation, and I'm trying to achieve a simple
sip proxy for my office extensions to register to our PBX.
Got some configurations from samples all over docs and google searches and
everything seems to work fine until there's a call from the PBX to a
registered endpoint.
The endpoint rings, but when it answers the call, it sends OK to proxy, and
proxy to PBX, but when PBX sends ACK and proxy to endpoint, the ACK gets
lost on the proxy (never reaching the endpoint).

Same problem reported by another user on Dec. 2020 here:
https://opensips.org/pipermail/users/2020-December/044146.html
He didn't got any replies to his thread, so I would appreciate anyone's
help here.

Configuration file:
https://pastebin.com/GaQEMzmb

SIP Trace:
https://pastebin.com/3cREhszJ

As you can see, the ACK doesn't even try to leave the public (WAN)
interface of the proxy.

Thanks in advance for your help.

Alejandro
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar and vpn and nat

2023-01-03 Thread Bogdan-Andrei Iancu

Hi Alberto,

Yes, in the registration record the Contact URI is kept as received and 
the "fixed" src IP is stored into the "received" field. Upon lookup the 
contact URI goes into RURI (as you observed) and the "received" goes 
into dst_uri (destination URI) or $du. When OpenSIPS relays, the $du 
takes precedence to the $ru, the requests goes to the right destination.


Best regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Bootcamp 5-16 Dec 2022, online
  https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/

On 12/14/22 1:50 AM, Alberto wrote:

Hi,
I have a problem with a vpn setup, not really nat, or maybe it's nat...

The setup I have is:
Phone - openvpn - opensips - public internet - asterisk

openvpn subnet: 10.0.0.0/24 
openvpn server: 172.172.0.2/24 
opensips server: 172.172.0.10/24 

In my configuration I have:

loadmodule "mid_registrar.so"
modparam("mid_registrar", "max_contacts", 1)
modparam("mid_registrar", "mode", 0)
modparam("mid_registrar", "received_avp", "$avp(rcv)")
modparam("mid_registrar", "tcp_persistent_flag", 
"TCP_PERSIST_REGISTRATIONS")


if (nat_uac_test(119)) {
  setbflag("NAT");
  if (is_method("REGISTER")) {
    fix_nated_register();
  } else {
    fix_nated_contact();
  }
}

if (is_method("REGISTER")) {
  mid_registrar_save("location", "p0");
  .
}

if ($(tu{uri.param,ctid}) != NULL && mid_registrar_lookup("location")) {
  if (!t_relay()) {
    send_reply(500, "Internal Error");
  }
}

So, when the phone sends a REGISTER to opensips, the contact header 
contains the private ip of the vpn (10.0.0.X/24).
fix_nated_register is able to detect that the ip in the contact is 
different from the source ip and sets the received avp.
But if I do opensips-cli -x mi ul_dump, I see that the contact still 
contains the openvpn ip, and the received field contains the correct 
openvpn ip.
This is a problem because when I do the mid_registrar_lookup, $ru is 
set to the contact, which contains an ip that the opensips server is 
not aware of.
It should instead contain the openvpn server ip (172.172.0.2), that 
could then route the call to the phone.


I tried to change $rd manually, but that just breaks routing for ACK 
messages.

What am I doing wrong?

Thanks


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid_registrar and vpn and nat

2022-12-13 Thread Alberto
Hi,
I have a problem with a vpn setup, not really nat, or maybe it's nat...

The setup I have is:
Phone - openvpn - opensips - public internet - asterisk

openvpn subnet: 10.0.0.0/24
openvpn server: 172.172.0.2/24
opensips server: 172.172.0.10/24

In my configuration I have:

loadmodule "mid_registrar.so"
modparam("mid_registrar", "max_contacts", 1)
modparam("mid_registrar", "mode", 0)
modparam("mid_registrar", "received_avp", "$avp(rcv)")
modparam("mid_registrar", "tcp_persistent_flag",
"TCP_PERSIST_REGISTRATIONS")

if (nat_uac_test(119)) {
  setbflag("NAT");
  if (is_method("REGISTER")) {
fix_nated_register();
  } else {
fix_nated_contact();
  }
}

if (is_method("REGISTER")) {
  mid_registrar_save("location", "p0");
  .
}

if ($(tu{uri.param,ctid}) != NULL && mid_registrar_lookup("location")) {
  if (!t_relay()) {
send_reply(500, "Internal Error");
  }
}

So, when the phone sends a REGISTER to opensips, the contact header
contains the private ip of the vpn (10.0.0.X/24).
fix_nated_register is able to detect that the ip in the contact is
different from the source ip and sets the received avp.
But if I do opensips-cli -x mi ul_dump, I see that the contact still
contains the openvpn ip, and the received field contains the correct
openvpn ip.
This is a problem because when I do the mid_registrar_lookup, $ru is set to
the contact, which contains an ip that the opensips server is not aware of.
It should instead contain the openvpn server ip (172.172.0.2), that could
then route the call to the phone.

I tried to change $rd manually, but that just breaks routing for ACK
messages.
What am I doing wrong?

Thanks
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar

2022-12-07 Thread Andy Dierlam
maybe run in debug foreground, so can see what its doing?
opensips -D


From: Users  on behalf of nutxase via Users 

Sent: Wednesday, December 7, 2022 1:09 PM
To: nutxase ; OpenSIPS users mailling list 

Subject: Re: [OpenSIPS-Users] mid_registrar


EXTERNAL: Caution, this email originated from outside the organization. Do not 
click links or open attachments unless you can verify the sender and know the 
content is safe.


i did try and doesnt seem to go to the second one :(


Sent with Proton 
Mail<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fproton.me%2F=05%7C01%7Cadierlam%40ptgi-ics.com%7C258dd626be7f4a4d9cdc08dad87e9038%7Cf4c81856eb684f3c8c148d91aa0e37df%7C0%7C0%7C638060335361633129%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=gVNJTeyZYiDpRLpF8kryR1%2Fi4GC5FGI57PNoY%2BRzDi8%3D=0>
 secure email.

--- Original Message ---
On Wednesday, December 7th, 2022 at 5:42 PM, nutxase via Users 
 wrote:

Hi Guys

How can i make it that if an invite comes in and the location is not found that 
it will then try look again for the location before sending 404?

i have tried

if (!mid_registrar_lookup("location")) {
 sleep (5);
if (!mid_registrar_lookup("location")) {
   t_reply(404, "Not Found");
  }
}

Sent with Proton 
Mail<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fproton.me%2F=05%7C01%7Cadierlam%40ptgi-ics.com%7C258dd626be7f4a4d9cdc08dad87e9038%7Cf4c81856eb684f3c8c148d91aa0e37df%7C0%7C0%7C638060335361633129%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=gVNJTeyZYiDpRLpF8kryR1%2Fi4GC5FGI57PNoY%2BRzDi8%3D=0>
 secure email.


CONFIDENTIALITY NOTICE
This email is solely for the use of the intended recipient(s) and may contain 
information and attachments that are confidential, privileged or otherwise 
sensitive in nature.   Please do not disseminate this email or any of its 
attachments without the permission of the sender.  If this email has been 
received in error, please do not read, copy, use, forward or disclose the email 
or any of its attachments to others.  Instead, immediately notify the sender by 
replying to this email and then delete it from your system.  Transmission of 
this email is not to be construed as a waiver of any rights of confidentiality 
or applicable privilege.


NO BINDING AGREEMENT
This email does not constitute an agreement to conduct transactions by 
electronic means and does not create any legally binding contract or 
enforceable obligation in the absence of a fully signed written contract.
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar

2022-12-07 Thread nutxase via Users
i did try and doesnt seem to go to the second one :(

Sent with [Proton Mail](https://proton.me/) secure email.

--- Original Message ---
On Wednesday, December 7th, 2022 at 5:42 PM, nutxase via Users 
 wrote:

> Hi Guys
>
> How can i make it that if an invite comes in and the location is not found 
> that it will then try look again for the location before sending 404?
>
> i have tried
>
> if (!mid_registrar_lookup("location")) {
> sleep (5);
> if (!mid_registrar_lookup("location")) {
> t_reply(404, "Not Found");
> }
> }
>
> Sent with [Proton Mail](https://proton.me/) secure email.___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar

2022-12-07 Thread Andy Dierlam
Try adding xlog entries after your lookups, to verify its hitting where you 
think it is.
separate to two blocks, and add xlog to see if is hitting them both.

if (!mid_registrar_lookup("location")) {
 xlog("did not find phone 1st lookup");
}

if (!mid_registrar_lookup("location")) {
  xlog("2nd lookup did not find phone, sending 404");
   t_reply(404, "Not Found");
}



From: Users  on behalf of nutxase via Users 

Sent: Wednesday, December 7, 2022 12:42 PM
To: OpenSIPS users mailling list 
Subject: [OpenSIPS-Users] mid_registrar


EXTERNAL: Caution, this email originated from outside the organization. Do not 
click links or open attachments unless you can verify the sender and know the 
content is safe.


Hi Guys

How can i make it that if an invite comes in and the location is not found that 
it will then try look again for the location before sending 404?

i have tried

if (!mid_registrar_lookup("location")) {
 sleep (5);
if (!mid_registrar_lookup("location")) {
   t_reply(404, "Not Found");
  }
}

Sent with Proton 
Mail<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fproton.me%2F=05%7C01%7Cadierlam%40ptgi-ics.com%7C1c5656d618cb40b6b4ac08dad87aaad1%7Cf4c81856eb684f3c8c148d91aa0e37df%7C0%7C0%7C638060318631933087%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=Nzbo8DseMA9P%2FojWdt99yvj1HMOI9F3X2zjCpZNcw5A%3D=0>
 secure email.

CONFIDENTIALITY NOTICE
This email is solely for the use of the intended recipient(s) and may contain 
information and attachments that are confidential, privileged or otherwise 
sensitive in nature.   Please do not disseminate this email or any of its 
attachments without the permission of the sender.  If this email has been 
received in error, please do not read, copy, use, forward or disclose the email 
or any of its attachments to others.  Instead, immediately notify the sender by 
replying to this email and then delete it from your system.  Transmission of 
this email is not to be construed as a waiver of any rights of confidentiality 
or applicable privilege.


NO BINDING AGREEMENT
This email does not constitute an agreement to conduct transactions by 
electronic means and does not create any legally binding contract or 
enforceable obligation in the absence of a fully signed written contract.
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid_registrar

2022-12-07 Thread nutxase via Users
Hi Guys

How can i make it that if an invite comes in and the location is not found that 
it will then try look again for the location before sending 404?

i have tried

if (!mid_registrar_lookup("location")) {
sleep (5);
if (!mid_registrar_lookup("location")) {
t_reply(404, "Not Found");
}
}

Sent with [Proton Mail](https://proton.me/) secure email.___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar contact

2022-11-17 Thread nutxase via Users
hmm i do already have that

$ru = "sip:1.2.3.4:5060";
xlog("looking up $ct!\n");
t_relay();

Sent with [Proton Mail](https://proton.me/) secure email.

--- Original Message ---
On Thursday, November 17th, 2022 at 2:33 PM, Jehanzaib Younis 
 wrote:

> Hi there,
> Just t_relay(); to the Asterisk IP, it should work perfectly fine.
>
> Regards,
> Jehanzaib
>
> On Fri, Nov 18, 2022 at 12:09 AM nutxase via Users  
> wrote:
>
>> Yes so thats my idea but the problem i see is that asterisk sees the contact 
>> as the opensips details not the UAC device
>>
>> Sent with [Proton Mail](https://proton.me/) secure email.
>>
>> --- Original Message ---
>> On Thursday, November 17th, 2022 at 11:04 AM, johan  wrote:
>>
>>> If you don't want to handle the r3egister locally, why don't you just 
>>> forward it then ? (i.e. the path approach)
>>>
>>> On 17/11/2022 11:45, Liviu Chircu wrote:
>>>
 On 17.11.2022 12:37, nutxase wrote:

> Just to confirm can registrar also forward the registration similar to 
> how mid_registrar does?

 Approach 1: the 
 [save()](https://opensips.org/docs/modules/3.4.x/registrar.html#func_save) 
 function has an "r" flag (do not auto-send a reply upstream) which may be 
 useful here, allowing you to t_relay() your REGISTER further downstream. A 
 caveat here is that you're saving the Contact before the Asterisk, which 
 may fail (e.g. 500 Internal Server Error). So what do you do then? You 
 must delete it somehow...

 Approach 2: if I remember correctly, the 
 [save()](https://opensips.org/docs/modules/3.4.x/registrar.html#func_save) 
 function was also designed to work on a 200 OK reply! But I haven't tested 
 this scenario in a long time, so I'm not sure how well or if it works at 
 all nowadays.

 Best,

 --
 Liviu Chircu
 www.twitter.com/liviuchircu
 |
 www.opensips-solutions.com
 OpenSIPS eBootcamp 5-16 Dec |
 www.opensips.org/training

 ___
 Users mailing list
 Users@lists.opensips.org

 http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar contact

2022-11-17 Thread Jehanzaib Younis
Hi there,
Just t_relay(); to the Asterisk IP,  it should work perfectly fine.


Regards,
Jehanzaib


On Fri, Nov 18, 2022 at 12:09 AM nutxase via Users 
wrote:

> Yes so thats my idea but the problem i see is that asterisk sees the
> contact as the opensips details not the UAC device
>
>
> Sent with Proton Mail  secure email.
>
> --- Original Message ---
> On Thursday, November 17th, 2022 at 11:04 AM, johan 
> wrote:
>
> If you don't want to handle the r3egister locally, why don't you just
> forward it then ? (i.e. the path approach)
> On 17/11/2022 11:45, Liviu Chircu wrote:
>
> On 17.11.2022 12:37, nutxase wrote:
>
> Just to confirm can registrar also forward the registration similar to how
> mid_registrar does?
>
> Approach 1: the save()
> 
> function has an "r" flag (do not auto-send a reply upstream) which may be
> useful here, allowing you to t_relay() your REGISTER further downstream. A
> caveat here is that you're saving the Contact before the Asterisk, which
> may fail (e.g. 500 Internal Server Error). So what do you do then? You must
> delete it somehow...
>
> Approach 2: if I remember correctly, the save()
> 
> function was also designed to work on a 200 OK reply! But I haven't tested
> this scenario in a long time, so I'm not sure how well or if it works at
> all nowadays.
>
> Best,
>
> --
> Liviu Chircuwww.twitter.com/liviuchircu | www.opensips-solutions.com
> OpenSIPS eBootcamp 5-16 Dec | www.opensips.org/training
>
>
> ___
> Users mailing 
> listUsers@lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar contact

2022-11-17 Thread johan
then you need to debug on 5 to see why it is replaced and read the 
documentation of the registrar module carefully.


On 17/11/2022 12:09, nutxase via Users wrote:
Yes so thats my idea but the problem i see is that asterisk sees the 
contact as the opensips details not the UAC device



Sent with Proton Mail  secure email.

--- Original Message ---
On Thursday, November 17th, 2022 at 11:04 AM, johan  
wrote:


If you don't want to handle the r3egister locally, why don't you just 
forward it then ? (i.e. the path approach)


On 17/11/2022 11:45, Liviu Chircu wrote:

On 17.11.2022 12:37, nutxase wrote:
Just to confirm can registrar also forward the registration similar 
to how mid_registrar does?


Approach 1: the save() 
 
function has an "r" flag (do not auto-send a reply upstream) which 
may be useful here, allowing you to t_relay() your REGISTER further 
downstream. A caveat here is that you're saving the Contact before 
the Asterisk, which may fail (e.g. 500 Internal Server Error). So 
what do you do then? You must delete it somehow...


Approach 2: if I remember correctly, the save() 
 
function was also designed to work on a 200 OK reply! But I haven't 
tested this scenario in a long time, so I'm not sure how well or if 
it works at all nowadays.


Best,

--
Liviu Chircu
www.twitter.com/liviuchircu  |www.opensips-solutions.com
OpenSIPS eBootcamp 5-16 Dec |www.opensips.org/training

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar contact

2022-11-17 Thread nutxase via Users
Yes so thats my idea but the problem i see is that asterisk sees the contact as 
the opensips details not the UAC device

Sent with [Proton Mail](https://proton.me/) secure email.

--- Original Message ---
On Thursday, November 17th, 2022 at 11:04 AM, johan  wrote:

> If you don't want to handle the r3egister locally, why don't you just forward 
> it then ? (i.e. the path approach)
>
> On 17/11/2022 11:45, Liviu Chircu wrote:
>
>> On 17.11.2022 12:37, nutxase wrote:
>>
>>> Just to confirm can registrar also forward the registration similar to how 
>>> mid_registrar does?
>>
>> Approach 1: the 
>> [save()](https://opensips.org/docs/modules/3.4.x/registrar.html#func_save) 
>> function has an "r" flag (do not auto-send a reply upstream) which may be 
>> useful here, allowing you to t_relay() your REGISTER further downstream. A 
>> caveat here is that you're saving the Contact before the Asterisk, which may 
>> fail (e.g. 500 Internal Server Error). So what do you do then? You must 
>> delete it somehow...
>>
>> Approach 2: if I remember correctly, the 
>> [save()](https://opensips.org/docs/modules/3.4.x/registrar.html#func_save) 
>> function was also designed to work on a 200 OK reply! But I haven't tested 
>> this scenario in a long time, so I'm not sure how well or if it works at all 
>> nowadays.
>>
>> Best,
>>
>> --
>> Liviu Chircu
>> www.twitter.com/liviuchircu
>> |
>> www.opensips-solutions.com
>> OpenSIPS eBootcamp 5-16 Dec |
>> www.opensips.org/training
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>>
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar contact

2022-11-17 Thread johan
If you don't want to handle the r3egister locally, why don't you just 
forward it then ? (i.e. the path approach)


On 17/11/2022 11:45, Liviu Chircu wrote:

On 17.11.2022 12:37, nutxase wrote:
Just to confirm can registrar also forward the registration similar 
to how mid_registrar does?


Approach 1: the save() 
 
function has an "r" flag (do not auto-send a reply upstream) which may 
be useful here, allowing you to t_relay() your REGISTER further 
downstream.  A caveat here is that you're saving the Contact before 
the Asterisk, which may fail (e.g. 500 Internal Server Error).  So 
what do you do then?  You must delete it somehow...


Approach 2: if I remember correctly, the save() 
 
function was also designed to work on a 200 OK reply!  But I haven't 
tested this scenario in a long time, so I'm not sure how well or if it 
works at all nowadays.


Best,

--
Liviu Chircu
www.twitter.com/liviuchircu  |www.opensips-solutions.com
OpenSIPS eBootcamp 5-16 Dec |www.opensips.org/training

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar contact

2022-11-17 Thread nutxase via Users
I guess let me go one step further and ask advice

What do you think is the best scenario to use if i want to register to asterisk 
and then when when my UAC goes to "sleep" keep the registration up on asterisk

Sent with [Proton Mail](https://proton.me/) secure email.

--- Original Message ---
On Thursday, November 17th, 2022 at 10:45 AM, Liviu Chircu  
wrote:

> On 17.11.2022 12:37, nutxase wrote:
>
>> Just to confirm can registrar also forward the registration similar to how 
>> mid_registrar does?
>
> Approach 1: the 
> [save()](https://opensips.org/docs/modules/3.4.x/registrar.html#func_save) 
> function has an "r" flag (do not auto-send a reply upstream) which may be 
> useful here, allowing you to t_relay() your REGISTER further downstream. A 
> caveat here is that you're saving the Contact before the Asterisk, which may 
> fail (e.g. 500 Internal Server Error). So what do you do then? You must 
> delete it somehow...
>
> Approach 2: if I remember correctly, the 
> [save()](https://opensips.org/docs/modules/3.4.x/registrar.html#func_save) 
> function was also designed to work on a 200 OK reply! But I haven't tested 
> this scenario in a long time, so I'm not sure how well or if it works at all 
> nowadays.
>
> Best,
>
> --
> Liviu Chircu
> www.twitter.com/liviuchircu
> |
> www.opensips-solutions.com
> OpenSIPS eBootcamp 5-16 Dec |
> www.opensips.org/training___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar contact

2022-11-17 Thread Liviu Chircu

On 17.11.2022 12:37, nutxase wrote:
Just to confirm can registrar also forward the registration similar to 
how mid_registrar does?


Approach 1: the save() 
 
function has an "r" flag (do not auto-send a reply upstream) which may 
be useful here, allowing you to t_relay() your REGISTER further 
downstream.  A caveat here is that you're saving the Contact before the 
Asterisk, which may fail (e.g. 500 Internal Server Error).  So what do 
you do then?  You must delete it somehow...


Approach 2: if I remember correctly, the save() 
 
function was also designed to work on a 200 OK reply!  But I haven't 
tested this scenario in a long time, so I'm not sure how well or if it 
works at all nowadays.


Best,

--
Liviu Chircu
www.twitter.com/liviuchircu  |www.opensips-solutions.com
OpenSIPS eBootcamp 5-16 Dec |www.opensips.org/training
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar contact

2022-11-17 Thread nutxase via Users
Thanks, with the registrar module i have tried to forward the registration to 
the asterisk system but seems to not work.

Just to confirm can registrar also forward the registration similar to how 
mid_registrar does?

--- Original Message ---
On Wednesday, November 16th, 2022 at 5:13 PM, Liviu Chircu  
wrote:

> On 16.11.2022 18:56, nutxase via Users wrote:
>
>> Is it possible to change the contact on mid_registrar to be the endpoint ip 
>> etc
>>
>> as currently when registering to asterisk we see the details of opensips, 
>> but i want to hide that and rather show the endpoint
>>
>> is that possible?
>
> Hi nutxase,
>
> The mid-registrar will rewrite the Contact in all 3 usage modes (even in 
> "mirror" mode), per design. If you want to keep the original Contact, you 
> probably should not use mid-registrar at all, and try to make it work using a 
> Path-based approach ([RFC 
> 3327](https://datatracker.ietf.org/doc/html/rfc3327)) + "registrar" module.
>
> Best,
>
> --
> Liviu Chircu
> www.twitter.com/liviuchircu
> |
> www.opensips-solutions.com
> OpenSIPS eBootcamp 5-16 Dec |
> www.opensips.org/training___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar contact

2022-11-16 Thread Liviu Chircu

On 16.11.2022 18:56, nutxase via Users wrote:
Is it possible to change the contact on mid_registrar to be the 
endpoint ip etc


as currently when registering to asterisk we see the details of 
opensips, but i want to hide that and rather show the endpoint


is that possible?


Hi nutxase,

The mid-registrar will rewrite the Contact in all 3 usage modes (even in 
"mirror" mode), per design.  If you want to keep the original Contact, 
you probably should not use mid-registrar at all, and try to make it 
work using a Path-based approach (RFC 3327 
) + "registrar" module.


Best,

--
Liviu Chircu
www.twitter.com/liviuchircu  |www.opensips-solutions.com
OpenSIPS eBootcamp 5-16 Dec |www.opensips.org/training
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Mid_Registrar contact

2022-11-16 Thread nutxase via Users
Hi All

Is it possible to change the contact on mid_registrar to be the endpoint ip etc

as currently when registering to asterisk we see the details of opensips, but i 
want to hide that and rather show the endpoint

is that possible?___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar multi domains

2022-03-31 Thread Bogdan-Andrei Iancu

Hi Andrei,

You MUST NOT change the auth username as you will break the whole 
authentication process. The username is part of alg. for computing the 
auth result. So, if you change the auth uername, the auth result will 
become invalid.


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS eBootcamp 23rd May - 3rd June 2022
  https://opensips.org/training/OpenSIPS_eBootcamp_2022/

On 3/28/22 10:55 AM, Andrei G. wrote:

Hi,

How do I modify the field "Authorization: Digest username" in REGISTER 
packet?


tried with uac_replace_to(,"user@asterisk1") and 
uac_replace_from(,"user@asterisk1") but it does affect only to and 
from headers not digest username


thanks
Andrei




On Thu, Mar 24, 2022 at 4:20 AM Artiom Druz > wrote:


Hello, Andrei.
You can do that by taking $tU (user from "To" header) and using
some transformation function. In your example can be used s.select
function.
(https://www.opensips.org/Documentation/Script-Tran-3-2#toc7
)

Best regards,
Artiom Druz

ср, 23 мар. 2022 г., 21:11 Andrei G. mailto:andreig...@gmail.com>>:

Hey guys,

I successfully tested opensips with mid_registrar for one domain

Is it possible to use opensips in front of 2 asterisk boxes
and redirect registrations based on a prefix username, not
domain prefix?

Something like
asterisk1-user@mid-registrar.domain - where opensips manage
registration for user@asterisk1
asterisk2-user@mid-registrar.domain - where opensips manage
registration for user@asterisk2

Regards
Andrei G.

___
Users mailing list
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar multi domains

2022-03-28 Thread Andrei G.
Hello,

I'm using the following code in opensips.config

#
# absorb retransmissions, but do not create transaction
t_check_trans();

if (is_method("REGISTER")) {
uac_replace_to(,"sip:user1@asterisk1.local");
uac_replace_from(,"sip:user1@asterisk1.local");
mid_registrar_save("location","m");
  switch ($retcode) {
 case 1:
$ru = "sip:asterisk1.local";
t_on_reply("main_reg_replies");
t_relay();
break;
 case 2:
#xlog("[LOG] absorbing REGISTER! ($$ci=$ci)\n");
break;
 default:
xlog("[LOG] failed to save registration! ($$ci=$ci)\n");
 }
  exit;
}

if ( is_method("INVITE|MESSAGE|CANCEL|BYE|NOTIFY") && ($si !=
"IP_ASTERISK1" || $sp != 5060) ) {
$ru = "sip:" + $tU + "@asterisk1.local";
}
#


*U 2022/03/28 21:52:40.848274 IP_CLIENT:19606 -> IP_OPENSIPS:5060 #1*
REGISTER sip:OPENSIPS SIP/2.0.
Via: SIP/2.0/UDP 192.168.11.1:19606
;received=IP_CLIENT;rport=19606;branch=z9hG4bK-9p6796298349846258764r.
From: ;tag=8g7970426010400195798m.
To: .
Call-ID: 6e6985069689257392584k25377rmwpR.
CSeq: 7319 REGISTER.
Max-Forwards: 70.
Authorization: Digest
username="user1-asterisk",realm="asterisk",nonce="3aa213ca",uri="sip:IP_OPENSIPS:5060",response="89d2d2d37a0a348960a64f9caf40b96a",algorithm=MD5.
Contact: ;expires=0.
Supported: replaces.
Content-Length: 0.


*U 2022/03/28 21:52:40.853495 IP_OPENSIPS:5060 -> IP_ASTERISK1:5060 #2*
REGISTER sip:asterisk1.local:5060 SIP/2.0.
Via: SIP/2.0/UDP IP_OPENSIPS:5060;branch=z9hG4bKd2e8.d0acd904.0.
Via: SIP/2.0/UDP 192.168.11.1:19606
;received=IP_CLIENT;rport=19606;branch=z9hG4bK-9p6796298349846258764r.
From: ;tag=8g7970426010400195798m.
To: .
Call-ID: 6e6985069689257392584k25377rmwpR.
CSeq: 7319 REGISTER.
Max-Forwards: 69.
Authorization: Digest username="user1-asterisk"
,realm="asterisk",nonce="3aa213ca",uri="sip:IP_OPENSIPS:5060",response="89d2d2d37a0a348960a64f9caf40b96a",algorithm=MD5.
Contact: ;expires=0.
Supported: replaces.
Allow:
ACK,PRACK,BYE,CANCEL,INVITE,UPDATE,MESSAGE,INFO,OPTIONS,SUBSCRIBE,NOTIFY,REFER.
Content-Length: 0.

Please help me how to modify  Digest username="user1"

thanks
Andrei

On Mon, Mar 28, 2022 at 10:55 AM Andrei G.  wrote:

> Hi,
>
> How do I modify the field "Authorization: Digest username" in REGISTER
> packet?
>
> tried with uac_replace_to(,"user@asterisk1") and
> uac_replace_from(,"user@asterisk1") but it does affect only to and from
> headers not digest username
>
> thanks
> Andrei
>
>
> On Thu, Mar 24, 2022 at 4:20 AM Artiom Druz  wrote:
>
>> Hello, Andrei.
>> You can do that by taking $tU (user from "To" header) and using some
>> transformation function. In your example can be used s.select function. (
>> https://www.opensips.org/Documentation/Script-Tran-3-2#toc7)
>>
>> Best regards,
>> Artiom Druz
>>
>> ср, 23 мар. 2022 г., 21:11 Andrei G. :
>>
>>> Hey guys,
>>>
>>> I successfully tested opensips with mid_registrar for one domain
>>>
>>> Is it possible to use opensips in front of 2 asterisk boxes and redirect
>>> registrations based on a prefix username, not domain prefix?
>>>
>>> Something like
>>> asterisk1-user@mid-registrar.domain - where opensips manage
>>> registration for user@asterisk1
>>> asterisk2-user@mid-registrar.domain - where opensips manage
>>> registration for user@asterisk2
>>>
>>> Regards
>>> Andrei G.
>>>
>>> ___
>>> Users mailing list
>>> Users@lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar multi domains

2022-03-28 Thread Andrei G.
Hi,

How do I modify the field "Authorization: Digest username" in REGISTER
packet?

tried with uac_replace_to(,"user@asterisk1") and
uac_replace_from(,"user@asterisk1") but it does affect only to and from
headers not digest username

thanks
Andrei


On Thu, Mar 24, 2022 at 4:20 AM Artiom Druz  wrote:

> Hello, Andrei.
> You can do that by taking $tU (user from "To" header) and using some
> transformation function. In your example can be used s.select function. (
> https://www.opensips.org/Documentation/Script-Tran-3-2#toc7)
>
> Best regards,
> Artiom Druz
>
> ср, 23 мар. 2022 г., 21:11 Andrei G. :
>
>> Hey guys,
>>
>> I successfully tested opensips with mid_registrar for one domain
>>
>> Is it possible to use opensips in front of 2 asterisk boxes and redirect
>> registrations based on a prefix username, not domain prefix?
>>
>> Something like
>> asterisk1-user@mid-registrar.domain - where opensips manage registration
>> for user@asterisk1
>> asterisk2-user@mid-registrar.domain - where opensips manage registration
>> for user@asterisk2
>>
>> Regards
>> Andrei G.
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar multi domains

2022-03-23 Thread Artiom Druz
Hello, Andrei.
You can do that by taking $tU (user from "To" header) and using some
transformation function. In your example can be used s.select function. (
https://www.opensips.org/Documentation/Script-Tran-3-2#toc7)

Best regards,
Artiom Druz

ср, 23 мар. 2022 г., 21:11 Andrei G. :

> Hey guys,
>
> I successfully tested opensips with mid_registrar for one domain
>
> Is it possible to use opensips in front of 2 asterisk boxes and redirect
> registrations based on a prefix username, not domain prefix?
>
> Something like
> asterisk1-user@mid-registrar.domain - where opensips manage registration
> for user@asterisk1
> asterisk2-user@mid-registrar.domain - where opensips manage registration
> for user@asterisk2
>
> Regards
> Andrei G.
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid_registrar multi domains

2022-03-23 Thread Andrei G.
Hey guys,

I successfully tested opensips with mid_registrar for one domain

Is it possible to use opensips in front of 2 asterisk boxes and redirect
registrations based on a prefix username, not domain prefix?

Something like
asterisk1-user@mid-registrar.domain - where opensips manage registration
for user@asterisk1
asterisk2-user@mid-registrar.domain - where opensips manage registration
for user@asterisk2

Regards
Andrei G.
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid_registrar and webrtc with asterisk

2022-02-22 Thread Alberto
Hi,

I'm back again, I'm trying to get mid_registrar to work with webrtc, but
when I use the piece of configuration below asterisk replies with 404.
I think it's because asterisk expects the url to be "wss://
10.0.0.153:8188/ws"
But where do I configure such a url in opensips??
Thanks

  if (is_method("REGISTER")) {
mid_registrar_save("location", "p0v");
switch ($retcode) {
  case 1:
#$du = "sips:10.0.0.153:5061;transport=tls";
#$ru = "sip:10.0.0.153:5061";
$du = "sips:10.0.0.153:8188;transport=wss";
$ru = "sip:10.0.0.153:8188";
$fs = NULL;
route(relay);
break;
  case 2:
xlog("L_INFO", "Absorb REGISTER!\n");
break;
  default:
xlog("L_INFO", "Failed to save registration!\n");
break;
}

exit;
  }
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Mid_registrar Modules and events using Freeswitch ESL

2022-02-17 Thread Ahmed Rehan
Hi ,

I m using mid registrar module with dispatcher module for freeswitch
registrations we are using sip based and webrtc endpoints . and every thing
is working fine.

Now we have configured call center module for agents and agents are
registered webrtc softphone . and there is a requirement of receiving the
ESL events from freeswitch for the enpoint registered on webrtc. Can i get
some clue how can i achieve this using freeswitch scripting module for the
registered end point

Currently i m using two freeswitches with dispatcher module as media
servers.
-- 
Regards
Ahmed Rehan
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar TLS

2022-02-10 Thread Bogdan-Andrei Iancu
Yes, doing a wildcard for SIP/IP matching in the TLS domain definition 
is the correct approach if you plan to use only one certificate.


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS eBootcamp
  https://www.opensips.org/Training/Bootcamp

On 2/10/22 1:09 PM, Alberto wrote:
I was confused because I use a wildcard cert, so I only have one cert 
for server/client and any possible subdomain. I don't need to match 
server/client requests to different certs.

So I ended up with this config and it seems to work fine.
Thanks

loadmodule "tls_mgm.so"
modparam("tls_mgm", "tls_library", "wolfssl")

modparam("tls_mgm", "server_domain", "sd_1")
modparam("tls_mgm", "ca_list", "[sd_1]/etc/letsencrypt/fullchain.pem")
modparam("tls_mgm", "certificate", "[sd_1]/etc/letsencrypt/cert.pem")
modparam("tls_mgm", "private_key", "[sd_1]/etc/letsencrypt/privkey.pem")
modparam("tls_mgm", "require_cert", "[sd_1]0")
modparam("tls_mgm", "tls_method", "[sd_1]TLSv1-")
modparam("tls_mgm", "verify_cert", "[sd_1]0")
modparam("tls_mgm", "match_sip_domain", "[sd_1]*")
modparam("tls_mgm", "match_ip_address", "[sd_1]*")

modparam("tls_mgm", "client_domain", "cd_1")
modparam("tls_mgm", "ca_list", "[cd_1]/etc/letsencrypt/fullchain.pem")
modparam("tls_mgm", "certificate", "[cd_1]/etc/letsencrypt/cert.pem")
modparam("tls_mgm", "private_key", "[cd_1]/etc/letsencrypt/privkey.pem")
modparam("tls_mgm", "require_cert", "[cd_1]0")
modparam("tls_mgm", "tls_method", "[cd_1]TLSv1-")
modparam("tls_mgm", "verify_cert", "[cd_1]0")
modparam("tls_mgm", "match_sip_domain", "[cd_1]*")
modparam("tls_mgm", "match_ip_address", "[cd_1]*")


On Thu, 10 Feb 2022 at 07:59, Bogdan-Andrei Iancu > wrote:


Hi Alberto,

When OpenSIPS is about the create a new TLS connection, it has to
know what TSL certificate (client) to use for it.

There are 2 way of indicating that :

* use "match_ip_address" [1] to map the TLS client domain to some
IPs you want to connect to via TLS

* use "client_tls_domain_avp" [2] to manually select from script
which TLS domain to be used - set the AVP before the t_relay() to
the TLS destination.


[1]

https://opensips.org/html/docs/modules/3.2.x/tls_mgm.html#param_match_ip_address



[2]

https://opensips.org/html/docs/modules/3.2.x/tls_mgm.html#param_client_tls_domain_avp



Best regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com  
OpenSIPS eBootcamp
   https://www.opensips.org/Training/Bootcamp  


On 2/4/22 2:40 PM, Alberto wrote:

Hi,
I have a sip client connecting to opensips using tls, all
requests are then routed to an asterisk server using mid_registrar.

UDP to UDP and TCP to TCP work fine, but TLS doesn't.

This is the error, but I'm having a hard time understanding it.

Feb  4 12:29:32 [3406] //etc/opensips/opensips.cfg:453 Forward
REGISTER for sip:tls-1001@10.0.0.252:5061
 to
10.0.0.153:5061;transport=tls
Feb  4 12:29:32 [3406] ERROR:proto_tls:proto_tls_conn_init: no
TLS client domain found
Feb  4 12:29:32 [3406] ERROR:core:tcp_conn_create: failed to do
proto 3 specific init for conn 0x7ff9be1810f8
Feb  4 12:29:32 [3406] ERROR:core:tcp_async_connect:
tcp_conn_create failed, closing the socket
Feb  4 12:29:32 [3406] ERROR:proto_tls:proto_tls_send: async TCP
connect failed
Feb  4 12:29:32 [3406] ERROR:tm:msg_send: send() to
10.0.0.153:5061  for proto tls/3 failed
Feb  4 12:29:32 [3406] ERROR:tm:t_forward_nonack: sending request
failed
Feb  4 12:29:32 [3406] ERROR:tm:w_t_relay: t_forward_nonack failed


My configuration:
#
loadmodule "mid_registrar.so"
modparam("mid_registrar", "attr_avp", "$avp(avp_json)")
modparam("mid_registrar", "max_contacts", 1)
modparam("mid_registrar", "mode", 0)
modparam("mid_registrar", "tcp_persistent_flag",
"TCP_PERSIST_REGISTRATIONS")

loadmodule "tls_mgm.so"
modparam("tls_mgm", "tls_library", "wolfssl")
modparam("tls_mgm", "server_domain", "dom1")
modparam("tls_mgm", "ca_list",
"[dom1]/etc/letsencrypt/fullchain.pem")
modparam("tls_mgm", "certificate", "[dom1]/etc/letsencrypt/cert.pem")
modparam("tls_mgm", "private_key",
"[dom1]/etc/letsencrypt/privkey.pem")
modparam("tls_mgm", "require_cert", "[dom1]0")
modparam("tls_mgm", "tls_method", "[dom1]TLSv1-")
modparam("tls_mgm", "verify_cert", "[dom1]0")

loadmodule "proto_tls.so"

###
$ru = "sip:10.0.0.153:5061;transport=tls";

Re: [OpenSIPS-Users] mid_registrar TLS

2022-02-10 Thread Alberto
I was confused because I use a wildcard cert, so I only have one cert for
server/client and any possible subdomain. I don't need to match
server/client requests to different certs.
So I ended up with this config and it seems to work fine.
Thanks

loadmodule "tls_mgm.so"
modparam("tls_mgm", "tls_library", "wolfssl")

modparam("tls_mgm", "server_domain", "sd_1")
modparam("tls_mgm", "ca_list", "[sd_1]/etc/letsencrypt/fullchain.pem")
modparam("tls_mgm", "certificate", "[sd_1]/etc/letsencrypt/cert.pem")
modparam("tls_mgm", "private_key", "[sd_1]/etc/letsencrypt/privkey.pem")
modparam("tls_mgm", "require_cert", "[sd_1]0")
modparam("tls_mgm", "tls_method", "[sd_1]TLSv1-")
modparam("tls_mgm", "verify_cert", "[sd_1]0")
modparam("tls_mgm", "match_sip_domain", "[sd_1]*")
modparam("tls_mgm", "match_ip_address", "[sd_1]*")

modparam("tls_mgm", "client_domain", "cd_1")
modparam("tls_mgm", "ca_list", "[cd_1]/etc/letsencrypt/fullchain.pem")
modparam("tls_mgm", "certificate", "[cd_1]/etc/letsencrypt/cert.pem")
modparam("tls_mgm", "private_key", "[cd_1]/etc/letsencrypt/privkey.pem")
modparam("tls_mgm", "require_cert", "[cd_1]0")
modparam("tls_mgm", "tls_method", "[cd_1]TLSv1-")
modparam("tls_mgm", "verify_cert", "[cd_1]0")
modparam("tls_mgm", "match_sip_domain", "[cd_1]*")
modparam("tls_mgm", "match_ip_address", "[cd_1]*")


On Thu, 10 Feb 2022 at 07:59, Bogdan-Andrei Iancu 
wrote:

> Hi Alberto,
>
> When OpenSIPS is about the create a new TLS connection, it has to know
> what TSL certificate (client) to use for it.
>
> There are 2 way of indicating that :
>
> * use "match_ip_address" [1] to map the TLS client domain to some IPs you
> want to connect to via TLS
>
> * use "client_tls_domain_avp" [2] to manually select from script which TLS
> domain to be used - set the AVP before the t_relay() to the TLS destination.
>
>
> [1]
> https://opensips.org/html/docs/modules/3.2.x/tls_mgm.html#param_match_ip_address
>
> [2]
> https://opensips.org/html/docs/modules/3.2.x/tls_mgm.html#param_client_tls_domain_avp
>
> Best regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   https://www.opensips-solutions.com
> OpenSIPS eBootcamp
>   https://www.opensips.org/Training/Bootcamp
>
> On 2/4/22 2:40 PM, Alberto wrote:
>
> Hi,
> I have a sip client connecting to opensips using tls, all requests are
> then routed to an asterisk server using mid_registrar.
>
> UDP to UDP and TCP to TCP work fine, but TLS doesn't.
>
> This is the error, but I'm having a hard time understanding it.
>
> Feb  4 12:29:32 [3406] //etc/opensips/opensips.cfg:453 Forward REGISTER
> for sip:tls-1001@10.0.0.252:5061 to 10.0.0.153:5061;transport=tls
> Feb  4 12:29:32 [3406] ERROR:proto_tls:proto_tls_conn_init: no TLS client
> domain found
> Feb  4 12:29:32 [3406] ERROR:core:tcp_conn_create: failed to do proto 3
> specific init for conn 0x7ff9be1810f8
> Feb  4 12:29:32 [3406] ERROR:core:tcp_async_connect: tcp_conn_create
> failed, closing the socket
> Feb  4 12:29:32 [3406] ERROR:proto_tls:proto_tls_send: async TCP connect
> failed
> Feb  4 12:29:32 [3406] ERROR:tm:msg_send: send() to 10.0.0.153:5061 for
> proto tls/3 failed
> Feb  4 12:29:32 [3406] ERROR:tm:t_forward_nonack: sending request failed
> Feb  4 12:29:32 [3406] ERROR:tm:w_t_relay: t_forward_nonack failed
>
>
> My configuration:
> #
> loadmodule "mid_registrar.so"
> modparam("mid_registrar", "attr_avp", "$avp(avp_json)")
> modparam("mid_registrar", "max_contacts", 1)
> modparam("mid_registrar", "mode", 0)
> modparam("mid_registrar", "tcp_persistent_flag",
> "TCP_PERSIST_REGISTRATIONS")
>
> loadmodule "tls_mgm.so"
> modparam("tls_mgm", "tls_library", "wolfssl")
> modparam("tls_mgm", "server_domain", "dom1")
> modparam("tls_mgm", "ca_list", "[dom1]/etc/letsencrypt/fullchain.pem")
> modparam("tls_mgm", "certificate", "[dom1]/etc/letsencrypt/cert.pem")
> modparam("tls_mgm", "private_key", "[dom1]/etc/letsencrypt/privkey.pem")
> modparam("tls_mgm", "require_cert", "[dom1]0")
> modparam("tls_mgm", "tls_method", "[dom1]TLSv1-")
> modparam("tls_mgm", "verify_cert", "[dom1]0")
>
> loadmodule "proto_tls.so"
>
> ###
> $ru = "sip:10.0.0.153:5061;transport=tls";
> setflag("TCP_PERSISTENT");
> route(relay);
>
>
> Thanks
>
> ___
> Users mailing 
> listUsers@lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar TLS

2022-02-10 Thread Bogdan-Andrei Iancu

Hi Alberto,

When OpenSIPS is about the create a new TLS connection, it has to know 
what TSL certificate (client) to use for it.


There are 2 way of indicating that :

* use "match_ip_address" [1] to map the TLS client domain to some IPs 
you want to connect to via TLS


* use "client_tls_domain_avp" [2] to manually select from script which 
TLS domain to be used - set the AVP before the t_relay() to the TLS 
destination.



[1] 
https://opensips.org/html/docs/modules/3.2.x/tls_mgm.html#param_match_ip_address


[2] 
https://opensips.org/html/docs/modules/3.2.x/tls_mgm.html#param_client_tls_domain_avp


Best regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS eBootcamp
  https://www.opensips.org/Training/Bootcamp

On 2/4/22 2:40 PM, Alberto wrote:

Hi,
I have a sip client connecting to opensips using tls, all requests are 
then routed to an asterisk server using mid_registrar.


UDP to UDP and TCP to TCP work fine, but TLS doesn't.

This is the error, but I'm having a hard time understanding it.

Feb  4 12:29:32 [3406] //etc/opensips/opensips.cfg:453 Forward 
REGISTER for sip:tls-1001@10.0.0.252:5061 
 to 10.0.0.153:5061;transport=tls
Feb  4 12:29:32 [3406] ERROR:proto_tls:proto_tls_conn_init: no TLS 
client domain found
Feb  4 12:29:32 [3406] ERROR:core:tcp_conn_create: failed to do proto 
3 specific init for conn 0x7ff9be1810f8
Feb  4 12:29:32 [3406] ERROR:core:tcp_async_connect: tcp_conn_create 
failed, closing the socket
Feb  4 12:29:32 [3406] ERROR:proto_tls:proto_tls_send: async TCP 
connect failed
Feb  4 12:29:32 [3406] ERROR:tm:msg_send: send() to 10.0.0.153:5061 
 for proto tls/3 failed

Feb  4 12:29:32 [3406] ERROR:tm:t_forward_nonack: sending request failed
Feb  4 12:29:32 [3406] ERROR:tm:w_t_relay: t_forward_nonack failed


My configuration:
#
loadmodule "mid_registrar.so"
modparam("mid_registrar", "attr_avp", "$avp(avp_json)")
modparam("mid_registrar", "max_contacts", 1)
modparam("mid_registrar", "mode", 0)
modparam("mid_registrar", "tcp_persistent_flag", 
"TCP_PERSIST_REGISTRATIONS")


loadmodule "tls_mgm.so"
modparam("tls_mgm", "tls_library", "wolfssl")
modparam("tls_mgm", "server_domain", "dom1")
modparam("tls_mgm", "ca_list", "[dom1]/etc/letsencrypt/fullchain.pem")
modparam("tls_mgm", "certificate", "[dom1]/etc/letsencrypt/cert.pem")
modparam("tls_mgm", "private_key", "[dom1]/etc/letsencrypt/privkey.pem")
modparam("tls_mgm", "require_cert", "[dom1]0")
modparam("tls_mgm", "tls_method", "[dom1]TLSv1-")
modparam("tls_mgm", "verify_cert", "[dom1]0")

loadmodule "proto_tls.so"

###
$ru = "sip:10.0.0.153:5061;transport=tls";
setflag("TCP_PERSISTENT");
route(relay);


Thanks

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid_registrar TLS

2022-02-04 Thread Alberto
Hi,
I have a sip client connecting to opensips using tls, all requests are then
routed to an asterisk server using mid_registrar.

UDP to UDP and TCP to TCP work fine, but TLS doesn't.

This is the error, but I'm having a hard time understanding it.

Feb  4 12:29:32 [3406] //etc/opensips/opensips.cfg:453 Forward REGISTER for
sip:tls-1001@10.0.0.252:5061 to 10.0.0.153:5061;transport=tls
Feb  4 12:29:32 [3406] ERROR:proto_tls:proto_tls_conn_init: no TLS client
domain found
Feb  4 12:29:32 [3406] ERROR:core:tcp_conn_create: failed to do proto 3
specific init for conn 0x7ff9be1810f8
Feb  4 12:29:32 [3406] ERROR:core:tcp_async_connect: tcp_conn_create
failed, closing the socket
Feb  4 12:29:32 [3406] ERROR:proto_tls:proto_tls_send: async TCP connect
failed
Feb  4 12:29:32 [3406] ERROR:tm:msg_send: send() to 10.0.0.153:5061 for
proto tls/3 failed
Feb  4 12:29:32 [3406] ERROR:tm:t_forward_nonack: sending request failed
Feb  4 12:29:32 [3406] ERROR:tm:w_t_relay: t_forward_nonack failed


My configuration:
#
loadmodule "mid_registrar.so"
modparam("mid_registrar", "attr_avp", "$avp(avp_json)")
modparam("mid_registrar", "max_contacts", 1)
modparam("mid_registrar", "mode", 0)
modparam("mid_registrar", "tcp_persistent_flag",
"TCP_PERSIST_REGISTRATIONS")

loadmodule "tls_mgm.so"
modparam("tls_mgm", "tls_library", "wolfssl")
modparam("tls_mgm", "server_domain", "dom1")
modparam("tls_mgm", "ca_list", "[dom1]/etc/letsencrypt/fullchain.pem")
modparam("tls_mgm", "certificate", "[dom1]/etc/letsencrypt/cert.pem")
modparam("tls_mgm", "private_key", "[dom1]/etc/letsencrypt/privkey.pem")
modparam("tls_mgm", "require_cert", "[dom1]0")
modparam("tls_mgm", "tls_method", "[dom1]TLSv1-")
modparam("tls_mgm", "verify_cert", "[dom1]0")

loadmodule "proto_tls.so"

###
$ru = "sip:10.0.0.153:5061;transport=tls";
setflag("TCP_PERSISTENT");
route(relay);


Thanks
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_registrar forking issue when push notifications enabled

2022-01-18 Thread Liviu Chircu

On 17.01.2022 22:52, Sugar wrote:
Is there a private place to upload debug log including config (in case 
some sanitation of sensitive info is missed)? Can you provide where to 
send? Thanks in advance. And yes it appears the register matching part 
is not occurring. Can also provide pcap of call when contact is pn 
enabled on one test extension that is being called as well. Let me 
know where I can send. And thank you again for responding.
If you have sensitive info, just email it to li...@opensips.org then, 
and I'll take a look.
Also while the column size was fixed in the usrloc table, the dialog 
table was not fixed, it still has char(255). I updated my schema to 
fix it (was using mysql db to save dialogs for testing and possible 
expansion to two opensips instances in dev environment.


My bad, your initial message said "dialog.contact", but I read 
"usrloc.contact", as the CHAR(255) pattern was identical.  Thank you for 
the hint, will push a fix for this as well!


Cheers,

--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_registrar forking issue when push notifications enabled

2022-01-17 Thread Sugar
Is there a private place to upload debug log including config (in case some 
sanitation of sensitive info is missed)? Can you provide where to send? Thanks 
in advance. And yes it appears the register matching part is not occurring. Can 
also provide pcap of call when contact is pn enabled on one test extension that 
is being called as well. Let me know where I can send. And thank you again for 
responding.Also while the column size was fixed in the usrloc table, the dialog 
table was not fixed, it still has char(255). I updated my schema to fix it (was 
using mysql db to save dialogs for testing and possible expansion to two 
opensips instances in dev environment.
 Original message From: Liviu Chircu  Date: 
1/17/22  2:11 PM  (GMT-06:00) To: users@lists.opensips.org Subject: Re: 
[OpenSIPS-Users] Mid_registrar forking issue when push notifications enabled 
Hi,

Answers inline,


On 17.01.2022 10:18, Sugar wrote:


  
  
  
  The log shows the push notification is successful
using rest client, 1 second after successful android push
notification, the client registers but the call is not forked
(it appears no transaction branch injection occurs).

So everything worked except for the last
  step: the REGISTER-INVITE matching part.  Could you post some full
  DEBUG logs of a call sequence, including the final Re-REGISTER
  triggered by the PN?  I need to understand why the event_routing
  module is not properly matching that Re-REGISTER to the halted
  INVITE.

  
  
  Mid_registrar_save params are p0c2f
  
  
  Mid_registrar_lookup called with m flag only when
si is from main registrar.
  
  
  Mid registrar mode 2
  
  
  Pn enabled with default values.
  
  
  E_UL_contact_refresh properly raised
  
  
  Usrloc fr_timeout raised to 10 seconds
  
   pn_process_purr is not enabled.

Settings "sound" OK.  Perhaps including them
  could help to some degree.  I am actually doing some testing on
  this 3.2.4 code these days as well, so expect more feedback to
  come, as I run through the same flows.

  
  
  PS storing call dialog in a database requires the
contact fields to be changed from char(255) to text when pn
enabled. It has been really hard trying to find where to alert
opensips about that. If someone has that info can you let me
know (ie github, developer list, other support avenue).

Per the timely suggestions of John Quick,
this limitation of the DB schema was already fixed and
backported to 3.1+ five months ago, see here[1].
[1]:
https://github.com/OpenSIPS/opensips/commit/70e8b24b
Best Regards,

-- 
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com
  

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_registrar forking issue when push notifications enabled

2022-01-17 Thread Liviu Chircu

Hi,

Answers inline,

On 17.01.2022 10:18, Sugar wrote:


The log shows the push notification is successful using rest client, 1 
second after successful android push notification, the client 
registers but the call is not forked (it appears no transaction branch 
injection occurs).
So everything worked except for the last step: the REGISTER-INVITE 
matching part.  Could you post some full DEBUG logs of a call sequence, 
including the final Re-REGISTER triggered by the PN?  I need to 
understand why the event_routing module is not properly matching that 
Re-REGISTER to the halted INVITE.


Mid_registrar_save params are p0c2f

Mid_registrar_lookup called with m flag only when si is from main 
registrar.


Mid registrar mode 2

Pn enabled with default values.

E_UL_contact_refresh properly raised

Usrloc fr_timeout raised to 10 seconds

 pn_process_purr is not enabled.
Settings "sound" OK.  Perhaps including them could help to some degree.  
I am actually doing some testing on this 3.2.4 code these days as well, 
so expect more feedback to come, as I run through the same flows.


PS storing call dialog in a database requires the contact fields to be 
changed from char(255) to text when pn enabled. It has been really 
hard trying to find where to alert opensips about that. If someone has 
that info can you let me know (ie github, developer list, other 
support avenue).


Per the timely suggestions of John Quick, this limitation of the DB 
schema was already fixed and backported to 3.1+ five months ago, see 
here^[1] .


[1]: https://github.com/OpenSIPS/opensips/commit/70e8b24b

Best Regards,

--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Mid_registrar forking issue when push notifications enabled

2022-01-17 Thread Sugar
Hello. I am trying to implement mid_registrar with little success and need 
assistance.If the called contact is not pn enabled, the other internal 
extension rings and call is successful.If the called contact is push enabled it 
will not ring.Mid_registrar_lookup returns 2 and I do not t_relay itThe log 
shows the push notification is successful using rest client, 1 second after 
successful android push notification, the client registers but the call is not 
forked (it appears no transaction branch injection occurs).Mid_registrar_save 
params are p0c2fMid_registrar_lookup called with m flag only when si is from 
main registrar.Mid registrar mode 2Pn enabled with default 
values.E_UL_contact_refresh properly raisedUsrloc fr_timeout raised to 10 
secondsDoes pn_inv_refresh need to be increased when fr_timeout is increased. I 
have config and packet capture from opensips for when 1 contact is pn enabled 
and one is not. Using mid_registrar and dialog module and if anyone needs more 
info to assist. pn_process_purr is not enabled.Using opensips 3.2.4, Can 
someone please assist? Thanks in advance.I am hoping I don't have to switch to 
flexisip since I have spent a lot of time tweaking.PS storing call dialog in a 
database requires the contact fields to be changed from char(255) to text when 
pn enabled. It has been really hard trying to find where to alert opensips 
about that. If someone has that info can you let me know (ie github, developer 
list, other support avenue).___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar errors

2022-01-03 Thread Bogdan-Andrei Iancu

Hi Pavel,

OK, I will ask Liviu to take a deeper look into this, thanks for the report.

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/3/22 7:47 PM, Pavel Eremin wrote:
Thanks for your answer I suppose there is some little mistake in the 
code of mid_registrar due to this error easylly reproducing on the new 
opensips installation.
Conditions are simple: centos 7 or debian 10, opensips 3.2 ver, use 
mid_registrar (mode=2 or 1) and registrar in the same script.
For example for REGISTER with tU like 1000 we will make 
mid_registrar_save and for 2 we will do save().

In case of save() we will get those errors in logs.

I have created an 
issue(https://github.com/OpenSIPS/opensips/issues/2716 
) on github about that.




пн, 3 янв. 2022 г. в 21:34, Bogdan-Andrei Iancu >:


Hi Alexey,

What the errors say is that mid-registrar, upon deleting/expiring
a registered AOR, it is not able to push forward the un-register
to the main registrar. This happens as some internal key (attached
to the AOR) is not found by the mid-registrar.

Not sure how this may be related to the changing of the IPs, but I
guess this issue went away after some time, right? if not, you may
stop opensips mid-registrar, purge the "location" table (or how
you named it) and start opensips back. This will flush all the
pending (potential bogus records) and give you a fresh start. Note
that your device will have to re-register in order to have the
calling working again.

Regards,

Bogdan-Andrei Iancu

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


On 12/27/21 10:15 AM, Alexey Kazantsev via Users wrote:

Hi list.
What do these errors mean?
This started after migrating the virtual machine and changing IP
addresses.
Everything else remain unchanged.
Version 3.2.2
ERROR:mid_registrar:unregister_record: 'from' key not found,
skipping De-REGISTER
ERROR:mid_registrar:mid_reg_aor_event: failed to unregister contact
---
BR, Alexey
https://alexeyka.zantsev.com/ 

___
Users mailing list
Users@lists.opensips.org  
http://lists.opensips.org/cgi-bin/mailman/listinfo/users  



___
Users mailing list
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar errors

2022-01-03 Thread Pavel Eremin
Thanks for your answer I suppose there is some little mistake in the code
of mid_registrar due to this error easylly reproducing on the new opensips
installation.
Conditions are simple: centos 7 or debian 10, opensips 3.2 ver, use
mid_registrar (mode=2 or 1) and registrar in the same script.
For example for REGISTER with tU like 1000 we will make mid_registrar_save
and for 2 we will do save().
In case of save() we will get those errors in logs.

I have created an issue(https://github.com/OpenSIPS/opensips/issues/2716)
on github about that.



пн, 3 янв. 2022 г. в 21:34, Bogdan-Andrei Iancu :

> Hi Alexey,
>
> What the errors say is that mid-registrar, upon deleting/expiring a
> registered AOR, it is not able to push forward the un-register to the main
> registrar. This happens as some internal key (attached to the AOR) is not
> found by the mid-registrar.
>
> Not sure how this may be related to the changing of the IPs, but I guess
> this issue went away after some time, right? if not, you may stop opensips
> mid-registrar, purge the "location" table (or how you named it) and start
> opensips back. This will flush all the pending (potential bogus records)
> and give you a fresh start. Note that your device will have to re-register
> in order to have the calling working again.
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   https://www.opensips-solutions.com
> OpenSIPS eBootcamp 2021
>   https://opensips.org/training/OpenSIPS_eBootcamp_2021/
>
> On 12/27/21 10:15 AM, Alexey Kazantsev via Users wrote:
>
> Hi list.
>
> What do these errors mean?
> This started after migrating the virtual machine and changing IP addresses.
> Everything else remain unchanged.
>
> Version 3.2.2
>
> ERROR:mid_registrar:unregister_record: 'from' key not found, skipping
> De-REGISTER
> ERROR:mid_registrar:mid_reg_aor_event: failed to unregister contact
>
>
> ---
> BR, Alexey
> https://alexeyka.zantsev.com/
>
> ___
> Users mailing 
> listUsers@lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar errors

2022-01-03 Thread Bogdan-Andrei Iancu

Hi Alexey,

What the errors say is that mid-registrar, upon deleting/expiring a 
registered AOR, it is not able to push forward the un-register to the 
main registrar. This happens as some internal key (attached to the AOR) 
is not found by the mid-registrar.


Not sure how this may be related to the changing of the IPs, but I guess 
this issue went away after some time, right? if not, you may stop 
opensips mid-registrar, purge the "location" table (or how you named it) 
and start opensips back. This will flush all the pending (potential 
bogus records) and give you a fresh start. Note that your device will 
have to re-register in order to have the calling working again.


Regards,

Bogdan-Andrei Iancu

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

On 12/27/21 10:15 AM, Alexey Kazantsev via Users wrote:

Hi list.
What do these errors mean?
This started after migrating the virtual machine and changing IP 
addresses.

Everything else remain unchanged.
Version 3.2.2
ERROR:mid_registrar:unregister_record: 'from' key not found, skipping 
De-REGISTER

ERROR:mid_registrar:mid_reg_aor_event: failed to unregister contact
---
BR, Alexey
https://alexeyka.zantsev.com/

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid_registrar errors

2021-12-27 Thread Alexey Kazantsev via Users

Hi list.
 
What do these errors mean?
This started after migrating the virtual machine and changing IP addresses.
Everything else remain unchanged.
 
Version 3.2.2
 
ERROR:mid_registrar:unregister_record: 'from' key not found, skipping 
De-REGISTER
ERROR:mid_registrar:mid_reg_aor_event: failed to unregister contact
 
 
---
BR, Alexey
https://alexeyka.zantsev.com/___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar lookup

2021-04-06 Thread volga629 via Users

  
  
Hello Liviu,
I opened report 
https://github.com/OpenSIPS/opensips/issues/2454

And all pcap and logs sent to you email. 
If you will require configuration example let me know. I will
pull one from our environment. 


volga629

  
On 3/30/21 7:01 AM, Liviu Chircu wrote:

On
  26.03.2021 17:57, volga629 wrote:
  
  Hello Liviu,

I want file report on it. I have wireshark screenshot which
shows exact issue.

Initial INVITE lookup is  forked to all registered destinations,
but ACK no.

  
  
  Hi Slava,
  
  
  Please file a report on it and attach the call flow.  If privacy
  is a concern, just email
  
  the screenshots to my email address.
  
  
  Best regards,
  
  


  


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar lookup

2021-03-30 Thread Liviu Chircu

On 26.03.2021 17:57, volga629 wrote:

Hello Liviu,
I want file report on it. I have wireshark screenshot which shows 
exact issue.
Initial INVITE lookup is  forked to all registered destinations, but 
ACK no.


Hi Slava,

Please file a report on it and attach the call flow.  If privacy is a 
concern, just email

the screenshots to my email address.

Best regards,

--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar lookup

2021-03-26 Thread volga629 via Users

  
  
Hello Liviu,
I want file report on it. I have wireshark screenshot which shows
exact issue. 
Initial INVITE lookup is  forked to all registered destinations, but
ACK no.

On ACK in dialog applied snippet like this 

route[WITHINDLG] {
     if(has_totag()) {
 if(topology_hiding_match()) {

           if(is_method("ACK") && $DLG_did!=NULL &&
$DLG_did!="
    xlog("[IN_DIALOG] [$rm] in dialog ACK with
dialog ID => [$DLG_did]\n");
    setflag("FLAG_ACK_IN_DIALOG");
    }
  route(RELAY);
 exit;
   } else {
   ...
    }
}

route[RELAY] {
 
  } else if(isflagset("FLAG_ACK_IN_DIALOG")) {
    $ru = $tu;
    route(CONTACT_LOOKUP);
    }
    if(is_method("ACK") &&
$avp(ua_orig_trns)==NULL) {
    #  TCP applied 
    $var(src_socket) = "tcp" + ":" +
$avp(req_ip) + ":" + "5084";
    }
            $socket_out = $var(src_socket);
    xlog("[RELAY] [$rm] sending call ~> $ru over $socket_out
for $ci\n");
    if(!t_relay()) {
    send_reply(500, "Internal Error");
    exit;
    }
    exit;

}

volga629
 

On 3/24/21 1:14 PM, volga629 via Users
  wrote:


  
  Hello Liviu,
  May I send few screen shot of sip flow for this call ?
  
  volga629.
  
  On 3/24/21 8:57 AM, volga629 via
Users wrote:
  
  

Hello Liviu,
We use topology hiding edge proxy for end point.
Here are example 
of contact header 

Contact: 

that call is inbound from PBX  to opensips and opensips forward
to end point.


   
if(is_method("INVITE|UPDATE|ACK|BYE|CANCEL|NOTIFY|INFO|OPTIONS")
&& $rU=~"%40") {
    xlog("[RELAY] [$rm] testing original
[$ru]\n");
    route(CONTACT_LOOKUP);
    # We want exclude ACK rewrite toward Bria Push
Server
    } else if(!isflagset("FLAG_BRIA_PUSH")) {
    xlog("[RELAY] [$rm] didn't match R-URI
schema [$ru] correcting\n");
    $ru = "sip:" + $tU + "%40" + $td + "@" +
$td;
    route(CONTACT_LOOKUP);
    }


volga629 

On 3/24/21 5:04 AM, Liviu Chircu
  wrote:


  
  On 24.03.2021 05:04, volga629 via
Users wrote:
  
  But then arrive the ACK
and that where start the problems lookup  only find
first contact and not second.
  Hi Volga,
  So you're doing a lookup() on the
  ACK Request-URI?  Typically, the ACK R-URI will contain a
  contact header, which is not meant to be searchable.  I'm
  surprised you even get 1 result, I would expect such a
  lookup() to return -1.
  Can you explain what you are trying
  to achieve?  Why not just route the ACK using
  loose_route(), just like all other mid-dialog requests,
  and be done with it?

  -- 
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com




___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

  
  
  
  
  ___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



  


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar lookup

2021-03-24 Thread volga629 via Users

  
  
Hello Liviu,
May I send few screen shot of sip flow for this call ?

volga629.

On 3/24/21 8:57 AM, volga629 via Users
  wrote:


  
  Hello Liviu,
  We use topology hiding edge proxy for end point.
  Here are example 
  of contact header 
  
  Contact: 
  
  that call is inbound from PBX  to opensips and opensips forward to
  end point.
  
  
     
  if(is_method("INVITE|UPDATE|ACK|BYE|CANCEL|NOTIFY|INFO|OPTIONS")
  && $rU=~"%40") {
      xlog("[RELAY] [$rm] testing original
  [$ru]\n");
      route(CONTACT_LOOKUP);
      # We want exclude ACK rewrite toward Bria Push
  Server
      } else if(!isflagset("FLAG_BRIA_PUSH")) {
      xlog("[RELAY] [$rm] didn't match R-URI
  schema [$ru] correcting\n");
      $ru = "sip:" + $tU + "%40" + $td + "@" +
  $td;
      route(CONTACT_LOOKUP);
      }
  
  
  volga629 
  
  On 3/24/21 5:04 AM, Liviu Chircu
wrote:
  
  

On 24.03.2021 05:04, volga629 via
  Users wrote:

But then arrive the ACK and
  that where start the problems lookup  only find first
  contact and not second.
Hi Volga,
So you're doing a lookup() on the ACK
Request-URI?  Typically, the ACK R-URI will contain a
contact header, which is not meant to be searchable.  I'm
surprised you even get 1 result, I would expect such a
lookup() to return -1.
Can you explain what you are trying to
achieve?  Why not just route the ACK using loose_route(),
just like all other mid-dialog requests, and be done with
it?
  
-- 
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com
  
  
  
  
  ___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



  


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar outgoing_expire issue (Bug?)

2021-03-24 Thread Ricardo Martinez
Guys.

I finally install all the latest changes….

So far so good… at least the initial problem for the outgoing_expire not
modified is fixed!!.

Thanks again for your help!



Ricardo



*De:* Liviu Chircu 
*Enviado el:* miércoles, 24 de marzo de 2021 11:09
*Para:* Ricardo Martinez ; OpenSIPS users mailling
list 
*Asunto:* Re: [OpenSIPS-Users] Mid_Registrar outgoing_expire issue (Bug?)



On 24.03.2021 16:05, Ricardo Martinez wrote:

So.. in order to make the update… is just fine to make it through git using
this?

git clone https://github.com/OpenSIPS/opensips.git -b 3.1 opensips-3.1

That will pull all the latest changes ??

Correct!  And, in the future, to fetch latest version, just do:

git pull --rebase

Of course, you have to compile & install the new binaries after each
update, using your usual technique.

-- 

Liviu Chircu

www.twitter.com/liviuchircu | www.opensips-solutions.com
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar outgoing_expire issue (Bug?)

2021-03-24 Thread Liviu Chircu

On 24.03.2021 16:05, Ricardo Martinez wrote:


So.. in order to make the update… is just fine to make it through git 
using this?


git clone https://github.com/OpenSIPS/opensips.git 
-b 3.1 opensips-3.1


That will pull all the latest changes ??


Correct!  And, in the future, to fetch latest version, just do:

git pull --rebase

Of course, you have to compile & install the new binaries after each 
update, using your usual technique.


--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar outgoing_expire issue (Bug?)

2021-03-24 Thread Ricardo Martinez
Liviu.

Thanks for that!… that seems to deal with the problem I’m facing….

I will try the update and let you know!



One more question….

I have installed opensips 3.1.0 from the link
*http://opensips.org/pub/opensips/latest*
<http://opensips.org/pub/opensips/latest>, that’s why I have the
version I mention…

So.. in order to make the update… is just fine to make it through git using
this?:

git clone https://github.com/OpenSIPS/opensips.git -b 3.1 opensips-3.1



That will pull all the latest changes ??





Best Regards,

Ricardo





*De:* Liviu Chircu 
*Enviado el:* miércoles, 24 de marzo de 2021 10:26
*Para:* Ricardo Martinez ; OpenSIPS users mailling
list 
*Asunto:* Re: [OpenSIPS-Users] Mid_Registrar outgoing_expire issue (Bug?)



On 24.03.2021 15:18, Ricardo Martinez wrote:

I'm using

version: opensips 3.1.0 (x86_64/linux)

git revision: 58804282f

*git log 58804282fe5..HEAD modules/mid_registrar*

There are at least 8 mid-registrar fixes which you are missing, including:

--
commit a958382016e9825c4d2363157f29ea356b57d67a
Author: Liviu Chircu  
Date:   Fri Jan 15 18:17:42 2021 +0200

mid_registrar: Fix "Expires" edge-case in AoR throttling mode

This fixes a bug where the mid-registrar, in mode == 2, would not
correctly process REGISTER requests containing both:
* an ";expires=" Contact param
* an "Expires" header field

Specifically, the "Expires" header would incorrectly transit "as is",
without being changed.

Related to #2350
--

So my advice would be to pull latest 3.1 code and see if the "Expires"
header processing behavior improves.

Best regards,

-- 

Liviu Chircu

www.twitter.com/liviuchircu | www.opensips-solutions.com
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar outgoing_expire issue (Bug?)

2021-03-24 Thread Liviu Chircu

On 24.03.2021 15:51, volga629 wrote:

Is in 3.1.2 all those fixes will be released ?


Yes, most of them have not made it into 3.1.1.

--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar outgoing_expire issue (Bug?)

2021-03-24 Thread volga629 via Users

  
  
Hello Liviu,
Is in 3.1.2 all those fixes  will be released ?

volga629 
  
On 3/24/21 10:26 AM, Liviu Chircu
  wrote:


  
  On 24.03.2021 15:18, Ricardo Martinez
wrote:
  
  
I'm using
version: opensips 3.1.0 (x86_64/linux)
git revision: 58804282f
  
  git log 58804282fe5..HEAD
modules/mid_registrar
  There are at least 8 mid-registrar fixes
  which you are missing, including:
  --
  commit a958382016e9825c4d2363157f29ea356b57d67a
  Author: Liviu Chircu 
  Date:   Fri Jan 15 18:17:42 2021 +0200
  
      mid_registrar: Fix "Expires" edge-case in AoR throttling
  mode
      
      This fixes a bug where the mid-registrar, in mode == 2,
  would not
      correctly process REGISTER requests containing both:
      * an ";expires=" Contact param
      * an "Expires" header field
      
      Specifically, the "Expires" header would incorrectly
  transit "as is",
      without being changed.
      
      Related to #2350
  --
  So my advice would be to pull latest 3.1
  code and see if the "Expires" header processing behavior
  improves.

  Best regards,
  
  -- 
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com
  
  
  ___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



  


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar outgoing_expire issue (Bug?)

2021-03-24 Thread Liviu Chircu

On 24.03.2021 15:18, Ricardo Martinez wrote:

I'm using
version: opensips 3.1.0 (x86_64/linux)
git revision: 58804282f


*git log 58804282fe5..HEAD modules/mid_registrar*

There are at least 8 mid-registrar fixes which you are missing, including:

--
commit a958382016e9825c4d2363157f29ea356b57d67a
Author: Liviu Chircu 
Date:   Fri Jan 15 18:17:42 2021 +0200

    mid_registrar: Fix "Expires" edge-case in AoR throttling mode

    This fixes a bug where the mid-registrar, in mode == 2, would not
    correctly process REGISTER requests containing both:
    * an ";expires=" Contact param
    * an "Expires" header field

    Specifically, the "Expires" header would incorrectly transit "as is",
    without being changed.

    Related to #2350
--

So my advice would be to pull latest 3.1 code and see if the "Expires" 
header processing behavior improves.


Best regards,

--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar outgoing_expire issue (Bug?)

2021-03-24 Thread Ricardo Martinez
Hi Volga.

Thanks for your answer.  Let me get this right.

In my case… if I receive a REGISTER to the mid_registrar like this:



REGISTER

Contact: 
;+sip.instance="";reg-id=1;expires=300

Expires: 300.



I apply the work around you mention…



Then I will get the outgoing_register to the PBX with the value modified?



Thanks!

Ricardo



*De:* volga629 
*Enviado el:* martes, 23 de marzo de 2021 23:37
*Para:* OpenSIPS users mailling list ; Ricardo
Martinez 
*Asunto:* Re: [OpenSIPS-Users] Mid_Registrar outgoing_expire issue (Bug?)



Hello Ricardo,
I noticed this issue too. My work around is

Where 7200 is  outgoing_expires in module params.





 if($(hdr("Expires"){s.int})!=7200) {
remove_hf("Expires");
append_hf("Expires: 7200\r\n");
}

volga629

On 3/23/21 12:46 PM, Ricardo Martinez wrote:

Hi.

I’m still unable to understand why the REGISTER is not using the

outgoing_expire.

First.   It's weird because according to the debug seems to change the

outgoing_expire to 3600 but when I check the outgoing REGISTER from the

MID_REGISTRAR still has the Expire Header = 300.

One thing I noticed is for the first REGISTER (the one the

outgoing_expires works) it changes the Expires header ok, this REGISTER

does not have contact expire header, but for the second REGISTER.. which

has Expire header and expire contact header.. seems to apply only the

"expire in the contact header"

(DBG:mid_registrar:replace_expires_ct_param).

These are the debugs...

Is this a bug? Or maybe I'm missing something?



1. Outgoing Expire  OK

INCOMING REGISTER

Contact:

sip:d2.596@192.168.0.34;rinstance=fa92ef51cba5543d;transport=tls>;+sip.ins

tance="

Expires: 300.



DBG:mid_registrar:mid_reg_save: saving to location...

DBG:mid_registrar:prepare_forward: from: '"Ricardo

Martinez"
;tag=ba489a60'

DBG:mid_registrar:prepare_forward: Call-ID:

'187541_mobile-rel120YzljYzJjNjcwOGJlYmYxOTU0MDM1NDBlMDJiZDQyNjg'

DBG:mid_registrar:prepare_forward: Contact:

'
;+sip.i

nstance=""'

DBG:mid_registrar:prepare_forward: registering ptr 0x7f6efc9c6b78 on

TMCB_REQUEST_FWDED ...

DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_FWDED,

mri=0x7f6efc9c6b78 ...

DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_DELETED,

mri=0x7f6efc9c6b78 ...

[187541_mobile-rel120YzljYzJjNjcwOGJlYmYxOTU0MDM1NDBlMDJiZDQyNjg]

[from_vex] [REGISTER sin totag][mid_registrar_save]: Retorna valor 1

[187541_mobile-rel120YzljYzJjNjcwOGJlYmYxOTU0MDM1NDBlMDJiZDQyNjg]

[from_vex] [REGISTER sin totag][mid_registrar_save]:

sip:d2@dom1.company.com:5061 salvado en tabla location

DBG:mid_registrar:mid_reg_req_fwded: msg expires: '300'

DBG:mid_registrar:calc_contact_expires: expires: 300

DBG:mid_registrar:calc_ob_contact_expires: outgoing expires: 1616511318

DBG:mid_registrar:overwrite_contact_expirations: ... contact:

'sip:d2.596@192.168.0.34;rinstance=fa92ef51cba5543d;transport=tls>;+sip.in

stance=""#015' Calculated

TIMEOUT = 1616511318 (3600)

DBG:mid_registrar:replace_expires_hf: ... Exp hdr: '300'

DBG:mid_registrar:mid_reg_req_fwded: trimming all Contact URIs into one...

DBG:mid_registrar:calc_contact_expires: expires: 300

DBG:mid_registrar:trim_to_single_contact: deleting Contact

'
;+sip.i

nstance=""'

DBG:mid_registrar:trim_to_single_contact: inserting new Contact

' '

DBG:mid_registrar:calc_contact_expires: expires: 300

DBG:mid_registrar:mid_reg_req_fwded: REQ FORWARDED TO

'sip:dom1.company.com:5061' (obp: sip:192.141.XXX.94:5060), expires=3600



OUTGOING REGISTER

Contact:  .

Expires: 3600.



2. Outgoing_expire fail

But for the Second REGISTER (from the PUSH SERVER)

INCOMING REGISTER

Contact:


;+sip.instance="";reg-id=1;expires=300

Expires: 300.



DBG:mid_registrar:mid_reg_save: saving to location...

DBG:mid_registrar:prepare_forward: from:

'
;tag=0f1c2a07'

DBG:mid_registrar:prepare_forward: Call-ID:

'y12mg-n8ka5jro_j-bhqn...@216.93.xxx.121'

DBG:mid_registrar:prepare_forward: Contact:

'
;+sip.instance="";reg-id=1;expires=300'

DBG:mid_registrar:prepare_forward: registering ptr 0x7f6efc9b60d0 on

TMCB_REQUEST_FWDED ...

DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_FWDED,

mri=0x7f6efc9b60d0 ...

DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_DELETED,

mri=0x7f6efc9b60d0 ...

[y12mg-n8ka5jro_j-bhqn...@216.93.xxx.121] [from_vex] [REGISTER sin

totag][mid_registrar_save]: Retorna valor 1

[y12mg-n8ka5jro_j-bhqn...@216.93.xxx.121] [from_vex] [REGISTER sin

totag][mid_registrar_save]: sip:d2@dom1.company.com:5061 salvado en

tabla location

DBG:mid_registrar:mid_reg_req_fwded: msg expires: '300'

DBG:mid_registrar:calc_contact_expires: expires: 300

DBG:mid_registrar:calc_ob_contact_expires: outgoing expires: 1616511408

DBG:mid_registrar:overwrite_co

Re: [OpenSIPS-Users] Mid_Registrar outgoing_expire issue (Bug?)

2021-03-24 Thread Ricardo Martinez
Hi Liviu.
I'm using
version: opensips 3.1.0 (x86_64/linux)
git revision: 58804282f

Ricardo

-Mensaje original-
De: Liviu Chircu 
Enviado el: miércoles, 24 de marzo de 2021 4:59
Para: OpenSIPS users mailling list ; Ricardo
Martinez 
Asunto: Re: [OpenSIPS-Users] Mid_Registrar outgoing_expire issue (Bug?)

On 23.03.2021 17:46, Ricardo Martinez wrote:
> Hi.
> I’m still unable to understand why the REGISTER is not using the
> outgoing_expire.

Hi,

What version are you using?  `opensips -V`

--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar lookup

2021-03-24 Thread volga629 via Users

  
  
Hello Liviu,
We use topology hiding edge proxy for end point.
Here are example 
of contact header 

Contact: 

that call is inbound from PBX  to opensips and opensips forward to
end point.


   
if(is_method("INVITE|UPDATE|ACK|BYE|CANCEL|NOTIFY|INFO|OPTIONS")
&& $rU=~"%40") {
    xlog("[RELAY] [$rm] testing original
[$ru]\n");
    route(CONTACT_LOOKUP);
    # We want exclude ACK rewrite toward Bria Push
Server
    } else if(!isflagset("FLAG_BRIA_PUSH")) {
    xlog("[RELAY] [$rm] didn't match R-URI
schema [$ru] correcting\n");
    $ru = "sip:" + $tU + "%40" + $td + "@" +
$td;
    route(CONTACT_LOOKUP);
    }


volga629 

On 3/24/21 5:04 AM, Liviu Chircu wrote:


  
  On 24.03.2021 05:04, volga629 via
Users wrote:
  
  But then arrive the ACK and
that where start the problems lookup  only find first
contact and not second.
  Hi Volga,
  So you're doing a lookup() on the ACK
  Request-URI?  Typically, the ACK R-URI will contain a contact
  header, which is not meant to be searchable.  I'm surprised
  you even get 1 result, I would expect such a lookup() to
  return -1.
  Can you explain what you are trying to
  achieve?  Why not just route the ACK using loose_route(), just
  like all other mid-dialog requests, and be done with it?

  -- 
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com


  


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar lookup

2021-03-24 Thread Liviu Chircu

On 24.03.2021 05:04, volga629 via Users wrote:
But then arrive the ACK and that where start the problems lookup  only 
find first contact and not second.


Hi Volga,

So you're doing a lookup() on the ACK Request-URI?  Typically, the ACK 
R-URI will contain a contact header, which is not meant to be 
searchable.  I'm surprised you even get 1 result, I would expect such a 
lookup() to return -1.


Can you explain what you are trying to achieve?  Why not just route the 
ACK using loose_route(), just like all other mid-dialog requests, and be 
done with it?


--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar outgoing_expire issue (Bug?)

2021-03-24 Thread Liviu Chircu

On 23.03.2021 17:46, Ricardo Martinez wrote:

Hi.
I’m still unable to understand why the REGISTER is not using the
outgoing_expire.


Hi,

What version are you using?  `opensips -V`

--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid_registrar lookup

2021-03-23 Thread volga629 via Users

  
  
Hello Everyone,
One extension contain multiply  registered devices. 
We use mid_registrar in AOR  mode 2. 
The issue that lookup always find only result .


For example:
Inbound call from provider to  class 5 device then to opensips.
Opensips mid_registrar doing lookup on INVITE and forward to all
registered devices which normally 2 in count.
But then arrive the ACK and that where start the problems
lookup  only find first contact and not second.
User answer on second device and first device send CANCEL, but
ACK again is sent to  first device with CANCEL , but not second.

Is there are way tweak mid registrar lookup ?


volga629.
  
  


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Mid_Registrar outgoing_expire issue (Bug?)

2021-03-23 Thread volga629 via Users

  
  
Hello Ricardo,
I noticed this issue too. My work around is 

Where 7200 is  outgoing_expires in module params.




if($(hdr("Expires"){s.int})!=7200) {
    remove_hf("Expires");
    append_hf("Expires: 7200\r\n");
    }

volga629
  
On 3/23/21 12:46 PM, Ricardo Martinez
  wrote:


  Hi.
I’m still unable to understand why the REGISTER is not using the
outgoing_expire.
First.   It's weird because according to the debug seems to change the
outgoing_expire to 3600 but when I check the outgoing REGISTER from the
MID_REGISTRAR still has the Expire Header = 300.
One thing I noticed is for the first REGISTER (the one the
outgoing_expires works) it changes the Expires header ok, this REGISTER
does not have contact expire header, but for the second REGISTER.. which
has Expire header and expire contact header.. seems to apply only the
"expire in the contact header"
(DBG:mid_registrar:replace_expires_ct_param).
These are the debugs...
Is this a bug? Or maybe I'm missing something?

1. Outgoing Expire  OK
INCOMING REGISTER
Contact:
sip:d2.596@192.168.0.34;rinstance=fa92ef51cba5543d;transport=tls>;+sip.ins
tance="
Expires: 300.

DBG:mid_registrar:mid_reg_save: saving to location...
DBG:mid_registrar:prepare_forward: from: '"Ricardo
Martinez";tag=ba489a60'
DBG:mid_registrar:prepare_forward: Call-ID:
'187541_mobile-rel120YzljYzJjNjcwOGJlYmYxOTU0MDM1NDBlMDJiZDQyNjg'
DBG:mid_registrar:prepare_forward: Contact:
';+sip.i
nstance=""'
DBG:mid_registrar:prepare_forward: registering ptr 0x7f6efc9c6b78 on
TMCB_REQUEST_FWDED ...
DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_FWDED,
mri=0x7f6efc9c6b78 ...
DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_DELETED,
mri=0x7f6efc9c6b78 ...
[187541_mobile-rel120YzljYzJjNjcwOGJlYmYxOTU0MDM1NDBlMDJiZDQyNjg]
[from_vex] [REGISTER sin totag][mid_registrar_save]: Retorna valor 1
[187541_mobile-rel120YzljYzJjNjcwOGJlYmYxOTU0MDM1NDBlMDJiZDQyNjg]
[from_vex] [REGISTER sin totag][mid_registrar_save]:
sip:d2@dom1.company.com:5061 salvado en tabla location
DBG:mid_registrar:mid_reg_req_fwded: msg expires: '300'
DBG:mid_registrar:calc_contact_expires: expires: 300
DBG:mid_registrar:calc_ob_contact_expires: outgoing expires: 1616511318
DBG:mid_registrar:overwrite_contact_expirations: ... contact:
'sip:d2.596@192.168.0.34;rinstance=fa92ef51cba5543d;transport=tls>;+sip.in
stance=""#015' Calculated
TIMEOUT = 1616511318 (3600)
DBG:mid_registrar:replace_expires_hf: ... Exp hdr: '300'
DBG:mid_registrar:mid_reg_req_fwded: trimming all Contact URIs into one...
DBG:mid_registrar:calc_contact_expires: expires: 300
DBG:mid_registrar:trim_to_single_contact: deleting Contact
';+sip.i
nstance=""'
DBG:mid_registrar:trim_to_single_contact: inserting new Contact
''
DBG:mid_registrar:calc_contact_expires: expires: 300
DBG:mid_registrar:mid_reg_req_fwded: REQ FORWARDED TO
'sip:dom1.company.com:5061' (obp: sip:192.141.XXX.94:5060), expires=3600

OUTGOING REGISTER
Contact: .
Expires: 3600.

2. Outgoing_expire fail
But for the Second REGISTER (from the PUSH SERVER)
INCOMING REGISTER
Contact:
;+sip.instance="";reg-id=1;expires=300
Expires: 300.

DBG:mid_registrar:mid_reg_save: saving to location...
DBG:mid_registrar:prepare_forward: from:
';tag=0f1c2a07'
DBG:mid_registrar:prepare_forward: Call-ID:
'y12mg-n8ka5jro_j-bhqn...@216.93.xxx.121'
DBG:mid_registrar:prepare_forward: Contact:
';+sip.instance="";reg-id=1;expires=300'
DBG:mid_registrar:prepare_forward: registering ptr 0x7f6efc9b60d0 on
TMCB_REQUEST_FWDED ...
DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_FWDED,
mri=0x7f6efc9b60d0 ...
DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_DELETED,
mri=0x7f6efc9b60d0 ...
[y12mg-n8ka5jro_j-bhqn...@216.93.xxx.121] [from_vex] [REGISTER sin
totag][mid_registrar_save]: Retorna valor 1
[y12mg-n8ka5jro_j-bhqn...@216.93.xxx.121] [from_vex] [REGISTER sin
totag][mid_registrar_save]: sip:d2@dom1.company.com:5061 salvado en
tabla location
DBG:mid_registrar:mid_reg_req_fwded: msg expires: '300'
DBG:mid_registrar:calc_contact_expires: expires: 300
DBG:mid_registrar:calc_ob_contact_expires: outgoing expires: 1616511408
DBG:mid_registrar:overwrite_contact_expirations: ... contact:
'sip:d2@216.93.xxx.120:5060;transport=TLS>;+sip.instance="";reg-id=1;expires=300#015' Calculated
TIMEOUT = 1616511408 (3600)
DBG:mid_registrar:replace_expires_ct_param: replacing expires, ct
'sip:d2@216.93.xxx.120:5060;transport=TLS' '300' with 3600,
0x7f6f3cf1e5b0 -> 0x7f6f3cf1e861 (0x7f6f3cf1e6d9)
DBG:mid_registrar:mid_reg_req_fwded: trimming all Contact URIs into one...
DBG:mid_registrar:calc_contact_expires: expires: 300
DBG:mid_registrar:trim_to_single_contact: deleting Contact
';+sip.instance="";reg-id=1;expires=300'
DBG:mid_registrar:trim_to_single_contact: inserting new Contact
''

Re: [OpenSIPS-Users] Mid_Registrar outgoing_expire issue (Bug?)

2021-03-23 Thread Ricardo Martinez
Hi.
I’m still unable to understand why the REGISTER is not using the
outgoing_expire.
First.   It's weird because according to the debug seems to change the
outgoing_expire to 3600 but when I check the outgoing REGISTER from the
MID_REGISTRAR still has the Expire Header = 300.
One thing I noticed is for the first REGISTER (the one the
outgoing_expires works) it changes the Expires header ok, this REGISTER
does not have contact expire header, but for the second REGISTER.. which
has Expire header and expire contact header.. seems to apply only the
"expire in the contact header"
(DBG:mid_registrar:replace_expires_ct_param).
These are the debugs...
Is this a bug? Or maybe I'm missing something?

1. Outgoing Expire  OK
INCOMING REGISTER
Contact:
sip:d2.596@192.168.0.34;rinstance=fa92ef51cba5543d;transport=tls>;+sip.ins
tance="
Expires: 300.

DBG:mid_registrar:mid_reg_save: saving to location...
DBG:mid_registrar:prepare_forward: from: '"Ricardo
Martinez";tag=ba489a60'
DBG:mid_registrar:prepare_forward: Call-ID:
'187541_mobile-rel120YzljYzJjNjcwOGJlYmYxOTU0MDM1NDBlMDJiZDQyNjg'
DBG:mid_registrar:prepare_forward: Contact:
';+sip.i
nstance=""'
DBG:mid_registrar:prepare_forward: registering ptr 0x7f6efc9c6b78 on
TMCB_REQUEST_FWDED ...
DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_FWDED,
mri=0x7f6efc9c6b78 ...
DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_DELETED,
mri=0x7f6efc9c6b78 ...
[187541_mobile-rel120YzljYzJjNjcwOGJlYmYxOTU0MDM1NDBlMDJiZDQyNjg]
[from_vex] [REGISTER sin totag][mid_registrar_save]: Retorna valor 1
[187541_mobile-rel120YzljYzJjNjcwOGJlYmYxOTU0MDM1NDBlMDJiZDQyNjg]
[from_vex] [REGISTER sin totag][mid_registrar_save]:
sip:d2@dom1.company.com:5061 salvado en tabla location
DBG:mid_registrar:mid_reg_req_fwded: msg expires: '300'
DBG:mid_registrar:calc_contact_expires: expires: 300
DBG:mid_registrar:calc_ob_contact_expires: outgoing expires: 1616511318
DBG:mid_registrar:overwrite_contact_expirations: ... contact:
'sip:d2.596@192.168.0.34;rinstance=fa92ef51cba5543d;transport=tls>;+sip.in
stance=""#015' Calculated
TIMEOUT = 1616511318 (3600)
DBG:mid_registrar:replace_expires_hf: ... Exp hdr: '300'
DBG:mid_registrar:mid_reg_req_fwded: trimming all Contact URIs into one...
DBG:mid_registrar:calc_contact_expires: expires: 300
DBG:mid_registrar:trim_to_single_contact: deleting Contact
';+sip.i
nstance=""'
DBG:mid_registrar:trim_to_single_contact: inserting new Contact
''
DBG:mid_registrar:calc_contact_expires: expires: 300
DBG:mid_registrar:mid_reg_req_fwded: REQ FORWARDED TO
'sip:dom1.company.com:5061' (obp: sip:192.141.XXX.94:5060), expires=3600

OUTGOING REGISTER
Contact: .
Expires: 3600.

2. Outgoing_expire fail
But for the Second REGISTER (from the PUSH SERVER)
INCOMING REGISTER
Contact:
;+sip.instance="";reg-id=1;expires=300
Expires: 300.

DBG:mid_registrar:mid_reg_save: saving to location...
DBG:mid_registrar:prepare_forward: from:
';tag=0f1c2a07'
DBG:mid_registrar:prepare_forward: Call-ID:
'y12mg-n8ka5jro_j-bhqn...@216.93.xxx.121'
DBG:mid_registrar:prepare_forward: Contact:
';+sip.instance="";reg-id=1;expires=300'
DBG:mid_registrar:prepare_forward: registering ptr 0x7f6efc9b60d0 on
TMCB_REQUEST_FWDED ...
DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_FWDED,
mri=0x7f6efc9b60d0 ...
DBG:mid_registrar:prepare_forward: registering for TMCB_RESPONSE_DELETED,
mri=0x7f6efc9b60d0 ...
[y12mg-n8ka5jro_j-bhqn...@216.93.xxx.121] [from_vex] [REGISTER sin
totag][mid_registrar_save]: Retorna valor 1
[y12mg-n8ka5jro_j-bhqn...@216.93.xxx.121] [from_vex] [REGISTER sin
totag][mid_registrar_save]: sip:d2@dom1.company.com:5061 salvado en
tabla location
DBG:mid_registrar:mid_reg_req_fwded: msg expires: '300'
DBG:mid_registrar:calc_contact_expires: expires: 300
DBG:mid_registrar:calc_ob_contact_expires: outgoing expires: 1616511408
DBG:mid_registrar:overwrite_contact_expirations: ... contact:
'sip:d2@216.93.xxx.120:5060;transport=TLS>;+sip.instance="";reg-id=1;expires=300#015' Calculated
TIMEOUT = 1616511408 (3600)
DBG:mid_registrar:replace_expires_ct_param: replacing expires, ct
'sip:d2@216.93.xxx.120:5060;transport=TLS' '300' with 3600,
0x7f6f3cf1e5b0 -> 0x7f6f3cf1e861 (0x7f6f3cf1e6d9)
DBG:mid_registrar:mid_reg_req_fwded: trimming all Contact URIs into one...
DBG:mid_registrar:calc_contact_expires: expires: 300
DBG:mid_registrar:trim_to_single_contact: deleting Contact
';+sip.instance="";reg-id=1;expires=300'
DBG:mid_registrar:trim_to_single_contact: inserting new Contact
''
DBG:mid_registrar:calc_contact_expires: expires: 300
DBG:mid_registrar:mid_reg_req_fwded: REQ FORWARDED TO
'sip:dom1.company.com:5061' (obp: sip:192.141.XXX.94:5060), expires=3600

OUTGOING REGISTER
Contact: 
Expires: 300

Could this be a bug?

Hope someone could point me in the right direction.
Best Regards,
Ricardo Martinez

De: Ricardo Martinez 
Enviado el: viernes, 19 de marzo de 2021 16:03
Para: 'OpenSIPS users mailling list' 
Asunto: Mid_Registrar 

[OpenSIPS-Users] Mid_Registrar outgoing_expire issue

2021-03-19 Thread Ricardo Martinez
Hi.

I’m facing two problems with my mid_registrar module scenario.

The scenario is as follows:



UAC --- MID_REGISTRAR - PBX



When a REGISTER came from the UAC to MID_REGISTRAR it has a header
Expires:300

I have set the

modparam("mid_registrar", "outgoing_expires", 3600)



UAC - MID_REGISTRAR --- PBX

REG

   Contact: (no expire)

  Expires: 300

 REG

Contact: ( no expire)

Expires: 3600



Seems ok!..

But in another scenario I have:





UAC - MID_REGISTRAR --- PBX

REG

   Contact: (expire=600)

  Expires: 600

 REG

Contact: (no expire)

*Expires: 600*





I’m not getting why the mid_registrar does not modified the outgoing
Expires to the PBX to 3600.  Anyone has a clue about this?

Part of the configuration is:

### MID_REGISTRAR module

loadmodule "mid_registrar.so"

modparam("mid_registrar", "mode", 2) /* 0 = mirror / 1 = ct / 2 = AoR */

modparam("mid_registrar", "outgoing_expires", 3600)

modparam("mid_registrar", "contact_id_insertion", "ct-param")

modparam("mid_registrar", "max_contacts", 6)

modparam("mid_registrar", "received_avp", "$avp(rcv)")

modparam("mid_registrar", "extra_contact_params_avp",
"$avp(extra_ct_params)")



if (( is_method("REGISTER")) && (!has_totag())) {

mid_registrar_save("location","M");

switch($retcode) {

case 1:

$du = $var(r_pbx_sethost);

xlog("[$ci] [from_vex] [REGISTER sin
totag][mid_registrar_save]: Retorna valor 1\n");

xlog("[$ci] [from_vex] [REGISTER sin
totag][mid_registrar_save]: $fu salvado en tabla location\n");

t_relay(,$var(r_pbx_send));

xlog("[$ci] [from_vex] [REGISTER sin
totag][mid_registrar_save]: Redirecting $rm to destination
[$var(r_pbx)]\n");

exit;

case 2:

xlog("[$ci] [from_vex] [REGISTER sin
totag][mid_registrar_save]: Retorna valor 2\n");

xlog("[$ci] [from_vex] [REGISTER sin
totag][mid_registrar_save]: Absorbiendo $rm from $si to domain $rd\n");

break;

default:

xlog("[$ci] [from_vex] [REGISTER sin
totag][mid_registrar_save]: Retorna valor -2\n");

xlog("[$ci] [from_vex] [REGISTER sin
totag][mid_registrar_save]: SECURITY: No se puede salvar localmente el
registro desde [$si] a dominio [$rd]\n");

send_reply(503,"MID Register Failed");

exit;

}

}






Beside of that subsequest REGISTER from that endpoint are route to the PBX
instead of absorve the REGISTERS.  Could this be related??





Thanks!

*Ricardo*
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar local contact table

2020-11-18 Thread Arsen Semenov
Hi,

try opensips-cli -x mi ul_dump
or check you location table in case you use db as a back-end storage

On Wed, Nov 18, 2020 at 6:44 PM Ricardo Martinez 
wrote:

> Hi.
>
> I’m using the mid_registrar module as a front end for my local PBX
> registrar Service.
>
> So far I was able to store the contact for a  UAC before it goes to the
> REGISTRAR server.
>
> Is there a way to display or search the contacts stored in that table
> through the console?
>
>
>
> Thanks,
>
> *Ricardo Martinez.-*
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>


-- 
Arsen Semenov
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid_registrar local contact table

2020-11-18 Thread Ricardo Martinez
Hi.

I’m using the mid_registrar module as a front end for my local PBX
registrar Service.

So far I was able to store the contact for a  UAC before it goes to the
REGISTRAR server.

Is there a way to display or search the contacts stored in that table
through the console?



Thanks,

*Ricardo Martinez.-*
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar load balance

2020-11-13 Thread David Villasmil
You should be able to use the dispatcher module just before relaying. Have
you tried that?

On Fri, 13 Nov 2020 at 13:09, Andy Kama  wrote:

> Hi Guys
>
> is it possible to load balance with mid_registrar?
> perhaps setting multiple $ru in this part
>
>if (is_method("REGISTER")) {
> mid_registrar_save("location");
> switch ($retcode) {
> case 1:
> xlog("forwarding REGISTER to main registrar ($$ci=$ci)\n");
> $ru = "sip:1.2.3.4:5060";
> t_relay();
> break;
> case 2:
> xlog("absorbing REGISTER! ($$ci=$ci)\n");
> break;
> default:
> xlog("failed to save registration! ($$ci=$ci)\n");
> }
>
> exit;
> }
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-- 
Regards,

David Villasmil
email: david.villasmil.w...@gmail.com
phone: +34669448337
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar load balance

2020-11-13 Thread Alain Bieuzent
Hi Andy,

 

I’m doing it manually :

 

   if (is_method("REGISTER"))

    {

    fix_nated_contact();

    mid_registrar_save("location");

    switch ($retcode)

    {

    case 1:

    if (!cache_fetch("local", "$ci", $avp(IP)))

    {

    avp_db_query("SELECT destination FROM 
lbsip_sbc_did_3_0.dispatcher where setid = 1 and state = 0 ORDER BY RAND() 
LIMIT 1", "$avp(IP)");

    if ($rc < 0)

    {

    xlog("L_WARN", 
"$ci|REGISTER|Mysql query failed or no result, droping call with a 500");

    sl_send_reply(500, "internal 
Server error");

    exit;

    }

    cache_store("local", "$ci", "$avp(IP)", 
3600);

    }

    else

    {

    $var(IP) = $(avp(IP){uri.host});

    if (!ds_is_in_list("$var(IP)",5060,1, 
,1))

    {

    xlog("L_INFO", 
"$ci|REGISTER|Destination in cache is unreachable forwarding query to another 
astsipac)");

    avp_db_query("SELECT 
destination FROM lbsip_sbc_did_3_0.dispatcher where setid = 1 and state = 0 
ORDER BY RAND() LIMIT 1", "$avp(IP)");

 

    if ($rc < 0)

    {

    xlog("L_WARN", 
"$ci|REGISTER|Mysql query failed or no result, droping call with a 500");

    sl_send_reply(500, 
"internal Server error");

    exit;

    }

    cache_store("local", "$ci", "$avp(IP)", 
3600);

    xlog("L_INFO", "$ci|REGISTER|new 
destination is $avp(IP)");

    }

    }

    $ru = $avp(IP);

    xlog("L_INFO", "$ci|forwarding REGISTER from: 
$ct - $tU:$si to: $ru");

    cache_store("local", "$ci", "$avp(IP)", 3600);

    t_relay();

    break;

 

    case 2:

    xlog("L_INFO", "absorbing REGISTER for $tU ");

        break;

 

    default:

    xlog("L_INFO", "failed to save registration for 
$tU");

    }

 

De : Users  au nom de Andy Kama 

Répondre à : OpenSIPS users mailling list 
Date : vendredi 13 novembre 2020 à 14:12
À : 
Objet : [OpenSIPS-Users] mid_registrar load balance

 

Hi Guys

 

is it possible to load balance with mid_registrar?

perhaps setting multiple $ru in this part

 

   if (is_method("REGISTER")) {
mid_registrar_save("location");
switch ($retcode) {
case 1:
xlog("forwarding REGISTER to main registrar ($$ci=$ci)\n");
$ru = "sip:1.2.3.4:5060";
t_relay();
break;
case 2:
xlog("absorbing REGISTER! ($$ci=$ci)\n");
break;
default:
xlog("failed to save registration! ($$ci=$ci)\n");
}

exit;
}

___ Users mailing list 
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users 

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid_registrar load balance

2020-11-13 Thread Andy Kama
Hi Guys

is it possible to load balance with mid_registrar?
perhaps setting multiple $ru in this part

   if (is_method("REGISTER")) {
mid_registrar_save("location");
switch ($retcode) {
case 1:
xlog("forwarding REGISTER to main registrar ($$ci=$ci)\n");
$ru = "sip:1.2.3.4:5060";
t_relay();
break;
case 2:
xlog("absorbing REGISTER! ($$ci=$ci)\n");
break;
default:
xlog("failed to save registration! ($$ci=$ci)\n");
}

exit;
}
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar and topology_hiding

2020-08-05 Thread Slava Bendersky via Users
Hello Liviu, 
I am working on setup mid_registrar and topology_hiding and having issue with 
retransmissions and RE-INVITE are failing to route even dialog in place and 
have to use something like $ru = $tu; then location search, but even this is 
not working 100%. I tried use C and U flags. 
I can share my config with cluster support, but really need you help with this. 
I have open ticket while back for RE-INVITE issue #2067. 



Slava. 


From: "volga629"  
To: "OpenSIPS users mailling list"  
Sent: Wednesday, August 5, 2020 9:23:49 AM 
Subject: Re: [OpenSIPS-Users] mid_registrar and topology_hiding 




From: "Yohann Poilvert"  
To: "OpenSIPS users mailling list"  
Sent: Wednesday, August 5, 2020 5:28:08 AM 
Subject: Re: [OpenSIPS-Users] mid_registrar and topology_hiding 

Hello Liviu ! 

Great news ! 

Have you a full config example ? 
I think it missed "ctid" in the INVITE contact on my side... 



[ https://twitter.com/SegLoad ] 
[ https://www.linkedin.com/in/yohann-poilvert-a7ba84117/ ]  

Yohann Poilvert 

0686739335 
[ mailto:y.poilv...@geekinfo.fr | y.poilv...@geekinfo.fr ] 
[ https://www.geekinfo.fr/ | https://www.geekinfo.fr/ ] 


De: "Liviu Chircu"  
À: "users"  
Envoyé: Mercredi 5 Août 2020 10:20:13 
Objet: Re: [OpenSIPS-Users] mid_registrar and topology_hiding 

On 05.08.2020 11:11, Yohann Poilvert wrote: 



Is mid_registrar and topology_hiding are now compatible between them ? 
Inbound calls are ok but not outbound... (Need auth) 




Hey, Yohann! 

Yes, since mid-registrar mangles the REGISTER contacts, while topology_hiding 
mangles the INVITE/200 OK contacts. They should play together well. 

Regards, 
-- 
Liviu Chircu [ http://www.twitter.com/liviuchircu | www.twitter.com/liviuchircu 
] | [ http://www.opensips-solutions.com/ | www.opensips-solutions.com ] 
OpenSIPS Summit 2020 Distributed [ 
http://www.opensips.org/events/Summit-2020Distributed | 
www.opensips.org/events/Summit-2020Distributed ] 

___ 
Users mailing list 
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users 

___ 
Users mailing list 
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users 

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar and topology_hiding

2020-08-05 Thread Slava Bendersky via Users



From: "Yohann Poilvert"  
To: "OpenSIPS users mailling list"  
Sent: Wednesday, August 5, 2020 5:28:08 AM 
Subject: Re: [OpenSIPS-Users] mid_registrar and topology_hiding 

Hello Liviu ! 

Great news ! 

Have you a full config example ? 
I think it missed "ctid" in the INVITE contact on my side... 



[ https://twitter.com/SegLoad ] 
[ https://www.linkedin.com/in/yohann-poilvert-a7ba84117/ ]  

Yohann Poilvert 

0686739335 
[ mailto:y.poilv...@geekinfo.fr | y.poilv...@geekinfo.fr ] 
[ https://www.geekinfo.fr/ | https://www.geekinfo.fr/ ] 


De: "Liviu Chircu"  
À: "users"  
Envoyé: Mercredi 5 Août 2020 10:20:13 
Objet: Re: [OpenSIPS-Users] mid_registrar and topology_hiding 

On 05.08.2020 11:11, Yohann Poilvert wrote: 



Is mid_registrar and topology_hiding are now compatible between them ? 
Inbound calls are ok but not outbound... (Need auth) 




Hey, Yohann! 

Yes, since mid-registrar mangles the REGISTER contacts, while topology_hiding 
mangles the INVITE/200 OK contacts. They should play together well. 

Regards, 
-- 
Liviu Chircu [ http://www.twitter.com/liviuchircu | www.twitter.com/liviuchircu 
] | [ http://www.opensips-solutions.com/ | www.opensips-solutions.com ] 
OpenSIPS Summit 2020 Distributed [ 
http://www.opensips.org/events/Summit-2020Distributed | 
www.opensips.org/events/Summit-2020Distributed ] 

___ 
Users mailing list 
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users 

___ 
Users mailing list 
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users 
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar and topology_hiding

2020-08-05 Thread Yohann Poilvert
Hello Liviu ! 

Great news ! 

Have you a full config example ? 
I think it missed "ctid" in the INVITE contact on my side... 



[ https://twitter.com/SegLoad ] 

[ https://www.linkedin.com/in/yohann-poilvert-a7ba84117/ ]  



Yohann Poilvert 

[ tel:0686739335 | 0686739335 ] 
[ mailto:y.poilv...@geekinfo.fr | y.poilv...@geekinfo.fr ] 
[ https://www.geekinfo.fr/ | https://www.geekinfo.fr/ ] 


De: "Liviu Chircu"  
À: "users"  
Envoyé: Mercredi 5 Août 2020 10:20:13 
Objet: Re: [OpenSIPS-Users] mid_registrar and topology_hiding 

On 05.08.2020 11:11, Yohann Poilvert wrote: 



Is mid_registrar and topology_hiding are now compatible between them ? 
Inbound calls are ok but not outbound... (Need auth) 




Hey, Yohann! 

Yes, since mid-registrar mangles the REGISTER contacts, while topology_hiding 
mangles the INVITE/200 OK contacts. They should play together well. 

Regards, 
-- 
Liviu Chircu [ http://www.twitter.com/liviuchircu | www.twitter.com/liviuchircu 
] | [ http://www.opensips-solutions.com/ | www.opensips-solutions.com ] 
OpenSIPS Summit 2020 Distributed [ 
http://www.opensips.org/events/Summit-2020Distributed | 
www.opensips.org/events/Summit-2020Distributed ] 

___ 
Users mailing list 
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users 
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar and topology_hiding

2020-08-05 Thread Liviu Chircu

On 05.08.2020 11:11, Yohann Poilvert wrote:

Is mid_registrar and topology_hiding are now compatible between them ?
Inbound calls are ok but not outbound... (Need auth)


Hey, Yohann!

Yes, since mid-registrar mangles the REGISTER contacts, while 
topology_hiding mangles the INVITE/200 OK contacts.  They should play 
together well.


Regards,

--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com

OpenSIPS Summit 2020 Distributed
  www.opensips.org/events/Summit-2020Distributed

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid_registrar and topology_hiding

2020-08-05 Thread Yohann Poilvert
Hi all. 

Is mid_registrar and topology_hiding are now compatible between them ? 
Inbound calls are ok but not outbound... (Need auth) 

Thank's 



[ https://twitter.com/SegLoad ] 

[ https://www.linkedin.com/in/yohann-poilvert-a7ba84117/ ]  



Yohann Poilvert 

[ tel:0686739335 | 0686739335 ] 
[ mailto:y.poilv...@geekinfo.fr | y.poilv...@geekinfo.fr ] 
[ https://www.geekinfo.fr/ | https://www.geekinfo.fr/ ] 
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar - AOR mode - Disable parallel forking.

2020-04-02 Thread Liviu Chircu

On 02.04.2020 11:16, Alain Bieuzent wrote:


The issue (in my case) that in case of asterisk box send a call to 
janus (via opensips mid_registrar module), the call is forked to the 2 
janus endpoints in parallel


I want to limit the incoming to only the last endpoint registered.

Is there a parameter to limit this ?


Hi, Alain!

This is possible starting with version 3.1, where mid_registrar_save() 
[1] was enhanced with the "cNN" flag.


Best regards,

[1]: 
https://opensips.org/docs/modules/3.1.x/mid_registrar.html#func_mid_registrar_save


--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com

OpenSIPS Summit, Amsterdam, May 2020
  www.opensips.org/events

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid_registrar - AOR mode - Disable parallel forking.

2020-04-02 Thread Alain Bieuzent
Hi,

 

I’m trying to use mid_registrar module between a janus gateway and asterisk box.

I have the same janus endpoints registered 2 time opensips mid_registrar module 
(so only 1 with opensips IP forward to asterisk box)

 

The issue (in my case) that in case of asterisk box send a call to janus (via 
opensips mid_registrar module), the call is forked to the 2 janus endpoints in 
parallel

 

I want to limit the incoming to only the last endpoint registered.

 

Is there a parameter to limit this ?

 

Thanks 

 

Alain

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar question

2019-09-28 Thread Igor Olhovskiy
Problem is phone is not deletes it registration. Problem is in not consistent 
timer behavior of some phones. Fully complies to RFC, but breakes middle logic.

On Sep 28 2019, at 12:26 am, Alexey Vasilyev  wrote:
> Hi Igor,
>
> If the phone lost registration, it should also be deleted from mid_registrar. 
> With nathelper, e.g. So next REGISTER should be forwarded, not consumed. But 
> it would be really good solution to have feature like this 
> https://github.com/OpenSIPS/opensips/issues/1769 
> (https://link.getmailspring.com/link/657df0db-1157-4392-83a9-69c4ff026...@getmailspring.com/0?redirect=https%3A%2F%2Fgithub.com%2FOpenSIPS%2Fopensips%2Fissues%2F1769=dXNlcnNAbGlzdHMub3BlbnNpcHMub3Jn)
> In the case of UDP, may be it make sense to use simple mirroring mode with 
> nathelper pings.
>
> -
> Alexey Vasilyev
> alexei.vasil...@gmail.com 
> (https://link.getmailspring.com/link/657df0db-1157-4392-83a9-69c4ff026...@getmailspring.com/1?redirect=mailto%3Aalexei.vasilyev%40gmail.com=dXNlcnNAbGlzdHMub3BlbnNpcHMub3Jn)
>
>
>
> > 27 Sep 2019, в 22:58, Igor Olhovskiy [via OpenSIPS (Open SIP Server)] 
> >  > (https://link.getmailspring.com/link/657df0db-1157-4392-83a9-69c4ff026...@getmailspring.com/2?redirect=mailto%3Aml%2Bs1449251n7616299h3%40n2.nabble.com=dXNlcnNAbGlzdHMub3BlbnNpcHMub3Jn)>
> >  написал(а):
> > Enpoint B also have 3600 expiry time. So, 1000 + 2600 = 3600.
> > But you got the point.
> >
> >
> > Actually I faced more interesting issue a bit later, maybe actually it was 
> > the reason.
> > Only 1 phone involved.
> >
> > Time 0 -> Enpoint A -> mid_registrar -> upstream_registrar (expires 3600)
> > Time 1000 -> Enpoint A -> mid_registrar (just consume registration)
> >
> > Time 3600 -> NOTHING. upstream_registrar expires.
> >
> > 1000 sec GAP
> >
> > Time 4600 -> Enpoint A -> mid_registrar -> upstream_registrar.
> >
> > Yes, looks like non logic behaviour, but some of my Yealink endpoints 
> > sometimes just refreshes registration (maybe TCP network loss or so) in a 
> > middle of expires period and than - just wait for full expire time to 
> > re-register
> > пт, 27 сент. 2019 г. в 18:53, Liviu Chircu <[hidden email] 
> > (x-msg://17/user/SendEmail.jtp?type=node=7616299=0)>:
> > > Hi, Igor!
> > >
> > > Correct me if I'm wrong, but doesn't endpoint B think it's registered
> > > for another 1000 seconds at step 4) in your example?
> > >
> > > Anyway, logically speaking, on step 2), the mid-registrar should forward
> > > the call to main reg, since there is no guarantee that any of the 
> > > endpoints
> > > will send a binding refresh register within the next 2600 seconds. For all
> > > it's worth, A could lose its connection and B could wait between
> > > 2601 to 3599 before re-registering, which would temporarily cause
> > > registration
> > > state to be incorrectly lost on the backend layer.
> > >
> > > Let me set up a test for this scenario and I will come back to you with
> > > my findings.
> > >
> > > Regards,
> > > Liviu Chircu
> > > OpenSIPS Developer
> > > http://www.opensips-solutions.com (http://www.opensips-solutions.com/)
> > >
> > > On 27.09.2019 18:18, Igor Olhovskiy wrote:
> > > > but Enpoint B still thinks it's registered at least 2599 seconds.
> > >
> > > ___
> > > Users mailing list
> > > [hidden email] (x-msg://17/user/SendEmail.jtp?type=node=7616299=1)
> > > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >
> >
> >
> >
> > --
> > Best regards,
> > Igor
> >
> >
> >
> > ___
> > Users mailing list
> > [hidden email] (x-msg://17/user/SendEmail.jtp?type=node=7616299=2)
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users 
> > (https://link.getmailspring.com/link/657df0db-1157-4392-83a9-69c4ff026...@getmailspring.com/3?redirect=http%3A%2F%2Flists.opensips.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fusers=dXNlcnNAbGlzdHMub3BlbnNpcHMub3Jn)
> >
> >
> > If you reply to this email, your message will be added to the discussion 
> > below:
> > http://opensips-open-sip-server.1449251.n2.nabble.com/mid-registrar-question-tp7616290p7616299.html
> >  
> > (https://link.getmailspring.com/link/657df0db-1157-4392-83a9-69c4ff026...@getmailspring.com/4?redirect=http%3A%2F%2Fopensips-open-sip-server.1449251.n2.nabble.com%2Fmid-registrar-question-tp7616290p7616299.html=dXNlcnNAbGlzdHMub3BlbnNpcHMub3Jn)
> >
> > To start a new topic under OpenSIPS - Users, email 
> > ml+s1449251n1449235...@n2.nabble.com 
> > (https://link.getmailspring.com/link/657df0db-1157-4392-83a9-69c4ff026...@getmailspring.com/5?redirect=mailto%3Aml%2Bs1449251n1449235h19%40n2.nabble.com=dXNlcnNAbGlzdHMub3BlbnNpcHMub3Jn)
> > To unsubscribe from OpenSIPS - Users, click here 
> > 

Re: [OpenSIPS-Users] mid_registrar question

2019-09-27 Thread Alexey Vasilyev
Hi Igor,

If the phone lost registration, it should also be deleted from mid_registrar. 
With nathelper, e.g. So next REGISTER should be forwarded, not consumed. But it 
would be really good solution to have feature like this 
https://github.com/OpenSIPS/opensips/issues/1769 

In the case of UDP, may be it make sense to use simple mirroring mode with 
nathelper pings.

-
Alexey Vasilyev
alexei.vasil...@gmail.com 



> 27 Sep 2019, в 22:58, Igor Olhovskiy [via OpenSIPS (Open SIP Server)] 
>  > написал(а):
> 
> Enpoint B also have 3600 expiry time. So, 1000 + 2600 = 3600.
> But you got the point.
> 
> Actually I faced more interesting issue a bit later, maybe actually it was 
> the reason.
> Only 1 phone involved.
> Time 0   ->  Enpoint A -> mid_registrar -> upstream_registrar (expires 
> 3600)
> Time 1000 ->  Enpoint A -> mid_registrar (just consume registration)
> Time 3600 -> NOTHING. upstream_registrar expires.
> 1000 sec GAP
> Time 4600 -> Enpoint A -> mid_registrar -> upstream_registrar.
> 
> Yes, looks like non logic behaviour, but some of my Yealink endpoints 
> sometimes just refreshes registration (maybe TCP network loss or so) in a 
> middle of expires period and than - just wait for full expire time to 
> re-register
> 
> пт, 27 сент. 2019 г. в 18:53, Liviu Chircu <[hidden email] 
> >:
> Hi, Igor!
> 
> Correct me if I'm wrong, but doesn't endpoint B think it's registered
> for another 1000 seconds at step 4) in your example?
> 
> Anyway, logically speaking, on step 2), the mid-registrar should forward
> the call to main reg, since there is no guarantee that any of the endpoints
> will send a binding refresh register within the next 2600 seconds.  For all
> it's worth, A could lose its connection and B could wait between
> 2601 to 3599 before re-registering, which would temporarily cause 
> registration
> state to be incorrectly lost on the backend layer.
> 
> Let me set up a test for this scenario and I will come back to you with 
> my findings.
> 
> Regards,
> 
> Liviu Chircu
> OpenSIPS Developer
> http://www.opensips-solutions.com 
> 
> On 27.09.2019 18:18, Igor Olhovskiy wrote:
> > but Enpoint B still thinks it's registered at least 2599 seconds.
> 
> ___
> Users mailing list
> [hidden email] 
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users 
> 
> 
> 
> -- 
> Best regards,
> Igor
> 
> ___ 
> Users mailing list 
> [hidden email]  
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users 
> 
> 
> 
> If you reply to this email, your message will be added to the discussion 
> below:
> http://opensips-open-sip-server.1449251.n2.nabble.com/mid-registrar-question-tp7616290p7616299.html
>  
> 
> To start a new topic under OpenSIPS - Users, email 
> ml+s1449251n1449235...@n2.nabble.com 
>  
> To unsubscribe from OpenSIPS - Users, click here 
> .
> NAML 
> 
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar question

2019-09-27 Thread Igor Olhovskiy
Enpoint B also have 3600 expiry time. So, 1000 + 2600 = 3600.
But you got the point.

Actually I faced more interesting issue a bit later, maybe actually it was
the reason.
Only 1 phone involved.
Time 0   ->  Enpoint A -> mid_registrar -> upstream_registrar (expires
3600)
Time 1000 ->  Enpoint A -> mid_registrar (just consume registration)
Time 3600 -> NOTHING. upstream_registrar expires.
1000 sec GAP
Time 4600 -> Enpoint A -> mid_registrar -> upstream_registrar.

Yes, looks like non logic behaviour, but some of my Yealink endpoints
sometimes just refreshes registration (maybe TCP network loss or so) in a
middle of expires period and than - just wait for full expire time to
re-register

пт, 27 сент. 2019 г. в 18:53, Liviu Chircu :

> Hi, Igor!
>
> Correct me if I'm wrong, but doesn't endpoint B think it's registered
> for another 1000 seconds at step 4) in your example?
>
> Anyway, logically speaking, on step 2), the mid-registrar should forward
> the call to main reg, since there is no guarantee that any of the endpoints
> will send a binding refresh register within the next 2600 seconds.  For all
> it's worth, A could lose its connection and B could wait between
> 2601 to 3599 before re-registering, which would temporarily cause
> registration
> state to be incorrectly lost on the backend layer.
>
> Let me set up a test for this scenario and I will come back to you with
> my findings.
>
> Regards,
>
> Liviu Chircu
> OpenSIPS Developer
> http://www.opensips-solutions.com
>
> On 27.09.2019 18:18, Igor Olhovskiy wrote:
> > but Enpoint B still thinks it's registered at least 2599 seconds.
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>


-- 
Best regards,
Igor
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar question

2019-09-27 Thread Liviu Chircu

Hi, Igor!

Correct me if I'm wrong, but doesn't endpoint B think it's registered
for another 1000 seconds at step 4) in your example?

Anyway, logically speaking, on step 2), the mid-registrar should forward
the call to main reg, since there is no guarantee that any of the endpoints
will send a binding refresh register within the next 2600 seconds.  For all
it's worth, A could lose its connection and B could wait between
2601 to 3599 before re-registering, which would temporarily cause 
registration

state to be incorrectly lost on the backend layer.

Let me set up a test for this scenario and I will come back to you with 
my findings.


Regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 27.09.2019 18:18, Igor Olhovskiy wrote:

but Enpoint B still thinks it's registered at least 2599 seconds.


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid_registrar question

2019-09-27 Thread Igor Olhovskiy
Hi!

I'm using mid_registrar in mode 2 with default_expires = 3600
Have a following issue.
In a case of 2 enpoints registers with expires = 3600 (and actually 
re-registers in 3599) in a case of 1 phone is down, contact expires on upstream 
registrar.
Like following
Time 0 - > Enpoint A -> mid_registrar -> upstream_registrar (expires 3600)
Time 1000 -> Enpoint B -> mid_registrar (not sending any to upstream, was 
registered previously)
Time 3599 -> Enpoint A dies
Time 3600 -> upstream_registrar - contact expired (no register), but Enpoint B 
still thinks it's registered at least 2599 seconds.

What is a workaround in this case could be?
opensips 2.4.6

Thanks!___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar mode=0 expires problem

2019-03-22 Thread Liviu Chircu

Hi, Jeff!

This should be fixed now on master and 2.4 -- good catch!

Regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 20.03.2019 12:53, Liviu Chircu wrote:


Ok, happened on first try :)  Working on a fix.

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com
On 20.03.2019 12:26, Liviu Chircu wrote:


Hello, Jeff!

Looks like a bug - let me try to reproduce it first, then I'll return 
with some findings.


Cheers,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com
On 19.03.2019 03:12, Jeff Pyle wrote:

Hello,

This is on OpenSIPS 2.4.5 from the apt.opensips.org 
 repo.


I'm running mid_registrar in mode=0 with all parameters default.  
The REGISTER message comes from the client towards OpenSIPS with an 
expires=3600 in the Contact.  I run mid_registrar_save("location") 
and relay the REGISTER upstream to the main registrar with the same 
expires=3600.  The main registrar responds with a 200 OK, with an 
expires=600.  When OpenSIPS relays the 200 OK to the client, it 
rewrites the expires to 3600.  OpenSIPS hangs onto the registration 
in usrloc for 3600, but the main registrar only for 600.


Am I missing something with mid_registrar's operation, or is this a 
bug?  How do I set OpenSIPS to honor the main registrar's expires 
value for its own usrloc entry and relay that back to the client?



- Jeff


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar mode=0 expires problem

2019-03-20 Thread Liviu Chircu

Ok, happened on first try :)  Working on a fix.

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 20.03.2019 12:26, Liviu Chircu wrote:


Hello, Jeff!

Looks like a bug - let me try to reproduce it first, then I'll return 
with some findings.


Cheers,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com
On 19.03.2019 03:12, Jeff Pyle wrote:

Hello,

This is on OpenSIPS 2.4.5 from the apt.opensips.org 
 repo.


I'm running mid_registrar in mode=0 with all parameters default.  The 
REGISTER message comes from the client towards OpenSIPS with an 
expires=3600 in the Contact.  I run mid_registrar_save("location") 
and relay the REGISTER upstream to the main registrar with the same 
expires=3600. The main registrar responds with a 200 OK, with an 
expires=600.  When OpenSIPS relays the 200 OK to the client, it 
rewrites the expires to 3600.  OpenSIPS hangs onto the registration 
in usrloc for 3600, but the main registrar only for 600.


Am I missing something with mid_registrar's operation, or is this a 
bug?  How do I set OpenSIPS to honor the main registrar's expires 
value for its own usrloc entry and relay that back to the client?



- Jeff


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar mode=0 expires problem

2019-03-20 Thread Liviu Chircu

Hello, Jeff!

Looks like a bug - let me try to reproduce it first, then I'll return 
with some findings.


Cheers,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 19.03.2019 03:12, Jeff Pyle wrote:

Hello,

This is on OpenSIPS 2.4.5 from the apt.opensips.org 
 repo.


I'm running mid_registrar in mode=0 with all parameters default.  The 
REGISTER message comes from the client towards OpenSIPS with an 
expires=3600 in the Contact.  I run mid_registrar_save("location") and 
relay the REGISTER upstream to the main registrar with the same 
expires=3600.  The main registrar responds with a 200 OK, with an 
expires=600.  When OpenSIPS relays the 200 OK to the client, it 
rewrites the expires to 3600.  OpenSIPS hangs onto the registration in 
usrloc for 3600, but the main registrar only for 600.


Am I missing something with mid_registrar's operation, or is this a 
bug?  How do I set OpenSIPS to honor the main registrar's expires 
value for its own usrloc entry and relay that back to the client?



- Jeff


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid_registrar mode=0 expires problem

2019-03-18 Thread Jeff Pyle
Hello,

This is on OpenSIPS 2.4.5 from the apt.opensips.org repo.

I'm running mid_registrar in mode=0 with all parameters default.  The
REGISTER message comes from the client towards OpenSIPS with an
expires=3600 in the Contact.  I run mid_registrar_save("location") and
relay the REGISTER upstream to the main registrar with the same
expires=3600.  The main registrar responds with a 200 OK, with an
expires=600.  When OpenSIPS relays the 200 OK to the client, it rewrites
the expires to 3600.  OpenSIPS hangs onto the registration in usrloc for
3600, but the main registrar only for 600.

Am I missing something with mid_registrar's operation, or is this a bug?
How do I set OpenSIPS to honor the main registrar's expires value for its
own usrloc entry and relay that back to the client?


- Jeff
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar not updating exipres when receiving 200 ok

2018-09-20 Thread Dominic
Thanks for the reply Liviu, let me know if I can do anything to help, this
is a dev environment so I can try anything on it if it can be usefull.

Dominic

On Thu, Sep 20, 2018 at 10:11 AM Liviu Chircu  wrote:

> Hi Dominic,
>
> The 200 OK returned by OpenSIPS should definitely contain a 120s expiry
> time.  Thanks for the detailed explanation - I will look into this asap.
>
> Best regards,
>
> Liviu Chircu
> OpenSIPS Developerhttp://www.opensips-solutions.com
>
> On 20.09.2018 16:29, Dominic wrote:
>
> Hi all, I have the following setup:
> -sip device is registering to OpenSIPS setup as a mid_registrar who then
> fowards registers to asterisk once they are authenticated
> -OpenSIPS is setup in contact throttling mode with outgoing expires set to
> 3600 sec.
>
> The scenario I came accross is the following:
>
>   "Registration - OpenSips mid_registrar"
>
>┌─┐
>║"│
>└┬┘
>┌┼┐
> │   ┌┐   ┌┐
>┌┴┐  │OpenSips│   │Asterisk│
>   Alice └┘   └┘
> │REGISTER (expires 3600 sec)││
> │───>│
> │   ││
> │ 401 Unauthorized  ││
> │<───│
> │   ││
> │REGISTER (expires 3600 sec)││
> │───>│
> │   ││
> │   │ REGISTER (expires 3600 sec)│
> │   │ ───>
> │   ││
> │   │  200 OK (expires 120 sec)  │
> │   │ <───
> │   ││
> │ 200 OK (expires 3600 sec) ││
> │<───│
> │   ││
> │   ││
> │   ││
> │   ││
>   Alice ┌┐   ┌┐
>┌─┐  │OpenSips│   │Asterisk│
>║"│  └┘   └┘
>└┬┘
>┌┼┐
> │
>┌┴┐
>
>
> 1-the sip device sends a REGISTER to OpenSIPS (expires 3600)
> 2-OpenSIPS authentifies the REGISTER and sends back challenge to the sip
> device
> 3-sip devices sends authenticated REGISTER to OpenSIPS, here the expires
> would normally be changed to 3600 but in this case it was already set at
> 3600.
> 4-Asterisk receives the REGISTER, alters the expires to 120secs and
> replies 200 ok to OpenSIPS
> 5-OpenSIPS forwards the 200 ok but with 3600 sec expires.
>
> My Questions is:
> I was expecting OpenSIPS to automatically update the expires in it's
> usrloc to 120 seconds and send 120 sec in its 200 ok. Should I be doing
> something in a return route for the REGISTERs in order to update that and
> send the correct value or should opensips be doing that automatically?
> Currently I am calling mid_registrar_save("location") when I receive the
> REGISTER but doing nothing when I receive the 200 ok.
>
> Thanks in advance
> Dominic
>
>
>
> ___
> Users mailing 
> listUsers@lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar not updating exipres when receiving 200 ok

2018-09-20 Thread Liviu Chircu

Hi Dominic,

The 200 OK returned by OpenSIPS should definitely contain a 120s expiry 
time.  Thanks for the detailed explanation - I will look into this asap.


Best regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 20.09.2018 16:29, Dominic wrote:

Hi all, I have the following setup:
-sip device is registering to OpenSIPS setup as a mid_registrar who 
then fowards registers to asterisk once they are authenticated
-OpenSIPS is setup in contact throttling mode with outgoing expires 
set to 3600 sec.


The scenario I came accross is the following:

   "Registration - OpenSips mid_registrar"

┌─┐

║"│
└┬┘
┌┼┐
 │   ┌┐   ┌┐
┌┴┐  │OpenSips│   │Asterisk│
   Alice └┘   └┘
 │REGISTER (expires 3600 sec)││
 │───>│
 │   ││
 │ 401 Unauthorized  ││
 │<───│
 │   ││
 │REGISTER (expires 3600 sec)││
 │───>│
 │   ││
 │   │ REGISTER (expires 3600 sec)│
 │   │ ───>
 │   ││
 │   │  200 OK (expires 120 sec)  │
 │   │ <───
 │   ││
 │ 200 OK (expires 3600 sec) ││
 │<───│
 │   ││
 │   ││
 │   ││
 │   ││
   Alice ┌┐   ┌┐
┌─┐  │OpenSips│   │Asterisk│
║"│  └┘   └┘
└┬┘
┌┼┐
 │
┌┴┐

1-the sip device sends a REGISTER to OpenSIPS (expires 3600)
2-OpenSIPS authentifies the REGISTER and sends back challenge to the 
sip device
3-sip devices sends authenticated REGISTER to OpenSIPS, here the 
expires would normally be changed to 3600 but in this case it was 
already set at 3600.
4-Asterisk receives the REGISTER, alters the expires to 120secs and 
replies 200 ok to OpenSIPS

5-OpenSIPS forwards the 200 ok but with 3600 sec expires.

My Questions is:
I was expecting OpenSIPS to automatically update the expires in it's 
usrloc to 120 seconds and send 120 sec in its 200 ok. Should I be 
doing something in a return route for the REGISTERs in order to update 
that and send the correct value or should opensips be doing that 
automatically? Currently I am calling mid_registrar_save("location") 
when I receive the REGISTER but doing nothing when I receive the 200 ok.


Thanks in advance
Dominic



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid_registrar not updating exipres when receiving 200 ok

2018-09-20 Thread Dominic
Hi all, I have the following setup:
-sip device is registering to OpenSIPS setup as a mid_registrar who then
fowards registers to asterisk once they are authenticated
-OpenSIPS is setup in contact throttling mode with outgoing expires set to
3600 sec.

The scenario I came accross is the following:

  "Registration - OpenSips mid_registrar"

   ┌─┐
   ║"│
   └┬┘
   ┌┼┐
│   ┌┐   ┌┐
   ┌┴┐  │OpenSips│   │Asterisk│
  Alice └┘   └┘
│REGISTER (expires 3600 sec)││
│───>│
│   ││
│ 401 Unauthorized  ││
│<───│
│   ││
│REGISTER (expires 3600 sec)││
│───>│
│   ││
│   │ REGISTER (expires 3600 sec)│
│   │ ───>
│   ││
│   │  200 OK (expires 120 sec)  │
│   │ <───
│   ││
│ 200 OK (expires 3600 sec) ││
│<───│
│   ││
│   ││
│   ││
│   ││
  Alice ┌┐   ┌┐
   ┌─┐  │OpenSips│   │Asterisk│
   ║"│  └┘   └┘
   └┬┘
   ┌┼┐
│
   ┌┴┐


1-the sip device sends a REGISTER to OpenSIPS (expires 3600)
2-OpenSIPS authentifies the REGISTER and sends back challenge to the sip
device
3-sip devices sends authenticated REGISTER to OpenSIPS, here the expires
would normally be changed to 3600 but in this case it was already set at
3600.
4-Asterisk receives the REGISTER, alters the expires to 120secs and replies
200 ok to OpenSIPS
5-OpenSIPS forwards the 200 ok but with 3600 sec expires.

My Questions is:
I was expecting OpenSIPS to automatically update the expires in it's usrloc
to 120 seconds and send 120 sec in its 200 ok. Should I be doing something
in a return route for the REGISTERs in order to update that and send the
correct value or should opensips be doing that automatically? Currently I
am calling mid_registrar_save("location") when I receive the REGISTER but
doing nothing when I receive the 200 ok.

Thanks in advance
Dominic
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar unregister on expire

2018-09-17 Thread John Kiniston
You could do a mid_registrar_lookup on your route for traffic from the PBX
and if it fails drop the response.

On Wed, Sep 12, 2018 at 8:38 AM Dominic  wrote:

> i think I may have figured it out, OpenSIPS is behaving properly (it sends
> the unregister after expiery) I haden't seen it initially in the asterisk
> CLI. However the issue is that it looks like asterisk continues to send
> it's SIP OPTIONS to that peer and OpenSIPS replies 404 not found and then
> asterisk thinks that peer is still "alive" because he received a response,
> therefore I still si that peer in the list show peers list. Here is what I
> see in the asterisk CLI:
>
> [Sep 12 11:16:05] -- Unregistered SIP 'jit000106258'<=== OpenSips
>> sends unregister after exiery
>> [Sep 12 11:16:07] NOTICE[16484]: chan_sip.c:23898
>> handle_response_peerpoke: Peer 'jit000106258' is now Reachable. (2ms /
>> 5000ms)  <== asterisk sends 404 in reply to SIP OPTION
>> sipdev1-mtl*CLI> sip show peers
>> Name/username HostDyn
>> Forcerport ComediaACL Port Status
>> Description  Realtime
>> jit000106258/jit000106258 64.254.249.190   D
>> YesYes A  5060 OK (2
>> ms)Cached RT
>> ...
>>
>
>
> Sorry for the initial email, I had not looked properly on my end before
> submitting.
>
>
> On Wed, Sep 12, 2018 at 9:58 AM Liviu Chircu  wrote:
>
>> Hi Dominic,
>>
>> This should be working -- are you able to reproduce this problem?  Also,
>> any setup details (binary version, mid-registrar modparams, SIP traces)
>> would be of great help.
>>
>> Best regards,
>>
>> Liviu Chircu
>> OpenSIPS Developerhttp://www.opensips-solutions.com
>>
>> On 12.09.2018 16:52, Dominic wrote:
>>
>> Hi, I setup OpenSIPs as a mid_registrar in contact throttling mode, in
>> front of an asterisk server. Everything is working fine so far exept that I
>> would like for when an entry in usrloc expires on the OpenSIPS, that an
>> unregister is sent to the Asterisk. Right now, I see the sip device
>> registered on the asterisk (sip show peers) but it is expired on OpenSIPS
>> (opensipsctl ul show). Could anyone point me in the right direction?
>>
>> Thanks
>> Dominic
>>
>>
>> ___
>> Users mailing 
>> listUsers@lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>


-- 
A human being should be able to change a diaper, plan an invasion, butcher
a hog, conn a ship, design a building, write a sonnet, balance accounts,
build a wall, set a bone, comfort the dying, take orders, give orders,
cooperate, act alone, solve equations, analyze a new problem, pitch manure,
program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
---Heinlein
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar unregister on expire

2018-09-12 Thread Dominic
i think I may have figured it out, OpenSIPS is behaving properly (it sends
the unregister after expiery) I haden't seen it initially in the asterisk
CLI. However the issue is that it looks like asterisk continues to send
it's SIP OPTIONS to that peer and OpenSIPS replies 404 not found and then
asterisk thinks that peer is still "alive" because he received a response,
therefore I still si that peer in the list show peers list. Here is what I
see in the asterisk CLI:

[Sep 12 11:16:05] -- Unregistered SIP 'jit000106258'<=== OpenSips
> sends unregister after exiery
> [Sep 12 11:16:07] NOTICE[16484]: chan_sip.c:23898
> handle_response_peerpoke: Peer 'jit000106258' is now Reachable. (2ms /
> 5000ms)  <== asterisk sends 404 in reply to SIP OPTION
> sipdev1-mtl*CLI> sip show peers
> Name/username HostDyn
> Forcerport ComediaACL Port Status
> Description  Realtime
> jit000106258/jit000106258 64.254.249.190   D
> YesYes A  5060 OK (2
> ms)Cached RT
> ...
>


Sorry for the initial email, I had not looked properly on my end before
submitting.


On Wed, Sep 12, 2018 at 9:58 AM Liviu Chircu  wrote:

> Hi Dominic,
>
> This should be working -- are you able to reproduce this problem?  Also,
> any setup details (binary version, mid-registrar modparams, SIP traces)
> would be of great help.
>
> Best regards,
>
> Liviu Chircu
> OpenSIPS Developerhttp://www.opensips-solutions.com
>
> On 12.09.2018 16:52, Dominic wrote:
>
> Hi, I setup OpenSIPs as a mid_registrar in contact throttling mode, in
> front of an asterisk server. Everything is working fine so far exept that I
> would like for when an entry in usrloc expires on the OpenSIPS, that an
> unregister is sent to the Asterisk. Right now, I see the sip device
> registered on the asterisk (sip show peers) but it is expired on OpenSIPS
> (opensipsctl ul show). Could anyone point me in the right direction?
>
> Thanks
> Dominic
>
>
> ___
> Users mailing 
> listUsers@lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid_registrar unregister on expire

2018-09-12 Thread Liviu Chircu

Hi Dominic,

This should be working -- are you able to reproduce this problem?  Also, 
any setup details (binary version, mid-registrar modparams, SIP traces) 
would be of great help.


Best regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 12.09.2018 16:52, Dominic wrote:
Hi, I setup OpenSIPs as a mid_registrar in contact throttling mode, in 
front of an asterisk server. Everything is working fine so far exept 
that I would like for when an entry in usrloc expires on the OpenSIPS, 
that an unregister is sent to the Asterisk. Right now, I see the sip 
device registered on the asterisk (sip show peers) but it is expired 
on OpenSIPS (opensipsctl ul show). Could anyone point me in the right 
direction?


Thanks
Dominic


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid_registrar unregister on expire

2018-09-12 Thread Dominic
Hi, I setup OpenSIPs as a mid_registrar in contact throttling mode, in
front of an asterisk server. Everything is working fine so far exept that I
would like for when an entry in usrloc expires on the OpenSIPS, that an
unregister is sent to the Asterisk. Right now, I see the sip device
registered on the asterisk (sip show peers) but it is expired on OpenSIPS
(opensipsctl ul show). Could anyone point me in the right direction?

Thanks
Dominic
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


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 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)})) {
   #xlog("L_INFO", "Testing SHV ~> 
$(var(ip_lst){csv.value,$var(i)})");

   $var(src_ip) = $(var(ip_lst){csv.value,$var(i)});
   $var(i) = $var(i) + 1;
   }
   return;
}

route[RELAY] {
   route(RTP_MANAGE);
   if(isflagset(FLAG_FROM_PEER)) {
   $var(ip_lst) = $shv(vip_lan_lst);
   route(SET_SOURCE_IP);
   $var(src_socket) = "udp" + ":" + $var(src_ip) + ":" + 
"5060";

   force_send_socket($var(src_socket));
   } else {
   $var(ip_lst) = $shv(vip_wan_lst);
   route(SET_SOURCE_IP);
   $var(src_socket) = "udp" + ":" + $var(src_ip) + ":" + 
"5060";

   force_send_socket($var(src_socket));
   }
   t_relay();
}

volga629

On Fri, Aug 24, 2018 at 11:28 AM, Ben Newlin  
wrote:

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 with. But even if you had to do it that 
way, you would need the regex to do the substitution *before* 
trying to access it as a csv. But as I said, easier is to just use 
commas to begin with.


 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")

$var(i) = 0;
while($var(i) < $(shv(vip_lan_lst){csv.count})) {
  xlog("L_INFO", "Testing SHV ~>
  $(shv(vip_lan_lst){csv.value,$var(i)})");
  $var(i) = $var(i) + 1;
}

Ben Newlin

On 8/24/18, 9:53 AM, "Users on behalf of volga...@networklab.ca" 
volga...@networklab.ca> wrote:


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);
$var(i) = 0;
while($var(i) < $(avp(arr){csv.count})) {
xlog("L_INFO", "Testing SHV ~>
$(avp(arr){csv.value,$var(i)}{re.subst,/;/,/})");
$var(i) = $var(i) + 1;
}

but it not working output should print each ip in xlog.



volga629

On Fri, Aug 24, 2018 at 9:46 AM, Ben Newlin 


wrote:
> 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 (any other separator). Technically the 
parameter list

> transformation may work but I wouldn't recommend it as it is
> implemented for a SIP parameter list which does have some 
reserved

> characters! This got me very recently. (
>
> For shared variables you define them in the modules section of 
your

> config file [2], but they can be changed via MI commands, using
> whatever MI method you would like. I use the opensipsctl 
script with

> the UDP datagram module [3].
>
> [1] http://www.opensips.org/Documentation/Script-Tran-2-4
> [2]
> 
http://www.opensips.org/html/docs/modules/2.4.x/cfgutils.html#idp5923408
> [3] 
http://www.opensips.org/html/docs/modules/2.4.x/mi_datagram.html

>
> Ben Newlin
>
> On 8/21/18, 10:20 PM, "Users on behalf of 
volga...@networklab.ca"

>  volga...@networklab.ca> wrote:
>
> 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 Tue, Aug 21, 2018 at 12:46 PM, Ben Newlin
> 
> wrote:
> > 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?
> >
>

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)})) {
   #xlog("L_INFO", "Testing SHV ~> 
$(var(ip_lst){csv.value,$var(i)})");

   $var(src_ip) = $(var(ip_lst){csv.value,$var(i)});
   $var(i) = $var(i) + 1;
   }
   return;
}

route[RELAY] {
   route(RTP_MANAGE);
   if(isflagset(FLAG_FROM_PEER)) {
   $var(ip_lst) = $shv(vip_lan_lst);
   route(SET_SOURCE_IP);
   $var(src_socket) = "udp" + ":" + $var(src_ip) + ":" + 
"5060";

   force_send_socket($var(src_socket));
   } else {
   $var(ip_lst) = $shv(vip_wan_lst);
   route(SET_SOURCE_IP);
   $var(src_socket) = "udp" + ":" + $var(src_ip) + ":" + 
"5060";

   force_send_socket($var(src_socket));
   }
   t_relay();
}

volga629

On Fri, Aug 24, 2018 at 11:28 AM, Ben Newlin  
wrote:

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 with. But even if you had to do it that way, you 
would need the regex to do the substitution *before* trying to access 
it as a csv. But as I said, easier is to just use commas to begin 
with.


 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")

$var(i) = 0;
while($var(i) < $(shv(vip_lan_lst){csv.count})) {
  xlog("L_INFO", "Testing SHV ~>
  $(shv(vip_lan_lst){csv.value,$var(i)})");
  $var(i) = $var(i) + 1;
}

Ben Newlin

On 8/24/18, 9:53 AM, "Users on behalf of volga...@networklab.ca" 
volga...@networklab.ca> wrote:


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);
$var(i) = 0;
while($var(i) < $(avp(arr){csv.count})) {
xlog("L_INFO", "Testing SHV ~>
$(avp(arr){csv.value,$var(i)}{re.subst,/;/,/})");
$var(i) = $var(i) + 1;
}

but it not working output should print each ip in xlog.



volga629

On Fri, Aug 24, 2018 at 9:46 AM, Ben Newlin 


wrote:
> 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 (any other separator). Technically the parameter 
list

> transformation may work but I wouldn't recommend it as it is
> implemented for a SIP parameter list which does have some 
reserved

> characters! This got me very recently. (
>
> For shared variables you define them in the modules section of 
your

> config file [2], but they can be changed via MI commands, using
> whatever MI method you would like. I use the opensipsctl script 
with

> the UDP datagram module [3].
>
> [1] http://www.opensips.org/Documentation/Script-Tran-2-4
> [2]
> 
http://www.opensips.org/html/docs/modules/2.4.x/cfgutils.html#idp5923408
> [3] 
http://www.opensips.org/html/docs/modules/2.4.x/mi_datagram.html

>
> Ben Newlin
>
> On 8/21/18, 10:20 PM, "Users on behalf of 
volga...@networklab.ca"

>  volga...@networklab.ca> wrote:
>
> 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 Tue, Aug 21, 2018 at 12:46 PM, Ben Newlin
> 
> wrote:
> > 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 it receives on LAN from node 
1, it

> should

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 with. But even 
if you had to do it that way, you would need the regex to do the substitution 
*before* trying to access it as a csv. But as I said, easier is to just use 
commas to begin with.

 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")

$var(i) = 0;
while($var(i) < $(shv(vip_lan_lst){csv.count})) {
  xlog("L_INFO", "Testing SHV ~> 
  $(shv(vip_lan_lst){csv.value,$var(i)})");
  $var(i) = $var(i) + 1;
}

Ben Newlin 

On 8/24/18, 9:53 AM, "Users on behalf of volga...@networklab.ca" 
 wrote:

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);
$var(i) = 0;
while($var(i) < $(avp(arr){csv.count})) {
xlog("L_INFO", "Testing SHV ~> 
$(avp(arr){csv.value,$var(i)}{re.subst,/;/,/})");
$var(i) = $var(i) + 1;
}

but it not working output should print each ip in xlog.



volga629

On Fri, Aug 24, 2018 at 9:46 AM, Ben Newlin  
wrote:
> 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 (any other separator). Technically the parameter list 
> transformation may work but I wouldn't recommend it as it is 
> implemented for a SIP parameter list which does have some reserved 
> characters! This got me very recently. (
> 
> For shared variables you define them in the modules section of your 
> config file [2], but they can be changed via MI commands, using 
> whatever MI method you would like. I use the opensipsctl script with 
> the UDP datagram module [3].
> 
> [1] http://www.opensips.org/Documentation/Script-Tran-2-4
> [2] 
> http://www.opensips.org/html/docs/modules/2.4.x/cfgutils.html#idp5923408
> [3] http://www.opensips.org/html/docs/modules/2.4.x/mi_datagram.html
> 
> Ben Newlin
> 
> On 8/21/18, 10:20 PM, "Users on behalf of volga...@networklab.ca" 
>  volga...@networklab.ca> wrote:
> 
> 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 Tue, Aug 21, 2018 at 12:46 PM, Ben Newlin 
> 
> wrote:
> > 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 it receives on LAN from node 1, it 
> should
> > send out WAN for node 1. Is this correct?
> >
> > Ben Newlin
> >
> > On 8/21/18, 11:39 AM, "volga...@networklab.ca"
> >  wrote:
> >
> > 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 internal and 
> external
> > variables
> > like VIP-INT list internal and VIP-EXT list so will be 
> possible
> > dynamically use it in script.
> >
> >
> > volga629
> >
> >
> >
> > On Tue, Aug 21, 2018 at 12:19 PM, volga...@networklab.ca 
> wrote:
> > > Hello Ben,
> > > The script bellow is to find the way define vips in 
> variable so
> >  if

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);
   $var(i) = 0;
   while($var(i) < $(avp(arr){csv.count})) {
   xlog("L_INFO", "Testing SHV ~> 
$(avp(arr){csv.value,$var(i)}{re.subst,/;/,/})");

   $var(i) = $var(i) + 1;
   }

but it not working output should print each ip in xlog.



volga629

On Fri, Aug 24, 2018 at 9:46 AM, Ben Newlin  
wrote:

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 (any other separator). Technically the parameter list 
transformation may work but I wouldn't recommend it as it is 
implemented for a SIP parameter list which does have some reserved 
characters! This got me very recently. (


For shared variables you define them in the modules section of your 
config file [2], but they can be changed via MI commands, using 
whatever MI method you would like. I use the opensipsctl script with 
the UDP datagram module [3].


[1] http://www.opensips.org/Documentation/Script-Tran-2-4
[2] 
http://www.opensips.org/html/docs/modules/2.4.x/cfgutils.html#idp5923408

[3] http://www.opensips.org/html/docs/modules/2.4.x/mi_datagram.html

Ben Newlin

On 8/21/18, 10:20 PM, "Users on behalf of volga...@networklab.ca" 
volga...@networklab.ca> wrote:


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 Tue, Aug 21, 2018 at 12:46 PM, Ben Newlin 


wrote:
> 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 it receives on LAN from node 1, it 
should

> send out WAN for node 1. Is this correct?
>
> Ben Newlin
>
> On 8/21/18, 11:39 AM, "volga...@networklab.ca"
>  wrote:
>
> 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 internal and 
external

> variables
> like VIP-INT list internal and VIP-EXT list so will be 
possible

> dynamically use it in script.
>
>
> volga629
>
>
>
> On Tue, Aug 21, 2018 at 12:19 PM, volga...@networklab.ca 
wrote:

> > 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 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, 2:32 PM, "Users on behalf of
> volga...@networklab.ca"
> >>  >> volga...@networklab.ca> wrote:
> >>
> >> 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== vip2 ip addr) {
> >> set_dlg_sharing_tag("vip2");
> >> $avp(vip) = "vip2 ip addr";
> >> } else if($Ri == vip3 ip addr) {
> >> set_dlg_sharing_tag("vip3");
> >>   

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 (any other 
separator). Technically the parameter list transformation may work but I 
wouldn't recommend it as it is implemented for a SIP parameter list which does 
have some reserved characters! This got me very recently. (

For shared variables you define them in the modules section of your config file 
[2], but they can be changed via MI commands, using whatever MI method you 
would like. I use the opensipsctl script with the UDP datagram module [3].

[1] http://www.opensips.org/Documentation/Script-Tran-2-4
[2] http://www.opensips.org/html/docs/modules/2.4.x/cfgutils.html#idp5923408
[3] http://www.opensips.org/html/docs/modules/2.4.x/mi_datagram.html

Ben Newlin 

On 8/21/18, 10:20 PM, "Users on behalf of volga...@networklab.ca" 
 wrote:

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 Tue, Aug 21, 2018 at 12:46 PM, Ben Newlin  
wrote:
> 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 it receives on LAN from node 1, it should 
> send out WAN for node 1. Is this correct?
> 
> Ben Newlin
> 
> On 8/21/18, 11:39 AM, "volga...@networklab.ca" 
>  wrote:
> 
> 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 internal and external 
> variables
> like VIP-INT list internal and VIP-EXT list so will be possible
> dynamically use it in script.
> 
> 
> volga629
> 
> 
> 
> On Tue, Aug 21, 2018 at 12:19 PM, volga...@networklab.ca wrote:
> > 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 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, 2:32 PM, "Users on behalf of 
> volga...@networklab.ca"
> >>  >> volga...@networklab.ca> wrote:
> >>
> >> 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== vip2 ip addr) {
> >> set_dlg_sharing_tag("vip2");
> >> $avp(vip) = "vip2 ip addr";
> >> } else if($Ri == vip3 ip addr) {
> >> set_dlg_sharing_tag("vip3");
> >> $avp(vip) = "vip3 ip addr";
> >> }
> >> }
> >>
> >> not sure if this correct approach. In theory $avp(vip) can 
> be
> >> used for
> >> rtpengine or other operation require correct ip in body, 
> but
> >> issue that
> >> call flow, because INVITE come from external interface 
> first
> >> then it
> >> forwarded to LAN via dipatcher.
> >>
> >>
> >> volg629
> >>
> >>
> >> On Tue, Aug 14, 2018 at 2:51 PM, Ben Newlin
> 

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 Tue, Aug 21, 2018 at 12:46 PM, Ben Newlin  
wrote:

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 it receives on LAN from node 1, it should 
send out WAN for node 1. Is this correct?


Ben Newlin

On 8/21/18, 11:39 AM, "volga...@networklab.ca" 
 wrote:


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 internal and external 
variables

like VIP-INT list internal and VIP-EXT list so will be possible
dynamically use it in script.


volga629



On Tue, Aug 21, 2018 at 12:19 PM, volga...@networklab.ca wrote:
> 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 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, 2:32 PM, "Users on behalf of 
volga...@networklab.ca"

>> > volga...@networklab.ca> wrote:
>>
>> 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== vip2 ip addr) {
>> set_dlg_sharing_tag("vip2");
>> $avp(vip) = "vip2 ip addr";
>> } else if($Ri == vip3 ip addr) {
>> set_dlg_sharing_tag("vip3");
>> $avp(vip) = "vip3 ip addr";
>> }
>> }
>>
>> not sure if this correct approach. In theory $avp(vip) can 
be

>> used for
>> rtpengine or other operation require correct ip in body, 
but

>> issue that
>> call flow, because INVITE come from external interface 
first

>> then it
>> forwarded to LAN via dipatcher.
>>
>>
>> volg629
>>
>>
>> On Tue, Aug 14, 2018 at 2:51 PM, Ben Newlin
>> 
>> wrote:
>> > 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 can't have each box listen on 
all 3

>> IPs all
>> > the time? Then from within the script you can use $Ri 
[1] to

>> > determine which interface received the message.
>> >
>> > [1] -
>> http://www.opensips.org/Documentation/Script-CoreVar-2-3#toc77
>> >
>> > Ben Newlin
>> >
>> > On 8/14/18, 1:39 PM, "Users on behalf of
>> volga...@networklab.ca"
>> > > > volga...@networklab.ca> wrote:
>> >
>> > 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
>> >
>> >
>> > modparam("cfgutils", "shvset", 
"vip1=s:192.168.10.100")
>> > modparam("cfgutils", "shvset", 
"vip2=s:192.168.10.101")
>> > modparam("cfgutils", "shvset", 

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 it receives on LAN from node 1, it should send out WAN for node 
1. Is this correct?

Ben Newlin 

On 8/21/18, 11:39 AM, "volga...@networklab.ca"  wrote:

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 internal and external variables 
like VIP-INT list internal and VIP-EXT list so will be possible 
dynamically use it in script.


volga629



On Tue, Aug 21, 2018 at 12:19 PM, volga...@networklab.ca wrote:
> 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 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, 2:32 PM, "Users on behalf of volga...@networklab.ca" 
>> > volga...@networklab.ca> wrote:
>> 
>> 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== vip2 ip addr) {
>> set_dlg_sharing_tag("vip2");
>> $avp(vip) = "vip2 ip addr";
>> } else if($Ri == vip3 ip addr) {
>> set_dlg_sharing_tag("vip3");
>> $avp(vip) = "vip3 ip addr";
>> }
>> }
>> 
>> not sure if this correct approach. In theory $avp(vip) can be 
>> used for
>> rtpengine or other operation require correct ip in body, but 
>> issue that
>> call flow, because INVITE come from external interface first 
>> then it
>> forwarded to LAN via dipatcher.
>> 
>> 
>> volg629
>> 
>> 
>> On Tue, Aug 14, 2018 at 2:51 PM, Ben Newlin 
>> 
>> wrote:
>> > 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 can't have each box listen on all 3 
>> IPs all
>> > the time? Then from within the script you can use $Ri [1] to
>> > determine which interface received the message.
>> >
>> > [1] - 
>> http://www.opensips.org/Documentation/Script-CoreVar-2-3#toc77
>> >
>> > Ben Newlin
>> >
>> > On 8/14/18, 1:39 PM, "Users on behalf of 
>> volga...@networklab.ca"
>> > > > volga...@networklab.ca> wrote:
>> >
>> > 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
>> >
>> >
>> > modparam("cfgutils", "shvset", "vip1=s:192.168.10.100")
>> > modparam("cfgutils", "shvset", "vip2=s:192.168.10.101")
>> > modparam("cfgutils", "shvset", "vip3=s:192.168.10.102")
>> >
>> > If vip relocated to antother node meaning on live node 1 
>> will be
>> > two
>> > vip's ( example node 3 fail then it relocate ip address to 
>> node 1)
>> > How I can determine which  vip ip address should be in use.
>> >
>> > 

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 should be in use." I'm not sure what you mean by "in use" in this 
context. For inbound traffic it looks like you are currently accepting any of 
them. For in-dialog requests you would have to use the VIP of the original 
request, which it looks like you are achieving using dialog profiles.

So by "in use" do you mean the one that should be preferred for new outgoing 
traffic?

If so, I would suggest you do that with the same shared variable mechanism, 
managed by your keepalived script. Two options:
1. have the keepalived script manage the variables so that one of them, "vip1" 
perhaps, is always the currently active VIP for any given instance
2. have a separate variable, "active_vip" or something, that references the 
currently active VIP

Ben Newlin 

On 8/21/18, 11:27 AM, "volga...@networklab.ca"  wrote:

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 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, 2:32 PM, "Users on behalf of volga...@networklab.ca" 
>  volga...@networklab.ca> wrote:
> 
> 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== vip2 ip addr) {
> set_dlg_sharing_tag("vip2");
> $avp(vip) = "vip2 ip addr";
> } else if($Ri == vip3 ip addr) {
> set_dlg_sharing_tag("vip3");
> $avp(vip) = "vip3 ip addr";
> }
> }
> 
> not sure if this correct approach. In theory $avp(vip) can be 
> used for
> rtpengine or other operation require correct ip in body, but 
> issue that
> call flow, because INVITE come from external interface first then 
> it
> forwarded to LAN via dipatcher.
> 
> 
> volg629
> 
> 
> On Tue, Aug 14, 2018 at 2:51 PM, Ben Newlin 
> 
> wrote:
> > 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 can't have each box listen on all 3 
> IPs all
> > the time? Then from within the script you can use $Ri [1] to
> > determine which interface received the message.
> >
> > [1] - 
> http://www.opensips.org/Documentation/Script-CoreVar-2-3#toc77
> >
> > Ben Newlin
> >
> > On 8/14/18, 1:39 PM, "Users on behalf of volga...@networklab.ca"
> >  > volga...@networklab.ca> wrote:
> >
> > 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
> >
> >
> > modparam("cfgutils", "shvset", "vip1=s:192.168.10.100")
> > modparam("cfgutils", "shvset", "vip2=s:192.168.10.101")
> > modparam("cfgutils", "shvset", "vip3=s:192.168.10.102")
> >
> > If vip relocated to antother node meaning on live node 1 
> will be
> > two
> > vip's ( example node 3 fail then it relocate ip address to 
> node 1)
> > How I can determine which  vip ip address should be in use.
> >
> > volg629
> >
> >
> > 

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 internal and external variables 
like VIP-INT list internal and VIP-EXT list so will be possible 
dynamically use it in script.



volga629



On Tue, Aug 21, 2018 at 12:19 PM, volga...@networklab.ca wrote:

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 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, 2:32 PM, "Users on behalf of volga...@networklab.ca" 
volga...@networklab.ca> wrote:


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== vip2 ip addr) {
set_dlg_sharing_tag("vip2");
$avp(vip) = "vip2 ip addr";
} else if($Ri == vip3 ip addr) {
set_dlg_sharing_tag("vip3");
$avp(vip) = "vip3 ip addr";
}
}

not sure if this correct approach. In theory $avp(vip) can be 
used for
rtpengine or other operation require correct ip in body, but 
issue that
call flow, because INVITE come from external interface first 
then it

forwarded to LAN via dipatcher.


volg629


On Tue, Aug 14, 2018 at 2:51 PM, Ben Newlin 


wrote:
> 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 can't have each box listen on all 3 
IPs all

> the time? Then from within the script you can use $Ri [1] to
> determine which interface received the message.
>
> [1] - 
http://www.opensips.org/Documentation/Script-CoreVar-2-3#toc77

>
> Ben Newlin
>
> On 8/14/18, 1:39 PM, "Users on behalf of 
volga...@networklab.ca"

>  volga...@networklab.ca> wrote:
>
> 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
>
>
> modparam("cfgutils", "shvset", "vip1=s:192.168.10.100")
> modparam("cfgutils", "shvset", "vip2=s:192.168.10.101")
> modparam("cfgutils", "shvset", "vip3=s:192.168.10.102")
>
> If vip relocated to antother node meaning on live node 1 
will be

> two
> vip's ( example node 3 fail then it relocate ip address to 
node 1)

> How I can determine which  vip ip address should be in use.
>
> volg629
>
>
> On Thu, Aug 2, 2018 at 9:44 PM, Ben Newlin
> 
> wrote:
> > 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 set
> > via MI. So when your monitor detects a failure and 
switches the

> IPs,
> > it could also use MI to change the value of the variable 
in

> OpenSIPS
> > for future use.
> >
> > As a side note to OpenSIPS devs, it appears this module 
was

> missed
> > when the Module Index page [2] was redesigned as I can't 
find it
> > there for 2.x, but the direct links to the 2.x versions 
still

> work.
> >
> > [1]
> http://www.opensips.org/html/docs/modules/2.4.x/cfgutils.html
> > [2] http://www.opensips.org/Documentation/Modules-2-4
> >
> > Ben Newlin
> >
> > On 8/2/18, 5:56 PM, "Users on behalf of 

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 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, 2:32 PM, "Users on behalf of volga...@networklab.ca" 
volga...@networklab.ca> wrote:


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== vip2 ip addr) {
set_dlg_sharing_tag("vip2");
$avp(vip) = "vip2 ip addr";
} else if($Ri == vip3 ip addr) {
set_dlg_sharing_tag("vip3");
$avp(vip) = "vip3 ip addr";
}
}

not sure if this correct approach. In theory $avp(vip) can be 
used for
rtpengine or other operation require correct ip in body, but 
issue that
call flow, because INVITE come from external interface first then 
it

forwarded to LAN via dipatcher.


volg629


On Tue, Aug 14, 2018 at 2:51 PM, Ben Newlin 


wrote:
> 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 can't have each box listen on all 3 
IPs all

> the time? Then from within the script you can use $Ri [1] to
> determine which interface received the message.
>
> [1] - 
http://www.opensips.org/Documentation/Script-CoreVar-2-3#toc77

>
> Ben Newlin
>
> On 8/14/18, 1:39 PM, "Users on behalf of volga...@networklab.ca"
>  volga...@networklab.ca> wrote:
>
> 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
>
>
> modparam("cfgutils", "shvset", "vip1=s:192.168.10.100")
> modparam("cfgutils", "shvset", "vip2=s:192.168.10.101")
> modparam("cfgutils", "shvset", "vip3=s:192.168.10.102")
>
> If vip relocated to antother node meaning on live node 1 
will be

> two
> vip's ( example node 3 fail then it relocate ip address to 
node 1)

> How I can determine which  vip ip address should be in use.
>
> volg629
>
>
> On Thu, Aug 2, 2018 at 9:44 PM, Ben Newlin
> 
> wrote:
> > 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 set
> > via MI. So when your monitor detects a failure and 
switches the

> IPs,
> > it could also use MI to change the value of the variable 
in

> OpenSIPS
> > for future use.
> >
> > As a side note to OpenSIPS devs, it appears this module 
was

> missed
> > when the Module Index page [2] was redesigned as I can't 
find it
> > there for 2.x, but the direct links to the 2.x versions 
still

> work.
> >
> > [1]
> http://www.opensips.org/html/docs/modules/2.4.x/cfgutils.html
> > [2] http://www.opensips.org/Documentation/Modules-2-4
> >
> > Ben Newlin
> >
> > On 8/2/18, 5:56 PM, "Users on behalf of 
volga...@networklab.ca"

> >  > volga...@networklab.ca> wrote:
> >
> > 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
> > 

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, 2:32 PM, "Users on behalf of volga...@networklab.ca" 
 wrote:

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== vip2 ip addr) {
set_dlg_sharing_tag("vip2");
$avp(vip) = "vip2 ip addr";
} else if($Ri == vip3 ip addr) {
set_dlg_sharing_tag("vip3");
$avp(vip) = "vip3 ip addr";
}
}

not sure if this correct approach. In theory $avp(vip) can be used for 
rtpengine or other operation require correct ip in body, but issue that 
call flow, because INVITE come from external interface first then it 
forwarded to LAN via dipatcher.


volg629


On Tue, Aug 14, 2018 at 2:51 PM, Ben Newlin  
wrote:
> 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 can't have each box listen on all 3 IPs all 
> the time? Then from within the script you can use $Ri [1] to 
> determine which interface received the message.
> 
> [1] - http://www.opensips.org/Documentation/Script-CoreVar-2-3#toc77
> 
> Ben Newlin
> 
> On 8/14/18, 1:39 PM, "Users on behalf of volga...@networklab.ca" 
>  volga...@networklab.ca> wrote:
> 
> 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
> 
> 
> modparam("cfgutils", "shvset", "vip1=s:192.168.10.100")
> modparam("cfgutils", "shvset", "vip2=s:192.168.10.101")
> modparam("cfgutils", "shvset", "vip3=s:192.168.10.102")
> 
> If vip relocated to antother node meaning on live node 1 will be 
> two
> vip's ( example node 3 fail then it relocate ip address to node 1)
> How I can determine which  vip ip address should be in use.
> 
> volg629
> 
> 
> On Thu, Aug 2, 2018 at 9:44 PM, Ben Newlin 
> 
> wrote:
> > 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 set
> > via MI. So when your monitor detects a failure and switches the 
> IPs,
> > it could also use MI to change the value of the variable in 
> OpenSIPS
> > for future use.
> >
> > As a side note to OpenSIPS devs, it appears this module was 
> missed
> > when the Module Index page [2] was redesigned as I can't find it
> > there for 2.x, but the direct links to the 2.x versions still 
> work.
> >
> > [1] 
> http://www.opensips.org/html/docs/modules/2.4.x/cfgutils.html
> > [2] http://www.opensips.org/Documentation/Modules-2-4
> >
> > Ben Newlin
> >
> > On 8/2/18, 5:56 PM, "Users on behalf of volga...@networklab.ca"
> >  > volga...@networklab.ca> wrote:
> >
> > 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");
> > should
> > have correct ip's.  Same with rtpengine offer
> > rtpengine_offer("replace-origin replace-session-connection
> > in-iface=external out-iface=internal
> 

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== vip2 ip addr) {
   set_dlg_sharing_tag("vip2");
   $avp(vip) = "vip2 ip addr";
   } else if($Ri == vip3 ip addr) {
   set_dlg_sharing_tag("vip3");
   $avp(vip) = "vip3 ip addr";
   }
   }

not sure if this correct approach. In theory $avp(vip) can be used for 
rtpengine or other operation require correct ip in body, but issue that 
call flow, because INVITE come from external interface first then it 
forwarded to LAN via dipatcher.



volg629


On Tue, Aug 14, 2018 at 2:51 PM, Ben Newlin  
wrote:

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 can't have each box listen on all 3 IPs all 
the time? Then from within the script you can use $Ri [1] to 
determine which interface received the message.


[1] - http://www.opensips.org/Documentation/Script-CoreVar-2-3#toc77

Ben Newlin

On 8/14/18, 1:39 PM, "Users on behalf of volga...@networklab.ca" 
volga...@networklab.ca> wrote:


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


modparam("cfgutils", "shvset", "vip1=s:192.168.10.100")
modparam("cfgutils", "shvset", "vip2=s:192.168.10.101")
modparam("cfgutils", "shvset", "vip3=s:192.168.10.102")

If vip relocated to antother node meaning on live node 1 will be 
two

vip's ( example node 3 fail then it relocate ip address to node 1)
How I can determine which  vip ip address should be in use.

volg629


On Thu, Aug 2, 2018 at 9:44 PM, Ben Newlin 


wrote:
> 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 set
> via MI. So when your monitor detects a failure and switches the 
IPs,
> it could also use MI to change the value of the variable in 
OpenSIPS

> for future use.
>
> As a side note to OpenSIPS devs, it appears this module was 
missed

> when the Module Index page [2] was redesigned as I can't find it
> there for 2.x, but the direct links to the 2.x versions still 
work.

>
> [1] 
http://www.opensips.org/html/docs/modules/2.4.x/cfgutils.html

> [2] http://www.opensips.org/Documentation/Modules-2-4
>
> Ben Newlin
>
> On 8/2/18, 5:56 PM, "Users on behalf of volga...@networklab.ca"
>  volga...@networklab.ca> wrote:
>
> 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");

> should
> have correct ip's.  Same with rtpengine offer
> rtpengine_offer("replace-origin replace-session-connection
> in-iface=external out-iface=internal
> media-address=$avp(media_addr)
> RTP/AVP ICE=remove") where need introduce media-address to 
specify

> correct vip ip.
> Can you exapand on m4 ? I never used the templating.
> Might db avp  to predefine  cluster nodes vip ip, not sure.
>
>
> volga629
>
>
>
> On Thu, Aug 2, 2018 at 10:50 AM, Liviu Chircu 


> wrote:
> > 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, volga...@networklab.ca wrote:
> >> Hello Everyone,
> >>
> >> I have work around on this issue
> >> # Work arround for github issue #1109
> >> append_hf("Path: ip:5060;transport=udp>\r\n"

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 can't have each box listen on all 3 IPs all the time? 
Then from within the script you can use $Ri [1] to determine which interface 
received the message.

[1] - http://www.opensips.org/Documentation/Script-CoreVar-2-3#toc77

Ben Newlin 

On 8/14/18, 1:39 PM, "Users on behalf of volga...@networklab.ca" 
 wrote:

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


modparam("cfgutils", "shvset", "vip1=s:192.168.10.100")
modparam("cfgutils", "shvset", "vip2=s:192.168.10.101")
modparam("cfgutils", "shvset", "vip3=s:192.168.10.102")

If vip relocated to antother node meaning on live node 1 will be two 
vip's ( example node 3 fail then it relocate ip address to node 1)
How I can determine which  vip ip address should be in use.

volg629


On Thu, Aug 2, 2018 at 9:44 PM, Ben Newlin  
wrote:
> 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 set 
> via MI. So when your monitor detects a failure and switches the IPs, 
> it could also use MI to change the value of the variable in OpenSIPS 
> for future use.
> 
> As a side note to OpenSIPS devs, it appears this module was missed 
> when the Module Index page [2] was redesigned as I can't find it 
> there for 2.x, but the direct links to the 2.x versions still work.
> 
> [1] http://www.opensips.org/html/docs/modules/2.4.x/cfgutils.html
> [2] http://www.opensips.org/Documentation/Modules-2-4
> 
> Ben Newlin
> 
> On 8/2/18, 5:56 PM, "Users on behalf of volga...@networklab.ca" 
>  volga...@networklab.ca> wrote:
> 
> 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"); 
> should
> have correct ip's.  Same with rtpengine offer
> rtpengine_offer("replace-origin replace-session-connection
> in-iface=external out-iface=internal 
> media-address=$avp(media_addr)
> RTP/AVP ICE=remove") where need introduce media-address to specify
> correct vip ip.
> Can you exapand on m4 ? I never used the templating.
> Might db avp  to predefine  cluster nodes vip ip, not sure.
> 
> 
> volga629
> 
> 
> 
> On Thu, Aug 2, 2018 at 10:50 AM, Liviu Chircu 
> wrote:
> > 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, volga...@networklab.ca wrote:
> >> 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
> >>
> >>
> >>
> >>
> >> ___
> >> Users mailing list
> >> Users@lists.opensips.org
> >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >
> 
> 
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 
> 
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

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


modparam("cfgutils", "shvset", "vip1=s:192.168.10.100")
modparam("cfgutils", "shvset", "vip2=s:192.168.10.101")
modparam("cfgutils", "shvset", "vip3=s:192.168.10.102")

If vip relocated to antother node meaning on live node 1 will be two 
vip's ( example node 3 fail then it relocate ip address to node 1)

How I can determine which  vip ip address should be in use.

volg629


On Thu, Aug 2, 2018 at 9:44 PM, Ben Newlin  
wrote:
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 set 
via MI. So when your monitor detects a failure and switches the IPs, 
it could also use MI to change the value of the variable in OpenSIPS 
for future use.


As a side note to OpenSIPS devs, it appears this module was missed 
when the Module Index page [2] was redesigned as I can't find it 
there for 2.x, but the direct links to the 2.x versions still work.


[1] http://www.opensips.org/html/docs/modules/2.4.x/cfgutils.html
[2] http://www.opensips.org/Documentation/Modules-2-4

Ben Newlin

On 8/2/18, 5:56 PM, "Users on behalf of volga...@networklab.ca" 
volga...@networklab.ca> wrote:


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"); 
should

have correct ip's.  Same with rtpengine offer
rtpengine_offer("replace-origin replace-session-connection
in-iface=external out-iface=internal 
media-address=$avp(media_addr)

RTP/AVP ICE=remove") where need introduce media-address to specify
correct vip ip.
Can you exapand on m4 ? I never used the templating.
Might db avp  to predefine  cluster nodes vip ip, not sure.


volga629



On Thu, Aug 2, 2018 at 10:50 AM, Liviu Chircu 
wrote:
> 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, volga...@networklab.ca wrote:
>> 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
>>
>>
>>
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


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 set via MI. So when 
your monitor detects a failure and switches the IPs, it could also use MI to 
change the value of the variable in OpenSIPS for future use.

As a side note to OpenSIPS devs, it appears this module was missed when the 
Module Index page [2] was redesigned as I can't find it there for 2.x, but the 
direct links to the 2.x versions still work.

[1] http://www.opensips.org/html/docs/modules/2.4.x/cfgutils.html
[2] http://www.opensips.org/Documentation/Modules-2-4

Ben Newlin 

On 8/2/18, 5:56 PM, "Users on behalf of volga...@networklab.ca" 
 wrote:

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"); should 
have correct ip's.  Same with rtpengine offer
rtpengine_offer("replace-origin replace-session-connection 
in-iface=external out-iface=internal media-address=$avp(media_addr) 
RTP/AVP ICE=remove") where need introduce media-address to specify 
correct vip ip.
Can you exapand on m4 ? I never used the templating.
Might db avp  to predefine  cluster nodes vip ip, not sure.


volga629



On Thu, Aug 2, 2018 at 10:50 AM, Liviu Chircu  
wrote:
> 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, volga...@networklab.ca wrote:
>> 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
>> 
>> 
>> 
>> 
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


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"); should 
have correct ip's.  Same with rtpengine offer
rtpengine_offer("replace-origin replace-session-connection 
in-iface=external out-iface=internal media-address=$avp(media_addr) 
RTP/AVP ICE=remove") where need introduce media-address to specify 
correct vip ip.

Can you exapand on m4 ? I never used the templating.
Might db avp  to predefine  cluster nodes vip ip, not sure.


volga629



On Thu, Aug 2, 2018 at 10:50 AM, Liviu Chircu  
wrote:

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, volga...@networklab.ca wrote:

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




___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users





___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


  1   2   >