Help with my OpenSips architecture

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with my OpenSips architecture

Dominic
Hi all, just to make sure I'm one the right track here I'd like to share a few thoughts of where I'm currently going with my architecture, any feedback is really appreciated specially if it can help me avoid any pitfalls in the future. Here is what I'm trying to do:

I currently have a a few asterisk servers directly facing the public internet, with sip devices registering directly with a specific asterisk.

So my first goal was to have the sip devices register directly with OpenSips so I used the mid_registrar module for that, and forward the registers to the right asterisk. This seems to work very well so far.

Secondly, I setup rtp proxy, on the same box as opensips, this also seems to work great so far. At this point I should be able to not have the asterisk facing public internet.

The third thing I now want to do, and this is where I am currently stuck is to figure out what my options are in terms of high availability of the opensips. I figured I would go with a VIP setup with 2 identical opensips box. So in this type of setup i would have to replicate usrloc and dialogs between the 2 opensips instances right? Am I forgetting anything?

Am I on the right track with this type of setup or am I missing something big here? It's also worth mentioning that I am using OpenSIPS 2.4

Any advice/links with info on similar setup/code examples are very welcome
Thanks
Dominic

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help with my OpenSips architecture

Bogdan-Andrei Iancu-2
Hi Dominic,

Please see inline.

Regards,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/
On 08/07/2018 10:36 PM, Dominic wrote:
Hi all, just to make sure I'm one the right track here I'd like to share a few thoughts of where I'm currently going with my architecture, any feedback is really appreciated specially if it can help me avoid any pitfalls in the future. Here is what I'm trying to do:

I currently have a a few asterisk servers directly facing the public internet, with sip devices registering directly with a specific asterisk.

So my first goal was to have the sip devices register directly with OpenSips so I used the mid_registrar module for that, and forward the registers to the right asterisk. This seems to work very well so far.

Secondly, I setup rtp proxy, on the same box as opensips, this also seems to work great so far. At this point I should be able to not have the asterisk facing public internet.
Do you intend to move the * boxes to a private network ? or to keep them with public IP, but behind a firewall ?

The third thing I now want to do, and this is where I am currently stuck is to figure out what my options are in terms of high availability of the opensips. I figured I would go with a VIP setup with 2 identical opensips box. So in this type of setup i would have to replicate usrloc and dialogs between the 2 opensips instances right? Am I forgetting anything?
yes, you are on the right tracks - use the dialog replication (with a sharing tag) and usrloc full sharing mode - this will give you the HA you are looking for (in combination with a VIP)

Am I on the right track with this type of setup or am I missing something big here? It's also worth mentioning that I am using OpenSIPS 2.4

Any advice/links with info on similar setup/code examples are very welcome
For the HA, see
    https://blog.opensips.org/2018/03/15/scaling-distributing-and-partitioning-registrations-with-opensips-2-4/
    https://blog.opensips.org/2018/03/23/clustering-ongoing-calls-with-opensips-2-4/
Thanks
Dominic


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help with my OpenSips architecture

Dominic


On Wed, Aug 8, 2018 at 4:52 AM, Bogdan-Andrei Iancu <[hidden email]> wrote:
Hi Dominic,

Please see inline.

Regards,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/
On 08/07/2018 10:36 PM, Dominic wrote:
Hi all, just to make sure I'm one the right track here I'd like to share a few thoughts of where I'm currently going with my architecture, any feedback is really appreciated specially if it can help me avoid any pitfalls in the future. Here is what I'm trying to do:

I currently have a a few asterisk servers directly facing the public internet, with sip devices registering directly with a specific asterisk.

So my first goal was to have the sip devices register directly with OpenSips so I used the mid_registrar module for that, and forward the registers to the right asterisk. This seems to work very well so far.

Secondly, I setup rtp proxy, on the same box as opensips, this also seems to work great so far. At this point I should be able to not have the asterisk facing public internet.
Do you intend to move the * boxes to a private network ? or to keep them with public IP, but behind a firewall ?

Yes I indend to move them to a private network behind a firewall with no public IP.

The third thing I now want to do, and this is where I am currently stuck is to figure out what my options are in terms of high availability of the opensips. I figured I would go with a VIP setup with 2 identical opensips box. So in this type of setup i would have to replicate usrloc and dialogs between the 2 opensips instances right? Am I forgetting anything?
yes, you are on the right tracks - use the dialog replication (with a sharing tag) and usrloc full sharing mode - this will give you the HA you are looking for (in combination with a VIP)

Perfect, I'll give that a shot

Am I on the right track with this type of setup or am I missing something big here? It's also worth mentioning that I am using OpenSIPS 2.4

Any advice/links with info on similar setup/code examples are very welcome
For the HA, see
    https://blog.opensips.org/2018/03/15/scaling-distributing-and-partitioning-registrations-with-opensips-2-4/
    https://blog.opensips.org/2018/03/23/clustering-ongoing-calls-with-opensips-2-4/
Thanks
Dominic


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Thanks a lot for the replies, the help is really appreciated

Dominic


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help with my OpenSips architecture

Dominic
There's something I'm not getting though, I defined my cluster with 2 opensips instances:

# opensipsctl fifo clusterer_list
Cluster:: 1
    Node:: 2 DB_ID=-1 URL=bin:10.0.20.163:5566 Enabled=1 Link_state=Up      Next_hop=2 Description=none

# opensipsctl fifo clusterer_list_topology
Cluster:: 1
    Node:: 1 Neighbours=2
    Node:: 2 Neighbours=1

However it seems usrloc is not synced as seen in the state below:
# opensipsctl fifo clusterer_list_cap
Cluster:: 1
    Capability:: usrloc-contact-repl State=not synced

However if I register 1 sip device on instance 1, I can see the device on both instances if I run "opensipsctl ul show". So it looks as though the usrloc is replicated properly so I wonder why "opensipsctl fifo clusterer_list_cap" has the "not synced" state.

Dominic








On Wed, Aug 8, 2018 at 8:00 AM, Dominic <[hidden email]> wrote:


On Wed, Aug 8, 2018 at 4:52 AM, Bogdan-Andrei Iancu <[hidden email]> wrote:
Hi Dominic,

Please see inline.

Regards,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/
On 08/07/2018 10:36 PM, Dominic wrote:
Hi all, just to make sure I'm one the right track here I'd like to share a few thoughts of where I'm currently going with my architecture, any feedback is really appreciated specially if it can help me avoid any pitfalls in the future. Here is what I'm trying to do:

I currently have a a few asterisk servers directly facing the public internet, with sip devices registering directly with a specific asterisk.

So my first goal was to have the sip devices register directly with OpenSips so I used the mid_registrar module for that, and forward the registers to the right asterisk. This seems to work very well so far.

Secondly, I setup rtp proxy, on the same box as opensips, this also seems to work great so far. At this point I should be able to not have the asterisk facing public internet.
Do you intend to move the * boxes to a private network ? or to keep them with public IP, but behind a firewall ?

Yes I indend to move them to a private network behind a firewall with no public IP.

The third thing I now want to do, and this is where I am currently stuck is to figure out what my options are in terms of high availability of the opensips. I figured I would go with a VIP setup with 2 identical opensips box. So in this type of setup i would have to replicate usrloc and dialogs between the 2 opensips instances right? Am I forgetting anything?
yes, you are on the right tracks - use the dialog replication (with a sharing tag) and usrloc full sharing mode - this will give you the HA you are looking for (in combination with a VIP)

Perfect, I'll give that a shot

Am I on the right track with this type of setup or am I missing something big here? It's also worth mentioning that I am using OpenSIPS 2.4

Any advice/links with info on similar setup/code examples are very welcome
For the HA, see
    https://blog.opensips.org/2018/03/15/scaling-distributing-and-partitioning-registrations-with-opensips-2-4/
    https://blog.opensips.org/2018/03/23/clustering-ongoing-calls-with-opensips-2-4/
Thanks
Dominic


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Thanks a lot for the replies, the help is really appreciated

Dominic



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help with my OpenSips architecture

John Quick
In reply to this post by Dominic
Hi Dominic,

I have a similar setup in a test rig. For comparison, here is the output I
get for the same fifo commands:
opensipsctl fifo clusterer_list
Cluster:: 1
        Node:: 1 DB_ID=1 URL=bin:192.168.0.118:5678 Enabled=1 Link_state=Up
Next_hop=1 Description=vSvr2

opensipsctl fifo clusterer_list_topology
Cluster:: 1
        Node:: 2 Neighbours=1
        Node:: 1 Neighbours=2

opensipsctl fifo clusterer_list_cap
Cluster:: 1
        Capability:: dialog-dlg-repl State=Ok
        Capability:: usrloc-contact-repl State=Ok

Your DB_ID value is very different, but perhaps you're using db_mode 0 -
i.e. node data comes only from the script.

I have a separate local database running on each node and use the following
settings in my script:
All node data are read from the clusterer DB table (db_mode 1, default)
The flags field for node 1 in the clusterer table is set to "seed"
modparam("usrloc", "working_mode_preset", "full-sharing-cluster")
modparam("usrloc", "location_cluster", 1)
modparam("dialog", "db_mode", 0)      // the db_mode for the dialog module
modparam("dialog", "dialog_replication_cluster", 1)
modparam("dialog", "dlg_sharing_tag", "vip1=active")   // on node 2, it is
"vip1=backup"

Also, try restarting the opensips service, always starting node 1 first
(assuming that node has flags="seed").

Hope this helps.

John Quick
Smartvox Limited
Web: www.smartvox.co.uk



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help with my OpenSips architecture

Vlad Patrascu
In reply to this post by Dominic

Hi Dominic,

The state listed by 'clusterer_list_cap' refers to the startup synchronization mechanism. When you register a sip device on an instance, that event is replicated on the spot to the other instances in the cluster, but older registrations are only pulled from other nodes at startup. You probably did not set the "seed" flag for any of the nodes, so the syncing process is unable to bootstrap correctly.

Regards,

Vlad Patrascu
OpenSIPS Developer
http://www.opensips-solutions.com
On 08/08/2018 09:55 PM, Dominic wrote:
There's something I'm not getting though, I defined my cluster with 2 opensips instances:

# opensipsctl fifo clusterer_list
Cluster:: 1
    Node:: 2 DB_ID=-1 URL=bin:10.0.20.163:5566 Enabled=1 Link_state=Up      Next_hop=2 Description=none

# opensipsctl fifo clusterer_list_topology
Cluster:: 1
    Node:: 1 Neighbours=2
    Node:: 2 Neighbours=1

However it seems usrloc is not synced as seen in the state below:
# opensipsctl fifo clusterer_list_cap
Cluster:: 1
    Capability:: usrloc-contact-repl State=not synced

However if I register 1 sip device on instance 1, I can see the device on both instances if I run "opensipsctl ul show". So it looks as though the usrloc is replicated properly so I wonder why "opensipsctl fifo clusterer_list_cap" has the "not synced" state.

Dominic








On Wed, Aug 8, 2018 at 8:00 AM, Dominic <[hidden email]> wrote:


On Wed, Aug 8, 2018 at 4:52 AM, Bogdan-Andrei Iancu <[hidden email]> wrote:
Hi Dominic,

Please see inline.

Regards,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/
On 08/07/2018 10:36 PM, Dominic wrote:
Hi all, just to make sure I'm one the right track here I'd like to share a few thoughts of where I'm currently going with my architecture, any feedback is really appreciated specially if it can help me avoid any pitfalls in the future. Here is what I'm trying to do:

I currently have a a few asterisk servers directly facing the public internet, with sip devices registering directly with a specific asterisk.

So my first goal was to have the sip devices register directly with OpenSips so I used the mid_registrar module for that, and forward the registers to the right asterisk. This seems to work very well so far.

Secondly, I setup rtp proxy, on the same box as opensips, this also seems to work great so far. At this point I should be able to not have the asterisk facing public internet.
Do you intend to move the * boxes to a private network ? or to keep them with public IP, but behind a firewall ?

Yes I indend to move them to a private network behind a firewall with no public IP.

The third thing I now want to do, and this is where I am currently stuck is to figure out what my options are in terms of high availability of the opensips. I figured I would go with a VIP setup with 2 identical opensips box. So in this type of setup i would have to replicate usrloc and dialogs between the 2 opensips instances right? Am I forgetting anything?
yes, you are on the right tracks - use the dialog replication (with a sharing tag) and usrloc full sharing mode - this will give you the HA you are looking for (in combination with a VIP)

Perfect, I'll give that a shot

Am I on the right track with this type of setup or am I missing something big here? It's also worth mentioning that I am using OpenSIPS 2.4

Any advice/links with info on similar setup/code examples are very welcome
For the HA, see
    https://blog.opensips.org/2018/03/15/scaling-distributing-and-partitioning-registrations-with-opensips-2-4/
    https://blog.opensips.org/2018/03/23/clustering-ongoing-calls-with-opensips-2-4/
Thanks
Dominic


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Thanks a lot for the replies, the help is really appreciated

Dominic




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Help with my OpenSips architecture

Dominic
In reply to this post by John Quick
Thanks a lot once again, that was the issue (flags=seed), here is the output of the command now:

# opensipsctl fifo clusterer_list_cap
Cluster:: 1
    Capability:: usrloc-contact-repl State=Ok


Dominic

On Thu, Aug 9, 2018 at 5:13 AM, John Quick <[hidden email]> wrote:
Hi Dominic,

I have a similar setup in a test rig. For comparison, here is the output I
get for the same fifo commands:
opensipsctl fifo clusterer_list
Cluster:: 1
        Node:: 1 DB_ID=1 URL=bin:192.168.0.118:5678 Enabled=1 Link_state=Up
Next_hop=1 Description=vSvr2

opensipsctl fifo clusterer_list_topology
Cluster:: 1
        Node:: 2 Neighbours=1
        Node:: 1 Neighbours=2

opensipsctl fifo clusterer_list_cap
Cluster:: 1
        Capability:: dialog-dlg-repl State=Ok
        Capability:: usrloc-contact-repl State=Ok

Your DB_ID value is very different, but perhaps you're using db_mode 0 -
i.e. node data comes only from the script.

I have a separate local database running on each node and use the following
settings in my script:
All node data are read from the clusterer DB table (db_mode 1, default)
The flags field for node 1 in the clusterer table is set to "seed"
modparam("usrloc", "working_mode_preset", "full-sharing-cluster")
modparam("usrloc", "location_cluster", 1)
modparam("dialog", "db_mode", 0)      // the db_mode for the dialog module
modparam("dialog", "dialog_replication_cluster", 1)
modparam("dialog", "dlg_sharing_tag", "vip1=active")   // on node 2, it is
"vip1=backup"

Also, try restarting the opensips service, always starting node 1 first
(assuming that node has flags="seed").

Hope this helps.

John Quick
Smartvox Limited
Web: www.smartvox.co.uk




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users