Re: [OpenSIPS-Users] mid registrar question

2022-11-07 Thread nutxase via Users
I suppose even uac_registrar could be the right way

any suggestions

Thanks,
Mike

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

--- Original Message ---
On Monday, November 7th, 2022 at 11:51 AM, nutxase via Users 
 wrote:

> Hi All,
>
> I am setting up the mid registrar module and was wondering if the following 
> is possible
>
> when the UAC drops its registration that the opensips keeps the registration 
> active on asterisk
>
> example we have a mobile softphone that goes to sleep and then opensips 
> deregisters on asterisk, so therefore asterisk wont send any incoming calls.
>
> how can i make opensips keep it active on asterisk even when the mobile 
> client in this case is "asleep" or offline
>
> any guidance would be appreciated!
>
> 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


[OpenSIPS-Users] mid registrar question

2022-11-07 Thread nutxase via Users
Hi All,

I am setting up the mid registrar module and was wondering if the following is 
possible

when the UAC drops its registration that the opensips keeps the registration 
active on asterisk

example we have a mobile softphone that goes to sleep and then opensips 
deregisters on asterisk, so therefore asterisk wont send any incoming calls.

how can i make opensips keep it active on asterisk even when the mobile client 
in this case is "asleep" or offline

any guidance would be appreciated!

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


[OpenSIPS-Users] Mid-registrar with AOR throttling - clearing registration

2021-09-28 Thread Mark Allen
We have a mid-registrar (OpenSIPS 3.1) in front of an Asterisk node.
Mid-registrar saves with the 'memory only' flag. We are using AOR throttling

We've had a few occasions where something has gone wrong with the
registration on Asterisk so that Asterisk thinks an extension is no longer
registered, but OpenSIPS thinks it still is. We've resolved these
occurrences but they have raised a question for the future. In a
situation where mid-registrar is holding onto a registration but Asterisk
thinks the registration no longer exists, is there a way to tell the
mid-registrar to expire the registration, either forcing a re-register on
Asterisk, or at least so that the next re-register from a client is
forwarded on to Asterisk? Obviously, we have the option of restarting
OpenSIPS, but that would affect all registered clients rather than a single
problematic one.
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Mid-Registrar and SUBSCRIBE

2020-08-07 Thread Yury Kirsanov
Hi,
I've successfully tested OpenSIPS with Mid-Registrar module in front of
Asterisk server, it works fine for REGISTER messages and INVITEs. But I'm
facing a problem with SUBSCRIBE/NOTIFY messages that I'd like to forward to
Asterisk server and back. How do I change Contact field in original
SUBSCRIBE request? Currently it doesn't have ;ctid field and Asterisk will
be sending NOTIFY messages to original Contact listed in SUBSCRIBE without
ctid so mid-registrar lookup is failing
with ERROR:mid_registrar:mid_reg_lookup: failed to locate our ';ctid='
param in URI message. Thanks.

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


[OpenSIPS-Users] Mid Registrar Presence/Subscribe - Suggestions

2020-02-06 Thread Sharad Kumar via Users
Hey guys,

We want to add presence feature in our existing openSIPS deployment, currently 
we are using mid-registrar and we would like to handle BLF messages. So what 
you guys recommend ? that we go for XCAP server or just relay SUBSCRIBE message 
to the PBX instead of using presence server ?

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


[OpenSIPS-Users] Mid-Registrar REGISTER with Auth header

2019-02-12 Thread Slava Bendersky
Hello Everyone, 
When REGISTER with Auth header ( registration update ) is send out contact 
header is not rewritten. Is this normal behavior ? 
Mid-Registrar is operation mode 2 



 REGISTRAR module 
loadmodule "mid_registrar.so" 
modparam("mid_registrar", "mode", 2) 
modparam("mid_registrar", "received_avp", "$avp(RECEIVED)") 
modparam("mid_registrar", "max_contacts", 10) 
modparam("mid_registrar", "tcp_persistent_flag", "TCP_PERSIST_REGISTRATIONS") 
modparam("mid_registrar", "outgoing_expires", 7200) 








2019/02/12 20:05:47.343433 10.30.100.41:5060 -> 10.30.100.49:5160 
REGISTER sip:domain.com:5160 SIP/2.0 
Via: SIP/2.0/UDP 10.30.100.41:5060;branch=z9hG4bKdc87.52e497f3.0;i=6d42cd15 
Via: SIP/2.0/TLS 
192.168.1.58:5070;received=186.146.92.92;branch=z9hG4bK687754333;rport=48658;alias
 
Route:  
From: ;tag=1228599454 
To:  
Call-ID: 943618234-507...@bjc.bgi.b.fi 
CSeq: 2004 REGISTER 
Contact: 
;reg-id=6;+sip.instance=""
 
Authorization: Digest username="106", realm="domain.com", 
nonce="0f668738-a4cd-4ede-9767-51439035aad0", uri="sip:domain.com:5160", 
response="27d5335eb36c0f0c 
6c6d62c6f564fe", algorithm=MD5, cnonce="01204462", qop=auth, nc=0004 
X-Grandstream-PBX: true 
Max-Forwards: 69 
User-Agent: Grandstream GXP2160 1.0.9.127 
Expires: 180 
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, 
UPDATE, MESSAGE 
Content-Length: 0 
Supported: path 
Path:  ___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid registrar g lookup

2018-10-10 Thread Răzvan Crainea

Hello, Slava!

The user is properly URL encoded. Are you calling mid_registrar_lookup() 
[1] to "resolve" this contact, or simple lookup()[2]? You should call 
the first one, because most likely you are also using mid_registrar.


[1] 
https://opensips.org/html/docs/modules/2.4.x/mid_registrar.html#func_mid_registrar_lookup

[2] https://opensips.org/html/docs/modules/2.4.x/registrar.html#func_lookup

Best regards,
Răzvan

On 10/9/18 11:38 PM, Slava Bendersky wrote:

Hello Everyone,
Current setup is full federated cluster with mongo and pgsql.
I see in trace $ru IVITE sip:13is

is INVITE sip:130%40domain.com@10.100.104.8:5060 SIP/2.0

Right now we returning 404 same as m flag lookup. What should happens if 
user found or not found, because I think $rU part is not encoded correctly.



volga629
@10.100.104.8:5060 SIP/2.0

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



--
Răzvan Crainea
OpenSIPS Core Developer
  http://www.opensips-solutions.com

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


[OpenSIPS-Users] mid registrar g lookup

2018-10-09 Thread Slava Bendersky
Hello Everyone,
Current setup is full federated cluster with mongo and pgsql.
I see in trace $ru IVITE sip:13is

is INVITE sip:130%40domain.com@10.100.104.8:5060 SIP/2.0
Right now we returning 404 same as m flag lookup. What should happens if user 
found or not found, because I think $rU part is not encoded correctly.

volga629
@10.100.104.8:5060 SIP/2.0
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid-registrar question

2018-07-25 Thread Dominic
Alexey I basically started over from scratch using your script as a guide
and everything is working fine so far, I wish I could tell what I initially
did wrong, but I had a LOT of strange things in there, being a dev box and
all. Thanks a LOT for the help

On Wed, Jul 25, 2018 at 8:13 AM, Dominic  wrote:

> Thanks Alexey, I will give it another shot first thing this morning.
>
> On Wed, Jul 25, 2018 at 1:05 AM, Alexey Kazantsev via Users <
> users@lists.opensips.org> wrote:
>
>> ... and yes, route[RELAY] is like this:
>>
>>
>> route[RELAY] {
>> if ( !t_relay() ) {
>> send_reply("500","Internal Error");
>> }
>> exit;
>> }
>>
>>
>> or you may simply do:
>>
>> # REGISTER processing
>> if ( is_method("REGISTER") ) {
>> mid_registrar_save("location");
>> switch ($retcode) {
>> case 1:
>> $ru = "sip:10.223.15.21:5070";
>> t_relay();
>> break;
>> case 2:
>> break;
>> default:
>> xlog("L_ERROR", "failed to save
>> registration! ($$ci=$ci)\n");
>> }
>> exit;
>> }
>>
>>
>> Here's the tutorial http://www.opensips.org/Docume
>> ntation/Tutorials-MidRegistrar
>> But keep in mind that it is for OpenSIPS 2.3, as 2.4 does not have
>> 'insertion_mode'
>> option described there.
>>
>>
>> ---
>> BR, Alexey
>> http://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


Re: [OpenSIPS-Users] mid-registrar question

2018-07-25 Thread Dominic
Thanks Alexey, I will give it another shot first thing this morning.

On Wed, Jul 25, 2018 at 1:05 AM, Alexey Kazantsev via Users <
users@lists.opensips.org> wrote:

> ... and yes, route[RELAY] is like this:
>
>
> route[RELAY] {
> if ( !t_relay() ) {
> send_reply("500","Internal Error");
> }
> exit;
> }
>
>
> or you may simply do:
>
> # REGISTER processing
> if ( is_method("REGISTER") ) {
> mid_registrar_save("location");
> switch ($retcode) {
> case 1:
> $ru = "sip:10.223.15.21:5070";
> t_relay();
> break;
> case 2:
> break;
> default:
> xlog("L_ERROR", "failed to save
> registration! ($$ci=$ci)\n");
> }
> exit;
> }
>
>
> Here's the tutorial http://www.opensips.org/Documentation/Tutorials-
> MidRegistrar
> But keep in mind that it is for OpenSIPS 2.3, as 2.4 does not have
> 'insertion_mode'
> option described there.
>
>
> ---
> BR, Alexey
> http://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


Re: [OpenSIPS-Users] mid-registrar question

2018-07-24 Thread Alexey Kazantsev via Users
... and yes, route[RELAY] is like this:


route[RELAY] {
if ( !t_relay() ) {
send_reply("500","Internal Error");
}
exit;
}


or you may simply do:

# REGISTER processing
if ( is_method("REGISTER") ) {
mid_registrar_save("location");
switch ($retcode) {
case 1:
$ru = "sip:10.223.15.21:5070";
t_relay();
break;
case 2:
break;
default:
xlog("L_ERROR", "failed to save registration! 
($$ci=$ci)\n");
}
exit;
}


Here's the tutorial http://www.opensips.org/Documentation/Tutorials-MidRegistrar
But keep in mind that it is for OpenSIPS 2.3, as 2.4 does not have 
'insertion_mode'
option described there.


---
BR, Alexey
http://alexeyka.zantsev.com/
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] mid-registrar question

2018-07-24 Thread Alexey Kazantsev via Users
Hi Dominic!

Could you show your script?

It seems that there's some misconfiguration.

I can share you my own:

...
loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 1)
modparam("mid_registrar", "outgoing_expires", 3600)
modparam("mid_registrar", "retry_after", 30)
...


# REGISTER processing
if ( is_method("REGISTER") ) {
mid_registrar_save("location");
switch ($retcode) {
case 1:
$ru = "sip:10.223.15.21:5070";   # this is to 
be sent to Asterisk
route(RELAY);
break;
case 2:
#xlog("L_INFO", "REGISTER has been 
absorbed!\n");
break;
default:
xlog("L_ERROR", "failed to save registration! 
($$ci=$ci)\n");
}
exit;
}



---
BR, Alexey
http://alexeyka.zantsev.com/
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid-registrar question

2018-07-24 Thread Dominic
Hi all, I'm currently a bit stuck trying to implement a mid-registrar in my
dev environment. My setup is that I have a hardphone that is registering to
opensips, opensips challenges the register, and once authenticated, the
register is sent to an Asterisk server that is setup with no
authentication. The diagram below illustrates this:

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


I have set the mid_registrar.outgoing_expires to 3600 secs, so Opensips
alters the expires in the REGISTER that is sent to asterisk (which is what
I want), however, my issue is that the 3600 seconds gets propagated back to
Alice, through the 200 OK that is replied from Asterisk to OpenSips which
in turn sends it back to Alice.

I was wondering if anyone would know of a way to send back 60 seconds in
the 200 OK that is sent back to Alice so that Alice keeps sending me
REGISTERs every 60 seconds.

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


Re: [OpenSIPS-Users] mid registrar

2018-06-21 Thread Liviu Chircu

Indeed, I agree that this is a solid fix.  Just pushed it, thanks!

Best regards,

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

On 21.06.2018 16:26, vasilevalex wrote:

Hi Liviu.

I installed opensips with these commits on both servers. Now when we make
several switch-overs in short time phones don't loose their registration.
But I have new error in logs:
ERROR:mid_registrar:calc_max_ct_diff: 'expires' key not found!
ERROR:mid_registrar:calc_max_ct_diff: 'expires' key not found!

As I understand function calc_max_ct_diff is searching the same K/V store,
but it is empty.
So it returns error (-1) and process_contacts_by_aor returns 2, so  OpenSIPS
does not forward this REGISTER request but absorbs it.
And I've got situation for several devices when phones think that they are
registered, OpenSIPS think that phones are registered, but REGISTRAR
doesn't.

May be if we have empty K/V it's better to forward request to registrar? I'm
not shure... What do you think?
Thanks.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

___
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

2018-06-21 Thread vasilevalex
Hi Liviu.

I installed opensips with these commits on both servers. Now when we make
several switch-overs in short time phones don't loose their registration.
But I have new error in logs:
ERROR:mid_registrar:calc_max_ct_diff: 'expires' key not found!
ERROR:mid_registrar:calc_max_ct_diff: 'expires' key not found!

As I understand function calc_max_ct_diff is searching the same K/V store,
but it is empty.
So it returns error (-1) and process_contacts_by_aor returns 2, so  OpenSIPS
does not forward this REGISTER request but absorbs it.
And I've got situation for several devices when phones think that they are
registered, OpenSIPS think that phones are registered, but REGISTRAR
doesn't.

May be if we have empty K/V it's better to forward request to registrar? I'm
not shure... What do you think?
Thanks.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] mid registrar

2018-06-20 Thread vasilevalex
Hi Liviu!

Thank you very much. I'll test them and will answer here.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] mid registrar

2018-06-20 Thread Liviu Chircu

Hi, Alex!

I have pushed a set of commits [1], [2] on master branch which fix this 
issue.  Please let me know if you need any more help including them in 
your test build.


Best regards,

[1]: https://github.com/OpenSIPS/opensips/commit/d8fe587cef17421
[2]: https://github.com/OpenSIPS/opensips/commit/78902eb60698ac0

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

On 13.06.2018 16:56, Liviu Chircu wrote:

Hi Alexei,

Indeed, it seems the mid-registrar data ("kv_store" column) only gets 
sync'ed to DB starting with the 2nd REGISTER, despite the 
"write-through" mode.  I'll take a closer look and will update you on 
the progress in this thread.  Thank you for the report!


Best regards,

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

On 12.06.2018 10:47, vasilevalex wrote:

I have issue with very simple setup.

Two OpenSIPS servers (first is Active, second starts with keepalived 
only on
Active server failure, so not a cluster at all) connected to MariaDB 
with

same configs. Asterisk farm is registrar.

# USeR LOCation module
loadmodule "usrloc.so"
modparam("usrloc", "nat_bflag", "NAT")
modparam("usrloc", "working_mode_preset",
"single-instance-sql-write-through")
modparam("usrloc", "db_url", "DB_URL")

 Mid Registrar module
loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 2) /* 0 = mirror / 1 = ct / 2 = AoR */
modparam("mid_registrar", "outgoing_expires", 1800)
modparam("mid_registrar", "received_avp", "$avp(received_uri)")
modparam("mid_registrar", "tcp_persistent_flag",
"TCP_PERSIST_REGISTRATIONS")

This setup works somehow. Failover server starts with all locations
consistent and continues working. But when there are several switching
between Active/Failover in relatively short time, like 5-10 minutes then
most of the phones can't update their registrations because of the 
errors:


ERROR:mid_registrar:process_contacts_by_aor: 'last_reg_ts' key not 
found!


Only cleaning user location helps, like "opensipsctl ul rm " 
After that

phone can register again.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html


___
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

2018-06-20 Thread Slava Bendersky

Thank you for explanation.

volga629

On Fri, Jun 8, 2018 at 6:34 AM, Liviu Chircu  wrote:
First of all: mid-registrar + clustering is still uncharted 
territory, I haven't done any testing yet with this setup.


Disclaimer aside, this setup should somewhat work:

* [CORRECT] mid-registrar saved contacts should propagate through the 
cluster just like with registrar. They will contain the short 
lifetime of the UAC side, not the longer lifetime shown to the 
backend registrar
* [CORRECT] throttled contact updates should propagate through the 
cluster just like with registrar (although we absorb the REGISTER, we 
instruct other nodes to update their cache, so they don't delete the 
contact prematurely)
* [INCORRECT] the mid-registrar semantics (specific fields) are not 
getting replicated to other nodes. If you fail over to another 
mid-registrar within the cluster, you won't be able to throttle 
contacts anymore. In fact, you should see something like:


ERROR:'last_reg_ts' key not found!

, and the handling for the "inherited" REGISTER traffic would 
completely fail.


To sum up: this setup should "kinda" work, but it's not going to be 
fully useful unless we fix it. Replicating the "kv_store" should not 
be complicated at all (actually, it seems to be a 50-line patch at 
most), but it will require the usual bit of testing / fiddling around 
until all corner-cases are covered.


We've not had requests for this feature up until now, but I've logged 
it on GitHub, so we can start a discussion [1]


Best regards,

[1]: https://github.com/OpenSIPS/opensips/issues/1379

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

On 08.06.2018 12:13, volga...@networklab.ca wrote:

Hello Liviu,
What will happened if set federation-cachedb-cluster and mid 
registrar is in use.



volga629

On Fri, Jun 8, 2018 at 5:41 AM, Liviu Chircu  
wrote:

Hi Volga,

The mid-registrar has full DB persistency support since 2.4. It 
works with all the user location presets except the "DB only" 
ones. For example, you only have to set:


modparam("usrloc", "working_mode_preset", 
"single-instance-sql-write-through")


or

modparam("usrloc", "working_mode_preset", 
"single-instance-sql-write-back")


Best regards,

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

On 08.06.2018 02:48, volga...@networklab.ca wrote:

Hello Everyone,
Is possible configure mid registrar with database persistency ?



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



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


Re: [OpenSIPS-Users] mid registrar

2018-06-13 Thread Liviu Chircu

Hi Alexei,

Indeed, it seems the mid-registrar data ("kv_store" column) only gets 
sync'ed to DB starting with the 2nd REGISTER, despite the 
"write-through" mode.  I'll take a closer look and will update you on 
the progress in this thread.  Thank you for the report!


Best regards,

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

On 12.06.2018 10:47, vasilevalex wrote:

I have issue with very simple setup.

Two OpenSIPS servers (first is Active, second starts with keepalived only on
Active server failure, so not a cluster at all) connected to MariaDB with
same configs. Asterisk farm is registrar.

# USeR LOCation module
loadmodule "usrloc.so"
modparam("usrloc", "nat_bflag", "NAT")
modparam("usrloc", "working_mode_preset",
"single-instance-sql-write-through")
modparam("usrloc", "db_url", "DB_URL")

 Mid Registrar module
loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 2) /* 0 = mirror / 1 = ct / 2 = AoR */
modparam("mid_registrar", "outgoing_expires", 1800)
modparam("mid_registrar", "received_avp", "$avp(received_uri)")
modparam("mid_registrar", "tcp_persistent_flag",
"TCP_PERSIST_REGISTRATIONS")

This setup works somehow. Failover server starts with all locations
consistent and continues working. But when there are several switching
between Active/Failover in relatively short time, like 5-10 minutes then
most of the phones can't update their registrations because of the errors:

ERROR:mid_registrar:process_contacts_by_aor: 'last_reg_ts' key not found!

Only cleaning user location helps, like "opensipsctl ul rm " After that
phone can register again.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

___
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

2018-06-12 Thread vasilevalex
I have issue with very simple setup.

Two OpenSIPS servers (first is Active, second starts with keepalived only on
Active server failure, so not a cluster at all) connected to MariaDB with
same configs. Asterisk farm is registrar.

# USeR LOCation module
loadmodule "usrloc.so"
modparam("usrloc", "nat_bflag", "NAT")
modparam("usrloc", "working_mode_preset",
"single-instance-sql-write-through")
modparam("usrloc", "db_url", "DB_URL")

 Mid Registrar module
loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 2) /* 0 = mirror / 1 = ct / 2 = AoR */
modparam("mid_registrar", "outgoing_expires", 1800)
modparam("mid_registrar", "received_avp", "$avp(received_uri)")
modparam("mid_registrar", "tcp_persistent_flag",
"TCP_PERSIST_REGISTRATIONS")

This setup works somehow. Failover server starts with all locations
consistent and continues working. But when there are several switching
between Active/Failover in relatively short time, like 5-10 minutes then
most of the phones can't update their registrations because of the errors:

ERROR:mid_registrar:process_contacts_by_aor: 'last_reg_ts' key not found!

Only cleaning user location helps, like "opensipsctl ul rm " After that
phone can register again.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] mid registrar

2018-06-08 Thread Liviu Chircu
First of all: mid-registrar + clustering is still uncharted territory, I 
haven't done any testing yet with this setup.


Disclaimer aside, this setup should somewhat work:

* [CORRECT] mid-registrar saved contacts should propagate through the 
cluster just like with registrar. They will contain the short lifetime 
of the UAC side, not the longer lifetime shown to the backend registrar
* [CORRECT] throttled contact updates should propagate through the 
cluster just like with registrar (although we absorb the REGISTER, we 
instruct other nodes to update their cache, so they don't delete the 
contact prematurely)
* [INCORRECT] the mid-registrar semantics (specific fields) are not 
getting replicated to other nodes. If you fail over to another 
mid-registrar within the cluster, you won't be able to throttle contacts 
anymore. In fact, you should see something like:


ERROR:'last_reg_ts' key not found!

, and the handling for the "inherited" REGISTER traffic would completely 
fail.


To sum up: this setup should "kinda" work, but it's not going to be 
fully useful unless we fix it. Replicating the "kv_store" should not be 
complicated at all (actually, it seems to be a 50-line patch at most), 
but it will require the usual bit of testing / fiddling around until all 
corner-cases are covered.


We've not had requests for this feature up until now, but I've logged it 
on GitHub, so we can start a discussion [1]


Best regards,

[1]: https://github.com/OpenSIPS/opensips/issues/1379

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

On 08.06.2018 12:13, volga...@networklab.ca wrote:

Hello Liviu,
What will happened if set federation-cachedb-cluster and mid registrar 
is in use.



volga629

On Fri, Jun 8, 2018 at 5:41 AM, Liviu Chircu  wrote:

Hi Volga,

The mid-registrar has full DB persistency support since 2.4. It works 
with all the user location presets except the "DB only" ones. For 
example, you only have to set:


modparam("usrloc", "working_mode_preset", 
"single-instance-sql-write-through")


or

modparam("usrloc", "working_mode_preset", 
"single-instance-sql-write-back")


Best regards,

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

On 08.06.2018 02:48, volga...@networklab.ca wrote:

Hello Everyone,
Is possible configure mid registrar with database persistency ?



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

2018-06-08 Thread volga629

Hello Liviu,
What will happened if set federation-cachedb-cluster and mid registrar 
is in use.



volga629

On Fri, Jun 8, 2018 at 5:41 AM, Liviu Chircu  wrote:

Hi Volga,

The mid-registrar has full DB persistency support since 2.4. It works 
with all the user location presets except the "DB only" ones. For 
example, you only have to set:


modparam("usrloc", "working_mode_preset", 
"single-instance-sql-write-through")


or

modparam("usrloc", "working_mode_preset", 
"single-instance-sql-write-back")


Best regards,

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

On 08.06.2018 02:48, volga...@networklab.ca wrote:

Hello Everyone,
Is possible configure mid registrar with database persistency ?



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

2018-06-08 Thread Liviu Chircu

Hi Volga,

The mid-registrar has full DB persistency support since 2.4. It works 
with all the user location presets except the "DB only" ones. For 
example, you only have to set:


modparam("usrloc", "working_mode_preset", 
"single-instance-sql-write-through")


or

modparam("usrloc", "working_mode_preset", "single-instance-sql-write-back")

Best regards,

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

On 08.06.2018 02:48, volga...@networklab.ca wrote:

Hello Everyone,
Is possible configure mid registrar with database persistency ?



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


Re: [OpenSIPS-Users] mid registrar

2018-06-07 Thread Alexey K . via Users
Hi,

isn't it what you need?

Flag 'm' of mid_registrar_save function - save the contacts only in memory 
cache without no DB operation;

Otherwise, without using it, they are seved in DB.

http://www.opensips.org/html/docs/modules/2.4.x/mid_registrar.html#func_mid_registrar_save


---
BR, Alexey
http://alexeyka.zantsev.com/
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] mid registrar

2018-06-07 Thread volga629

Hello Everyone,
Is possible configure mid registrar with database persistency ?



volga629


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


Re: [OpenSIPS-Users] mid-registrar and WSS

2018-03-14 Thread Esty, Ryan
All,

Never mind it is registering now. I still have some work to do but after more 
investigation the SIP server was deleting the second VIA which was the via for 
WSS. Now on the register I save it to an avp and then in my register's 
onreply_route I just do an append_hf("Via: ..."). The client sipml5 registers 
and now I can try making calls.

Ryan



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


[OpenSIPS-Users] mid-registrar and WSS

2018-03-14 Thread Esty, Ryan
Hi opensips users,

I have a couple of questions and I'm hoping someone can point me in the right 
direction.

We have a SIP PBX that doesn't do WSS for example using sipml5. I'm trying to 
put opensips in the middle of the SIP PBX and the WSS client with limited 
success using mid-registrar in opensips 2.3. If I don't try to pass the 
registration through and just use opensips as my SIP server the WSS client will 
register and calls can be made. If I do put in the mid-registrar and pass 
through the registration to the SIP PBX the SIP PBX will register the phone and 
pass back the 200 OK the client gets a message back but doesn't think it is for 
him because I'm assuming it is missing the VIA. On a successful registration 
the client will see the VIA on the unsuccessful registration the client doesn't 
see the VIA.


My first question is am I using the mid-registrar as designed I'm trying to set 
it up as contact mirroring (mode 0)? If I did pick the correct method why is my 
VIA disappearing and can I get it back? Someone on the list mentioned this 
https://blog.opensips.org/2016/12/13/how-to-proxy-sip-registrations and I will 
try it soon but it seemed the mid-registrar which I don't think was released 
yet was supposed to automatically do this.

This is the debug output when the registration is failed:
SEND: REGISTER sip:192.168.40.175 SIP/2.0
Via: SIP/2.0/WSS 
df7jal23ls0d.invalid;branch=z9hG4bKd7RGgr1eBtcOk2yUuIUuyvIqWk3G3Or0;rport
From: "Skwisgaar Skwigelf";tag=T9XcAa1Am5fIDrtIo68Z
To: "Skwisgaar Skwigelf"
Contact: "Skwisgaar 
Skwigelf";expires=200;click2call=no;+g.oma.sip-im;+audio;language="en,fr"
Call-ID: 766574bd-8060-562d-1f67-24975848739c
CSeq: 5334 REGISTER
Content-Length: 0
Route: 
Max-Forwards: 70
User-Agent: IM-client/OMA1.0 sipML5-v1.2016.03.04
Organization: Doubango Telecom
Supported: path


SIPml-api.js?svn=252:1 ==session event = connecting
SIPml-api.js?svn=252:1 ==session event = sent_request
SIPml-api.js?svn=252:1 __tsip_transport_ws_onmessage
SIPml-api.js?svn=252:1 recv=SIP/2.0 200 OK
From: "Skwisgaar Skwigelf";tag=T9XcAa1Am5fIDrtIo68Z
To: "Skwisgaar 
Skwigelf";tag=83a00482-48f7-4f78-ab314b6aacadc545
Contact: 
;expires=200
Call-ID: 766574bd-8060-562d-1f67-24975848739c
CSeq: 5334 REGISTER
Content-Length: 0
Server: Sphericall/9.1.0 Build/669
Allow: 
INVITE,ACK,CANCEL,OPTIONS,REFER,BYE,REGISTER,SUBSCRIBE,NOTIFY,UPDATE,PRACK,MESSAGE,INFO
Allow-Events: message-summary,presence

This is the debug output when the registration is successful:
SEND: REGISTER sip:192.168.40.175 SIP/2.0
Via: SIP/2.0/WSS 
df7jal23ls0d.invalid;branch=z9hG4bKLpgkzXTPZl5D5ghXuZ1vmNZXUn9nHkMr;rport
From: "Skwisgaar Skwigelf";tag=RyaJ7SLKEeeTS8r9v0BX
To: "Skwisgaar Skwigelf"
Contact: "Skwisgaar 
Skwigelf";expires=200;click2call=no;+g.oma.sip-im;+audio;language="en,fr"
Call-ID: 6e7fe61e-a51f-96cf-a9a0-e3c3785259b9
CSeq: 7252 REGISTER
Content-Length: 0
Route: 
Max-Forwards: 70
User-Agent: IM-client/OMA1.0 sipML5-v1.2016.03.04
Organization: Doubango Telecom
Supported: path


SIPml-api.js?svn=252:1 ==session event = connecting
SIPml-api.js?svn=252:1 __tsip_transport_ws_onmessage
SIPml-api.js?svn=252:1 recv=SIP/2.0 200 OK
Via: SIP/2.0/WSS 
df7jal23ls0d.invalid;rport=60161;received=172.25.111.53;branch=z9hG4bKLpgkzXTPZl5D5ghXuZ1vmNZXUn9nHkMr
From: "Skwisgaar Skwigelf";tag=RyaJ7SLKEeeTS8r9v0BX
To: "Skwisgaar 
Skwigelf";tag=54638b9941aeeb05912f3f3563e30b77.7a8c
Contact: 
;expires=200;received="sip:172.25.111.53:60161;transport=WSS"
Call-ID: 6e7fe61e-a51f-96cf-a9a0-e3c3785259b9
CSeq: 7252 REGISTER
Content-Length: 0
Server: OpenSIPS (2.3.3 (x86_64/linux))

Ryan

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


Re: [OpenSIPS-Users] Mid-Registrar Absorb 2nd Register(w/ AuthHeader) Request - Only on Reg Renewal.

2017-07-12 Thread Liviu Chircu
Thanks for the nice report, Ali - I'm already testing a fix for this, 
and will keep you posted!


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

On 12.07.2017 16:26, Ali Raza wrote:

Hello Guys,

I am new to OpenSIPS. I am currently test mid-registrar module with 
FreeSwitch and I am facing a issue not sure if its a bug or its me.


Let me explain whats happening:

I am running OpenSIPS  mid-registrar in contact-throttling 
mode(mode:1) with usrloc mode:0 - because mid-registrar was crashing 
again and again then I saw the 
post https://github.com/OpenSIPS/opensips/issues/1094 - so that issue 
is now gone with  usrloc mode:0.


When I run opensips my devices(soft phone: zopier and sip phone: 
fanvil) register perfectly but as soon the registration time for 
fanvilphone is reaching expiry(outging expiry) opensips passes my 
registrartion request to freeswitch - Freeswitch sends back 
401unauthorised message which is delivered to the phone by opensips. 
This time phone sends register request with AuthHeader but this 
request gets absorbed by mid-registrar and reply from UAC with 
AuthHeader never reach UAS and freeswitch then remove the 
registrartion from its database assuming the UAC is dead. But when the 
softphone-Zopier outgoing register expiring somehow Softphone sends 
the register request with AuthHeader and as OpenSIPs forwards 1 
register request to freeswtich - Freeswitch renew its registrartion. 
So softphone remain registered and works fine.


2nd/Renew Registration from FanvilPhone:

1. UAC==Reg==>OpenSIPS==>FreeSwitch

2. FreeSwitch==401==>OpenSIPs==401==>UAC

3. UAC==Reg w/Auth-Header==>OpenSIPs(Absorbe by mid-registrar: 
Returncode: 2)


4. OpenSIPs==Reply 200==>UAC (so actually phone thinks its registered)

2nd/Renew Registration from SoftPhone Zopier:

1. SoftPhone==Reg w/Auth-Header==>OpenSIPs==Reg w/Auth-Header==>FreeSwitch

2. FreeSwitch==Reply 200==>OpenSIPs==Reply 200==>SoftPhone-Zopier.


MY OPENSIPS CONFIG -- USED FOR MID-REGISTRAR:

 USeR LOCation module
loadmodule "usrloc.so"
modparam("usrloc", "nat_bflag", "NAT")
modparam("usrloc", "db_mode", 0)
modparam("usrloc", "use_domain", 1)

 MID-REGISTRAR module
loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 1) /* 0 = mirror / 1 = ct / 2 = AoR */
modparam("mid_registrar", "outgoing_expires", 180) ##Set to low for 
testing purpose.

modparam("mid_registrar", "insertion_mode", 0) /* 0 = contact; 1 = path */

if ( !(is_method("REGISTER")) ) {
if (check_source_address("10")) {
  xlog("looking up $ru!\n");
  if (!mid_registrar_lookup("location")) {
   t_reply("404", "Not Found");
   exit;
  }

  t_relay();
  exit;
   }
}

if (is_method("REGISTER"))
{
 #mid_registrar_save("location");
 xlog("BEFORE IT PASS TO MID-REG SAVE!");
 mid_registrar_save("","m");
 switch ($retcode) {
 case 1:
  xlog("forwarding REGISTER to main registrar ($$ci=$ci) - 
$fd\n");

  #Call script to set $ru - Testing!
  #perl_exec("dest_host","$fd");
  $ru = "sip:dispatcher\@10.10.7.206:5070";
  xlog("NEW HOST VALUE: $ru");
  t_relay();
  break;
case 2:
 xlog("absorbing REGISTER! ($$ci=$ci)\n");
 break;
default:
 xlog("failed to save registration! ($$ci=$ci)\n");
}
exit;
}


LET ME KNOW IF YOU NEED ANYTHING ELSE.

THANKS!

Regards
Ali Raza



___
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 Absorb 2nd Register(w/ AuthHeader) Request - Only on Reg Renewal.

2017-07-12 Thread Ali Raza
Hello Guys, 

I am new to OpenSIPS. I am currently test mid-registrar module with FreeSwitch 
and I am facing a issue not sure if its a bug or its me. 

Let me explain whats happening: 

I am running OpenSIPS mid-registrar in contact-throttling mode(mode:1) with 
usrloc mode:0 - because mid-registrar was crashing again and again then I saw 
the post https://github.com/OpenSIPS/opensips/issues/1094 - so that issue is 
now gone with usrloc mode:0. 

When I run opensips my devices(soft phone: zopier and sip phone: fanvil) 
register perfectly but as soon the registration time for fanvilphone is 
reaching expiry(outging expiry) opensips passes my registrartion request to 
freeswitch - Freeswitch sends back 401unauthorised message which is delivered 
to the phone by opensips. This time phone sends register request with 
AuthHeader but this request gets absorbed by mid-registrar and reply from UAC 
with AuthHeader never reach UAS and freeswitch then remove the registrartion 
from its database assuming the UAC is dead. But when the softphone-Zopier 
outgoing register expiring somehow Softphone sends the register request with 
AuthHeader and as OpenSIPs forwards 1 register request to freeswtich - 
Freeswitch renew its registrartion. So softphone remain registered and works 
fine. 

2nd/Renew Registration from FanvilPhone: 

1. UAC==Reg==>OpenSIPS==>FreeSwitch 

2. FreeSwitch==401==>OpenSIPs==401==>UAC 

3. UAC==Reg w/Auth-Header==>OpenSIPs(Absorbe by mid-registrar: Returncode: 2) 

4. OpenSIPs==Reply 200==>UAC (so actually phone thinks its registered) 

2nd/Renew Registration from SoftPhone Zopier: 

1. SoftPhone==Reg w/Auth-Header==>OpenSIPs== Reg w/Auth-Header==>FreeSwitch 

2. FreeSwitch==Reply 200==>OpenSIPs==Reply 200==>SoftPhone-Zopier. 


MY OPENSIPS CONFIG -- USED FOR MID-REGISTRAR: 

 USeR LOCation module 
loadmodule "usrloc.so" 
modparam("usrloc", "nat_bflag", "NAT") 
modparam("usrloc", "db_mode", 0) 
modparam("usrloc", "use_domain", 1) 

 MID-REGISTRAR module 
loadmodule "mid_registrar.so" 
modparam("mid_registrar", "mode", 1) /* 0 = mirror / 1 = ct / 2 = AoR */ 
modparam("mid_registrar", "outgoing_expires", 180) ##Set to low for testing 
purpose. 
modparam("mid_registrar", "insertion_mode", 0) /* 0 = contact; 1 = path */ 

if ( !(is_method("REGISTER")) ) { 
if (check_source_address("10")) { 
xlog("looking up $ru!\n"); 
if (!mid_registrar_lookup("location")) { 
t_reply("404", "Not Found"); 
exit; 
} 

t_relay(); 
exit; 
} 
} 

if (is_method("REGISTER")) 
{ 
#mid_registrar_save("location"); 
xlog("BEFORE IT PASS TO MID-REG SAVE!"); 
mid_registrar_save("","m"); 
switch ($retcode) { 
case 1: 
xlog("forwarding REGISTER to main registrar ($$ci=$ci) - $fd\n"); 
#Call script to set $ru - Testing! 
#perl_exec("dest_host","$fd"); 
$ru = "sip:dispatcher\@10.10.7.206:5070"; 
xlog("NEW HOST VALUE: $ru"); 
t_relay(); 
break; 
case 2: 
xlog("absorbing REGISTER! ($$ci=$ci)\n"); 
break; 
default: 
xlog("failed to save registration! ($$ci=$ci)\n"); 
} 
exit; 
} 


LET ME KNOW IF YOU NEED ANYTHING ELSE. 

THANKS! 

Regards 
Ali Raza 

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