Documentation

Documentation.Tutorials-MidRegistrar History

Hide minor edits - Show changes to markup

February 26, 2018, at 06:24 PM by liviu -
Changed line 186 from:

The full script used in this tutorial is available here.

to:

The full script used in this tutorial is available here.

December 20, 2016, at 12:33 PM by liviu -
Changed line 182 from:

The reason for this is that in working modes "1" and "2", the mid-registrar may generate De-REGISTER requests in order to avoid stale registrations on the main registrar. The problem is that by default, it will not be able to authenticate itself to the main registrar since it is not provisioned with any credentials, so the mid-registrar IP address should be white listed on the main registrar in order for de-registrations to work as well.

to:

The explanation for this is that in working modes "1" and "2", the mid-registrar may generate De-REGISTER requests in order to avoid stale registrations on the main registrar. The problem is that by default, it will not be able to authenticate itself to the main registrar since it is not provisioned with any credentials, so the mid-registrar IP address should simply be whitelisted on the main registrar in order for these de-registrations to properly go through.

December 20, 2016, at 12:32 PM by liviu -
Changed line 182 from:

The reason for this is that in working modes "1" and "2", the mid-registrar may generate De-REGISTER requests in order to avoid stale registrations on the main registrar. The problem is that by default, it will not be able to authenticate itself to the main registrar since it does not know any credentials, so the mid-registrar IP address should be white listed on the main registrar in order for de-registrations to work as well.

to:

The reason for this is that in working modes "1" and "2", the mid-registrar may generate De-REGISTER requests in order to avoid stale registrations on the main registrar. The problem is that by default, it will not be able to authenticate itself to the main registrar since it is not provisioned with any credentials, so the mid-registrar IP address should be white listed on the main registrar in order for de-registrations to work as well.

December 20, 2016, at 12:31 PM by liviu -
Changed lines 178-179 from:

User authentication is a mandatory requirement for any real-world VoIP service, so we assume it is enabled for our platform as well. This will require us to white list the mid-registrar IP on the main registrar, and skip authentication for all requests generated by it.

to:

User authentication is a mandatory requirement for any real-world VoIP service, so we assume it is enabled for our platform as well. However, doing so will require additional configuration in order for the mid-registrar to properly work. We will have to whitelist the mid-registrar's IP address on the main registrar, thus skipping SIP authentication for all requests it may generate.

Changed line 182 from:

The reason for this is that in working modes "1" and "2", the mid-registrar may generate De-REGISTER requests in order to avoid stale registrations on the main registrar. The problem is that it will not be able to authenticate itself to the main registrar since it does not know any credentials, so the mid-registrar IP address should be white listed on the main registrar in order for de-registrations to work as well.

to:

The reason for this is that in working modes "1" and "2", the mid-registrar may generate De-REGISTER requests in order to avoid stale registrations on the main registrar. The problem is that by default, it will not be able to authenticate itself to the main registrar since it does not know any credentials, so the mid-registrar IP address should be white listed on the main registrar in order for de-registrations to work as well.

December 20, 2016, at 12:04 PM by liviu -
Changed line 166 from:

In AOR throttling mode, the mid-registrar is aggregating both Alice's contacts (A and B) into a single contact (alice@mid-registrar) when forwarding registrations to the main registrar.

to:

In AOR throttling mode, the mid-registrar is aggregating both Alice's contacts (A and B) into a single contact (alice@mid-registrar) when forwarding registrations to the main registrar.

December 20, 2016, at 12:04 PM by liviu -
Changed line 166 from:

Notice how the mid-registrar is aggregating both Alice's contacts (A and B) into a single contact (alice@mid-registrar) when forwarding registrations to the main registrar.

to:

In AOR throttling mode, the mid-registrar is aggregating both Alice's contacts (A and B) into a single contact (alice@mid-registrar) when forwarding registrations to the main registrar.

December 20, 2016, at 12:00 PM by liviu -
Changed line 16 from:

The OpenSIPS mid-registrar is capable of throttling the amount of SIP registrations flowing through it, on the way to the main registrar. This is possible by extending the SIP Contact expirations on the way out, and then accurately keeping track of both initial and extended values.

to:

The OpenSIPS mid-registrar is capable of throttling the amount of SIP registrations flowing through it, on the way to the main registrar. This is possible by configuring it to extend the SIP Contact expirations on the way out, and then accurately keeping track of both initial and extended values.

December 20, 2016, at 11:56 AM by liviu -
Deleted line 15:

By making use of the powerful SIP user location implementation in

Changed line 20 from:

The module may also handle SIP call forking. Both serial/parallel forking can be achieved with the mid-registrar, thus potentially freeing up even more resources for the existing servers. This, in turn, will allow you to expand your user base with no additional software costs, minimal configuration of the current components and close to no additional hardware.

to:

The module may also handle SIP call forking. Both serial/parallel forking can be achieved with the mid-registrar, potentially freeing up even more resources for the existing servers. This, in turn, will allow you to expand your user base with no additional software costs, minimal configuration of the current components and close to no additional hardware.

December 20, 2016, at 11:56 AM by liviu -
Added line 16:

By making use of the powerful SIP user location implementation in

Changed line 21 from:

Call forking is another feature closely related to the OpenSIPS registrars. Both serial/parallel forking can be achieved with the mid-registrar as well, thus potentially freeing up even more resources for the existing servers. This, in turn, will allow you to expand your user base with no additional software costs, minimal configuration of the current components and close to no additional hardware.

to:

The module may also handle SIP call forking. Both serial/parallel forking can be achieved with the mid-registrar, thus potentially freeing up even more resources for the existing servers. This, in turn, will allow you to expand your user base with no additional software costs, minimal configuration of the current components and close to no additional hardware.

December 20, 2016, at 11:45 AM by liviu -
Changed line 124 from:
Call flow (throttled registrations)
to:
Call flow (throttling registrations by Contact)
December 20, 2016, at 11:45 AM by liviu -
Changed line 138 from:

The mid-registrar can additionally take over all call forking responsibilities. We only need to switch it to "mode = 2" (AOR throttling).

to:

The mid-registrar can additionally take over all call forking responsibilities. In order to enable this, we only need to switch it to "mode = 2" (AOR throttling).

December 20, 2016, at 11:44 AM by liviu -
Added lines 159-166:
Call flow (throttling registrations by AOR)

http://opensips.org/pub/images/mid-registrar-aor-throttling.png


Notice how the mid-registrar is aggregating both Alice's contacts (A and B) into a single contact (alice@mid-registrar) when forwarding registrations to the main registrar.

December 20, 2016, at 11:36 AM by liviu -
Changed line 166 from:

This call flow shows how the mid-registrar's "AOR throttling" mode allows it to take over all parallel forking responsibilities, freeing up even more resources for the main registrar.

to:

This call flow shows how the mid-registrar's "AOR throttling" mode allows it to take over all call forking responsibilities, freeing up even more resources for the main registrar.

December 20, 2016, at 11:36 AM by liviu -
Changed line 166 from:

This call flow shows how the mid-registrar's "AOR throttling" mode allows it to take over all call forking responsibilities, freeing up even more resources for the main registrar.

to:

This call flow shows how the mid-registrar's "AOR throttling" mode allows it to take over all parallel forking responsibilities, freeing up even more resources for the main registrar.

December 20, 2016, at 11:35 AM by liviu -
Changed line 166 from:

This call flow shows how the mid-registrar "AOR throttling" mode also causes it to take over all call forking responsibilities, freeing up even more resources for the main registrar.

to:

This call flow shows how the mid-registrar's "AOR throttling" mode allows it to take over all call forking responsibilities, freeing up even more resources for the main registrar.

December 20, 2016, at 11:26 AM by liviu -
Changed line 158 from:

Although the rest of the script stays the same, the mid_registrar_save() and mid_registrar_lookup() will behave differently. For example, when saving contacts, all Contact header fields of REGISTER requests will be aggregated into a single one. When looking up contacts, the entire branch set will be populated (see $branch), thus preparing to fork calls in parallel.

to:

Although the rest of the script stays the same, the mid_registrar_save() and mid_registrar_lookup() functions will behave differently. For example, when saving contacts, all Contact header fields of REGISTER requests will be aggregated into a single one. When looking up contacts, the entire branch set will be populated (see $branch), thus preparing to fork calls in parallel.

December 20, 2016, at 11:26 AM by liviu -
Changed line 154 from:
  • "mode" - the working mode of the module. In this case, "2" means "AOR throttling", where the module will both reduce the amount of registration traffic sent to the main registrar and also aggregate contacts into a single one when forwarding registrations to it. The latter feature will allow it to do parallel forking.
to:
  • "mode" - the working mode of the module. In this case, "2" means "AOR throttling", where the module will both reduce the amount of registration traffic sent to the main registrar and also aggregate contacts into a single one when forwarding registrations to it. The latter will allow it to do parallel forking.
December 20, 2016, at 11:25 AM by liviu -
Added line 138:

The mid-registrar can additionally take over all call forking responsibilities. We only need to switch it to "mode = 2" (AOR throttling).

December 20, 2016, at 11:21 AM by liviu -
Added lines 132-134:


Notice how each of Alice's devices first registers with both registrars, after which subsequent registrations are absorbed at mid-registrar level.

December 20, 2016, at 11:18 AM by liviu -
Changed line 52 from:

First, we will configure the mid-registrar to greatly increase the outgoing Contact expiration values. After doing so, it will internally keep track of the extended expirations as well, in order to decide if a REGISTER should be forwarded to the main registrar or not.

to:

First, we will configure the mid-registrar to greatly increase the outgoing Contact expiration values. After doing so, it will internally keep track of the initial expirations as well as the extended ones, in order to decide if a REGISTER should be forwarded to the main registrar or not.

December 20, 2016, at 11:17 AM by liviu -
Changed line 52 from:

First, we will configure the mid-registrar to reduce the outgoing Contact expiration values. After doing so, it will internally keep track of the extended expirations as well, in order to decide if a REGISTER should be forwarded to the main registrar or not.

to:

First, we will configure the mid-registrar to greatly increase the outgoing Contact expiration values. After doing so, it will internally keep track of the extended expirations as well, in order to decide if a REGISTER should be forwarded to the main registrar or not.

December 20, 2016, at 11:15 AM by liviu -
Changed line 48 from:

In the following, we will extend the default OpenSIPS script with mid-registrar capabilities in two steps. This will actually showcase two working modes of the module, namely: contact throttling and AOR throttling.

to:

In the following, we will extend the default OpenSIPS script with mid-registrar capabilities in two steps. By doing this, we will actually go through two working modes of the module: contact throttling and AOR throttling.

December 20, 2016, at 11:14 AM by liviu -
December 19, 2016, at 07:30 PM by liviu -
Changed line 130 from:

http://opensips.org/pub/images/mid-registrar-aor-throttling.png

to:

http://opensips.org/pub/images/mid-registrar-contact-throttling.png

December 19, 2016, at 07:13 PM by liviu -
Changed line 156 from:
Call flow (call forking)
to:
Call flow (parallel forking)
December 19, 2016, at 07:12 PM by liviu -
Changed line 154 from:

Although the rest of the script stays the same, the mid_registrar_save() and mid_registrar_lookup() will behave differently. For example, when saving the contacts, all Contact header fields of REGISTER requests will be aggregated into a single one. When looking up contacts, the entire branch set will be populated (see $branch), thus preparing to fork calls in parallel.

to:

Although the rest of the script stays the same, the mid_registrar_save() and mid_registrar_lookup() will behave differently. For example, when saving contacts, all Contact header fields of REGISTER requests will be aggregated into a single one. When looking up contacts, the entire branch set will be populated (see $branch), thus preparing to fork calls in parallel.

December 19, 2016, at 07:11 PM by liviu -
Changed line 150 from:
  • "mode" - the working mode of the module. In this case, "2" means "AOR throttling", where the module will both reduce the amount of registration traffic sent to the main registrar and also aggregate contacts into a single one when forwarding registrations to it. The latter will allow it to do parallel forking.
to:
  • "mode" - the working mode of the module. In this case, "2" means "AOR throttling", where the module will both reduce the amount of registration traffic sent to the main registrar and also aggregate contacts into a single one when forwarding registrations to it. The latter feature will allow it to do parallel forking.
December 19, 2016, at 07:10 PM by liviu -
Changed line 122 from:

Contact lookup is almost identical to the stock OpenSIPS script. The only big difference is that we are using mid_registrar_lookup() instead of lookup(). Note that mid_registrar_lookup() will behave according to the insertion and working modes. In our case, it will only populate the Request-URI variable (see $ru) since it is configured with "mode = 1".

to:

Contact lookup is almost identical to the stock OpenSIPS script. The only big difference is that we are using mid_registrar_lookup() instead of lookup(). Note that mid_registrar_lookup() will behave according to the insertion and working modes. In our case, it will only populate the Request-URI variable (see $ru) since the module is in working "mode = 1".

December 19, 2016, at 07:10 PM by liviu -
Changed line 122 from:

Contact lookup is almost identical to the stock OpenSIPS script. The only big difference is that we are using mid_registrar_lookup() instead of lookup(). Note that mid_registrar_lookup() will behave according to the insertion and working modes. In our case, it will only populate one branch for each call, since it is configured with "mode = 2".

to:

Contact lookup is almost identical to the stock OpenSIPS script. The only big difference is that we are using mid_registrar_lookup() instead of lookup(). Note that mid_registrar_lookup() will behave according to the insertion and working modes. In our case, it will only populate the Request-URI variable (see $ru) since it is configured with "mode = 1".

December 19, 2016, at 07:08 PM by liviu -
Changed line 59 from:

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

to:

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

Changed line 140 from:

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

to:

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

December 19, 2016, at 07:07 PM by liviu -
Changed lines 50-51 from:
Contact throttling
to:
Throttling registrations
Changed line 59 from:

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

to:

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

Changed line 69 from:
  • "mode" - the working mode of the module. In this case, "2" means "AOR throttling", where the module will both reduce the amount of registration traffic sent to the main registrar, and also aggregate contacts into a single one when forwarding registrations to it.
to:
  • "mode" - the working mode of the module. In this case, "1" means "Contact throttling", where the module will reduce the amount of registration traffic sent to the main registrar
Changed lines 73-74 from:
REGISTER handling
to:
REGISTER handling
Changed lines 97-100 from:

For all registrations, we make sure to call mid_registrar_save(). As stated in its documentation, it will not process the contacts immediately, but rather do the necessary changes to the REGISTER request before it is relayed to the main registrar, while also preparing to transparently handle its replies. The above code stays the same regardless of the module's working mode or insertion mode. We are now done with REGISTER request handling!

INVITE handling
to:

For all registrations, we make sure to call mid_registrar_save(). As stated in its documentation, it will not process the contacts immediately, but rather do the necessary changes to the REGISTER request before it is relayed to the main registrar, while also preparing to transparently handle its replies. The above code stays the same regardless of the module's working mode or insertion mode. We are now done with REGISTER request handling!

INVITE handling
Changed lines 122-129 from:

Contact lookup is almost identical to the stock OpenSIPS script. The only big difference is that we are using mid_registrar_lookup() instead of lookup(). Note that mid_registrar_lookup() will behave according to the insertion and working modes. In our case, it may populate more than one branch for this call, since "mode = 2" instructs the mid-registrar to also take over parallel forking.

SIP Call flows

Registration (AOR throttling)

The diagram below shows two devices of the same user (A and B) periodically registering to the platform. In "AOR throttling" mode, the main registrar will only be notified about the presence of the AOR on the mid-registrar, rather than each of its devices. When receiving calls for this AOR, the mid-registrar will ensure they are delivered to each user device, in parallel.

to:

Contact lookup is almost identical to the stock OpenSIPS script. The only big difference is that we are using mid_registrar_lookup() instead of lookup(). Note that mid_registrar_lookup() will behave according to the insertion and working modes. In our case, it will only populate one branch for each call, since it is configured with "mode = 2".

Call flow (throttled registrations)

The diagram below shows two devices of the same user (A and B) periodically registering to the platform. In "Contact throttling" mode, the main registrar will be notified about the presence of each SIP contact on the mid-registrar. When receiving a call, the mid-registrar will simply relay it to the user.

Changed lines 132-135 from:
Calling (parallel forking)

This call flow shows how the mid-registrar "AOR throttling" mode also causes it to take over all call forking responsibilities, freeing up even more resources for the main registrar.

to:
Parallel forking support
Module configuration
loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", '''2''') /* 0 = mirror / 1 = ct / 2 = AoR */
modparam("mid_registrar", "outgoing_expires", 7200)
modparam("mid_registrar", "insertion_mode", 0) /* 0 = contact; 1 = path */
Added lines 148-157:

Additional explanations:

  • "mode" - the working mode of the module. In this case, "2" means "AOR throttling", where the module will both reduce the amount of registration traffic sent to the main registrar and also aggregate contacts into a single one when forwarding registrations to it. The latter will allow it to do parallel forking.


Although the rest of the script stays the same, the mid_registrar_save() and mid_registrar_lookup() will behave differently. For example, when saving the contacts, all Contact header fields of REGISTER requests will be aggregated into a single one. When looking up contacts, the entire branch set will be populated (see $branch), thus preparing to fork calls in parallel.

Call flow (call forking)
Added lines 159-162:


This call flow shows how the mid-registrar "AOR throttling" mode also causes it to take over all call forking responsibilities, freeing up even more resources for the main registrar.

December 19, 2016, at 06:52 PM by liviu -
Changed lines 12-13 from:

This tutorial will teach you how to configure an OpenSIPS mid-registrar in front of an existing SIP PBX or registrar. We will configure this new component to take over most of the SIP registrations and all call forking for the existing server. This will allow you to leverage existing infrastructure in order to continue to grow (as subscribers and as registration traffic) while keeping the existing low-resources registrar server.

to:

This tutorial will teach you how to configure an OpenSIPS mid-registrar in front of an existing SIP PBX or registrar. We will configure this new component to take over most of the SIP registrations and all call forking for the existing server. This will allow you to leverage existing infrastructure in order to continue to grow (as subscribers and as registration traffic) while keeping the current low-resources registrar server.

Changed lines 48-50 from:

Let's extend the default OpenSIPS script with mid-registrar capabilities, step by step:

Module configuration
to:

In the following, we will extend the default OpenSIPS script with mid-registrar capabilities in two steps. This will actually showcase two working modes of the module, namely: contact throttling and AOR throttling.

Contact throttling

First, we will configure the mid-registrar to reduce the outgoing Contact expiration values. After doing so, it will internally keep track of the extended expirations as well, in order to decide if a REGISTER should be forwarded to the main registrar or not.

Module configuration
December 19, 2016, at 06:44 PM by liviu -
Changed lines 12-17 from:

This tutorial will teach you how to deploy an OpenSIPS mid-registrar to an existing platform (e.g. a hosted PBX) in order to throttle the amount of registrations flowing into its existing servers. This will allow you to expand your user base and grow your business with no additional software costs, minimal configuration of the current components and close to no additional hardware.

Example scenario

http://www.opensips.org/pub/images/mid-registrar-platform-before.png

to:

This tutorial will teach you how to configure an OpenSIPS mid-registrar in front of an existing SIP PBX or registrar. We will configure this new component to take over most of the SIP registrations and all call forking for the existing server. This will allow you to leverage existing infrastructure in order to continue to grow (as subscribers and as registration traffic) while keeping the existing low-resources registrar server.

How does the mid-registrar work?

The OpenSIPS mid-registrar is capable of throttling the amount of SIP registrations flowing through it, on the way to the main registrar. This is possible by extending the SIP Contact expirations on the way out, and then accurately keeping track of both initial and extended values.


Call forking is another feature closely related to the OpenSIPS registrars. Both serial/parallel forking can be achieved with the mid-registrar as well, thus potentially freeing up even more resources for the existing servers. This, in turn, will allow you to expand your user base with no additional software costs, minimal configuration of the current components and close to no additional hardware.

Scenario

December 19, 2016, at 03:14 PM by liviu -
Changed line 56 from:
  • "mode" - the working mode of the mid_registrar module. In this case, "2" means "AOR throttling", where the module will both reduce the amount of registration traffic sent to the main registrar, and also aggregate contacts into a single one when forwarding registrations to it.
to:
  • "mode" - the working mode of the module. In this case, "2" means "AOR throttling", where the module will both reduce the amount of registration traffic sent to the main registrar, and also aggregate contacts into a single one when forwarding registrations to it.
December 19, 2016, at 03:14 PM by liviu -
Changed line 54 from:

We first load the module and set its parameters. Going through each parameter:

to:

We first load the mid_registrar module and set its parameters. Going through each parameter:

December 16, 2016, at 02:08 PM by liviu -
Changed line 135 from:

The reason for this is that in working modes "1" and "2" the mid-registrar may generate De-REGISTER requests in order to avoid stale registrations on the main registrar). The problem is that it will not be able to authenticate itself to the main registrar since it does not know any credentials, so the mid-registrar IP address should be white listed on the main registrar in order for de-registrations to work as well.

to:

The reason for this is that in working modes "1" and "2", the mid-registrar may generate De-REGISTER requests in order to avoid stale registrations on the main registrar. The problem is that it will not be able to authenticate itself to the main registrar since it does not know any credentials, so the mid-registrar IP address should be white listed on the main registrar in order for de-registrations to work as well.

December 16, 2016, at 02:08 PM by liviu -
Changed lines 131-135 from:

Assuming the existing platform is using SIP authentication (if not, then please enable it!!), note that in working modes "1" and "2", the mid-registrar may generate De-REGISTER requests, in order to avoid stale registrations on the main registrar. Since by default, OpenSIPS will not be able to authenticate itself to the main registrar (it has no credentials!), the mid-registrar IP address should be white listed on the main registrar.

to:

User authentication is a mandatory requirement for any real-world VoIP service, so we assume it is enabled for our platform as well. This will require us to white list the mid-registrar IP on the main registrar, and skip authentication for all requests generated by it.


The reason for this is that in working modes "1" and "2" the mid-registrar may generate De-REGISTER requests in order to avoid stale registrations on the main registrar). The problem is that it will not be able to authenticate itself to the main registrar since it does not know any credentials, so the mid-registrar IP address should be white listed on the main registrar in order for de-registrations to work as well.

December 16, 2016, at 12:46 PM by liviu -
Changed lines 56-57 from:
  • "mode" - the working mode of the mid_registrar module. In this case, "2" means "AOR throttling", where the module will both reduce the amount of registration traffic to the main registrar, and also aggregate contacts into a single one when forwarding registrations to it.
  • "outgoing_expires" - the default value for the expirations of the contacts that the mid-registrar will relay to the main registrar. The mid_registrar_save() function also has a similar optional parameter, for more fine grained control.
to:
  • "mode" - the working mode of the mid_registrar module. In this case, "2" means "AOR throttling", where the module will both reduce the amount of registration traffic sent to the main registrar, and also aggregate contacts into a single one when forwarding registrations to it.
  • "outgoing_expires" - the default value for the expirations of the contacts that the mid-registrar relays to the main registrar. The mid_registrar_save() function also has a similar optional parameter, for more fine grained control.
December 16, 2016, at 12:43 PM by liviu -
Changed line 32 from:

By adding this mid-registrar traffic conversion front-end for our servers, we will reduce their incoming rate of registrations. This, in turn, will free up a lot of platform resources, allowing it to redirect its resources to handling more subscribers. The resulting architecture will resemble the following:

to:

By adding this inexpensive mid-registrar traffic conversion front-end for our servers, we will reduce their incoming rate of registrations. This, in turn, will free up a lot of platform resources, allowing it to redirect its resources to handling more subscribers. The resulting architecture will resemble the following:

December 16, 2016, at 12:43 PM by liviu -
Changed line 32 from:

By adding this mid-registrar traffic conversion front-end for our servers, we will reduce the rate of outgoing registrations. This, in turn, will free up a lot of platform resources, allowing it to redirect its resources to handling more subscribers. The resulting architecture will resemble the following:

to:

By adding this mid-registrar traffic conversion front-end for our servers, we will reduce their incoming rate of registrations. This, in turn, will free up a lot of platform resources, allowing it to redirect its resources to handling more subscribers. The resulting architecture will resemble the following:

December 16, 2016, at 12:31 PM by liviu -
Added lines 122-125:

This call flow shows how the mid-registrar "AOR throttling" mode also causes it to take over all call forking responsibilities, freeing up even more resources for the main registrar.

\\

December 16, 2016, at 12:29 PM by liviu -
Changed line 115 from:

The diagram below shows two devices of the same user (A and B) registering to the platform. In "AOR throttling" mode, the main registrar will only be notified about the presence of the AOR on the mid-registrar, rather than each of its devices. When receiving calls for this AOR, the mid-registrar will ensure they are delivered to each user device, in parallel.

to:

The diagram below shows two devices of the same user (A and B) periodically registering to the platform. In "AOR throttling" mode, the main registrar will only be notified about the presence of the AOR on the mid-registrar, rather than each of its devices. When receiving calls for this AOR, the mid-registrar will ensure they are delivered to each user device, in parallel.

December 16, 2016, at 12:29 PM by liviu -
Added lines 114-117:

The diagram below shows two devices of the same user (A and B) registering to the platform. In "AOR throttling" mode, the main registrar will only be notified about the presence of the AOR on the mid-registrar, rather than each of its devices. When receiving calls for this AOR, the mid-registrar will ensure they are delivered to each user device, in parallel.

\\

December 15, 2016, at 07:24 PM by liviu -
Changed line 111 from:

Call flows

to:

SIP Call flows

December 15, 2016, at 07:00 PM by liviu -
Changed line 28 from:

After several phases of testing, we later find out that registration processing is rather expensive on the current system, which turns registration traffic processing into a bottleneck. A cheap solution to this problem is to integrate an OpenSIPS mid-registrar into our platform, since it is capable of converting incoming high-rate registration traffic (mobile users to mid-registrar) into a low-rate variant (mid-registrar to main registrar). Its main jobs will include soaking up most of this registration traffic, as well as handling parallel forking.

to:

After several phases of testing, we later find out that registration processing is rather expensive on the current system, which immediately turns it into a bottleneck. A cheap solution to this problem is to integrate an OpenSIPS mid-registrar into our platform, since it is capable of converting incoming high-rate registration traffic (mobile users to mid-registrar) into a low-rate variant (mid-registrar to main registrar). Its main jobs will include soaking up most of this registration traffic, as well as handling parallel forking.

December 15, 2016, at 07:00 PM by liviu -
Changed line 24 from:

Our task is to find a solution to scale the platform to 500,000 subscribers. We first do an assessment of the types of VoIP traffic being handled by the platform, only to reach an interesting conclusion: 70%+ of the traffic that is hitting our servers is made up of REGISTER requests! Is this correct? Well, it might be, as mobile devices have short registration lifetimes (60 seconds). With this conclusion, we have spotted a potential bottleneck: registration traffic handling!

to:

Our task is to find a solution to scale the platform to 500,000 subscribers. We first do an assessment of the types of VoIP traffic being handled by the platform, only to reach an interesting conclusion: 80%+ of the traffic that is hitting our servers is made up of REGISTER requests! Is this correct? Well, it might be, as mobile devices have short registration lifetimes (60 seconds). With this conclusion, we have spotted a potential bottleneck: registration traffic handling!

December 15, 2016, at 06:59 PM by liviu -
Changed line 20 from:

This is our initial example VoIP platform. Its services are provided by a layer of multi-purpose servers (represented as the main registrar box). To name a few services of this current platform: conferencing, call pickup and internet messaging (IM). Currently, the platform servers are reaching peak usage around 50,000 mobile device subscribers.

to:

This is our initial example VoIP platform. Its services are provided by a layer of multi-purpose servers (represented as the main registrar box). To name a few services of this current platform: conferencing, call pickup and internet messaging (IM). Currently, the platform servers seem to reach peak usage when handling around 50,000 mobile device subscribers.

December 15, 2016, at 06:58 PM by liviu -
Changed line 20 from:

This is our initial example VoIP platform. Its services are provided by a layer of multi-purpose servers (represented as the main registrar box). To name a few services of the current platform: conferencing, call pickup and internet messaging (IM). Currently, the platform servers are reaching peak usage around 50,000 mobile device subscribers.

to:

This is our initial example VoIP platform. Its services are provided by a layer of multi-purpose servers (represented as the main registrar box). To name a few services of this current platform: conferencing, call pickup and internet messaging (IM). Currently, the platform servers are reaching peak usage around 50,000 mobile device subscribers.

December 15, 2016, at 06:55 PM by liviu -
Changed line 12 from:

This tutorial will teach you how to deploy an OpenSIPS mid-registrar to an existing platform (e.g. a hosted PBX) in order to reduce the rate of registrations to its existing servers. This will allow you to expand your user base and grow your business with no additional software costs, minimal configuration of the current components and close to no additional hardware.

to:

This tutorial will teach you how to deploy an OpenSIPS mid-registrar to an existing platform (e.g. a hosted PBX) in order to throttle the amount of registrations flowing into its existing servers. This will allow you to expand your user base and grow your business with no additional software costs, minimal configuration of the current components and close to no additional hardware.

December 15, 2016, at 06:54 PM by liviu -
Changed line 28 from:

After several phases of testing, we later find out that registration processing is rather expensive on the current system, which turns registration traffic processing into a bottleneck. A cheap solution to this problem is to integrate an OpenSIPS mid-registrar into our platform, capable of converting incoming high-rate registration traffic (mobile users to mid-registrar) into a low-rate variant (mid-registrar to main registrar). Its main jobs will include soaking up most of this registration traffic, as well as handling parallel forking.

to:

After several phases of testing, we later find out that registration processing is rather expensive on the current system, which turns registration traffic processing into a bottleneck. A cheap solution to this problem is to integrate an OpenSIPS mid-registrar into our platform, since it is capable of converting incoming high-rate registration traffic (mobile users to mid-registrar) into a low-rate variant (mid-registrar to main registrar). Its main jobs will include soaking up most of this registration traffic, as well as handling parallel forking.

December 15, 2016, at 06:53 PM by liviu -
Changed lines 28-29 from:

After several phases of testing, we later find out that registration processing is rather expensive on the current system, which turns registration traffic processing into a bottleneck. So we proceed with implementing a front-end OpenSIPS registrar, dedicated to soaking up most of this registration traffic, as well as handling parallel forking.

to:

After several phases of testing, we later find out that registration processing is rather expensive on the current system, which turns registration traffic processing into a bottleneck. A cheap solution to this problem is to integrate an OpenSIPS mid-registrar into our platform, capable of converting incoming high-rate registration traffic (mobile users to mid-registrar) into a low-rate variant (mid-registrar to main registrar). Its main jobs will include soaking up most of this registration traffic, as well as handling parallel forking.

Changed line 32 from:

By adding this mid-registrar front-end, which is capable of dramatically lowering incoming registration traffic for these servers, we will reduce the rate of outgoing registrations (mid-registrar to main registrar). This, in turn, will free up a lot of platform resources, allowing it to redirect its resources to handling more subscribers. The resulting architecture will resemble the following:

to:

By adding this mid-registrar traffic conversion front-end for our servers, we will reduce the rate of outgoing registrations. This, in turn, will free up a lot of platform resources, allowing it to redirect its resources to handling more subscribers. The resulting architecture will resemble the following:

December 15, 2016, at 06:48 PM by liviu -
Changed line 32 from:

By adding a mid-registrar traffic conversion front-end for these servers, we will reduce the rate of outgoing registrations (mid-registrar to main registrar). This, in turn, will free up a lot of platform resources, allowing it to redirect its resources to handling more subscribers. The resulting architecture will resemble the following:

to:

By adding this mid-registrar front-end, which is capable of dramatically lowering incoming registration traffic for these servers, we will reduce the rate of outgoing registrations (mid-registrar to main registrar). This, in turn, will free up a lot of platform resources, allowing it to redirect its resources to handling more subscribers. The resulting architecture will resemble the following:

December 15, 2016, at 06:47 PM by liviu -
Changed lines 24-25 from:

Our task is to find a solution to scale the platform to 500,000 subscribers. We first do an assessment of the types of VoIP traffic being handled by the platform, only to reach an interesting conclusion: 70%+ of the traffic that is hitting our servers is made up of REGISTER requests! Is this correct? Well, it might be, as mobile devices have short registration lifetimes (60 seconds). With this conclusion, we have spotted a potential bottleneck: registration traffic handling! Several phases of testing later reveal that registration processing is rather expensive on the current system. So we proceed with implementing a front-end OpenSIPS registrar, dedicated to soaking up most of the registration traffic, as well as handling parallel forking.

to:

Our task is to find a solution to scale the platform to 500,000 subscribers. We first do an assessment of the types of VoIP traffic being handled by the platform, only to reach an interesting conclusion: 70%+ of the traffic that is hitting our servers is made up of REGISTER requests! Is this correct? Well, it might be, as mobile devices have short registration lifetimes (60 seconds). With this conclusion, we have spotted a potential bottleneck: registration traffic handling!


After several phases of testing, we later find out that registration processing is rather expensive on the current system, which turns registration traffic processing into a bottleneck. So we proceed with implementing a front-end OpenSIPS registrar, dedicated to soaking up most of this registration traffic, as well as handling parallel forking.

December 15, 2016, at 06:44 PM by liviu -
Changed line 24 from:

Our task is to find a solution to scale the platform to 500,000 subscribers. We first do an assessment of the types of VoIP traffic being handled by the platform, only to reach an interesting conclusion: 70%+ of the traffic that is hitting our servers is made up of REGISTER requests! Is this correct? Well, it might be, as mobile devices have short registration lifetimes (60 seconds). With this conclusion, we have spotted the bottleneck: registration traffic handling! So we proceed with implementing a front-end registrar, capable of soaking up this specific type of traffic.

to:

Our task is to find a solution to scale the platform to 500,000 subscribers. We first do an assessment of the types of VoIP traffic being handled by the platform, only to reach an interesting conclusion: 70%+ of the traffic that is hitting our servers is made up of REGISTER requests! Is this correct? Well, it might be, as mobile devices have short registration lifetimes (60 seconds). With this conclusion, we have spotted a potential bottleneck: registration traffic handling! Several phases of testing later reveal that registration processing is rather expensive on the current system. So we proceed with implementing a front-end OpenSIPS registrar, dedicated to soaking up most of the registration traffic, as well as handling parallel forking.

December 15, 2016, at 06:31 PM by liviu -
Changed line 28 from:

By adding a mid-registrar traffic conversion front-end for these servers, we will free up a lot of platform resources, allowing it to redirect its resources to handling more subscribers. The resulting architecture will resemble the following:

to:

By adding a mid-registrar traffic conversion front-end for these servers, we will reduce the rate of outgoing registrations (mid-registrar to main registrar). This, in turn, will free up a lot of platform resources, allowing it to redirect its resources to handling more subscribers. The resulting architecture will resemble the following:

December 15, 2016, at 06:25 PM by liviu -
Changed lines 24-25 from:

Our task is to find a solution to scale the platform to 500,000 subscribers. We first do an assessment of the types of VoIP traffic being handled by the platform, only to reach an interesting conclusion: 70%+ of the traffic that is hitting our servers is made up of REGISTER requests! Is this correct? Well, it might be, as mobile devices have short registration lifetimes (60 seconds). So we proceed with implementing a front-end registrar, capable of soaking up all the registration traffic.

to:

Our task is to find a solution to scale the platform to 500,000 subscribers. We first do an assessment of the types of VoIP traffic being handled by the platform, only to reach an interesting conclusion: 70%+ of the traffic that is hitting our servers is made up of REGISTER requests! Is this correct? Well, it might be, as mobile devices have short registration lifetimes (60 seconds). With this conclusion, we have spotted the bottleneck: registration traffic handling! So we proceed with implementing a front-end registrar, capable of soaking up this specific type of traffic.

Changed line 28 from:

By adding a mid-registrar traffic conversion front-end for these servers, we will free up a lot of platform resources, allowing us to support more subscribers. The resulting architecture will resemble the following:

to:

By adding a mid-registrar traffic conversion front-end for these servers, we will free up a lot of platform resources, allowing it to redirect its resources to handling more subscribers. The resulting architecture will resemble the following:

December 15, 2016, at 06:23 PM by liviu -
Changed line 24 from:

Our task is to find a solution to scale the platform to 500,000 subscribers. We first do an assessment of the types of VoIP traffic being handled by the platform, only to reach an interesting conclusion: 70%+ of the traffic that is hitting our servers is made up of REGISTER requests! This may actually be true, as mobile devices have short registration lifetimes (60 seconds). So we proceed with implementing a front-end registrar, capable of soaking up all the registration traffic.

to:

Our task is to find a solution to scale the platform to 500,000 subscribers. We first do an assessment of the types of VoIP traffic being handled by the platform, only to reach an interesting conclusion: 70%+ of the traffic that is hitting our servers is made up of REGISTER requests! Is this correct? Well, it might be, as mobile devices have short registration lifetimes (60 seconds). So we proceed with implementing a front-end registrar, capable of soaking up all the registration traffic.

December 15, 2016, at 06:23 PM by liviu -
Changed line 24 from:

Our task is to find a solution to scale the platform to 500,000 subscribers. We first do an assessment of the types of VoIP traffic being handled by the platform, only to reach an interesting conclusion: 70%+ of the traffic that is hitting our servers is made up of REGISTER requests! This is entirely possible, as mobile devices have short registration lifetimes (60 seconds). So we proceed with implementing a front-end registrar, capable of soaking up all the registration traffic.

to:

Our task is to find a solution to scale the platform to 500,000 subscribers. We first do an assessment of the types of VoIP traffic being handled by the platform, only to reach an interesting conclusion: 70%+ of the traffic that is hitting our servers is made up of REGISTER requests! This may actually be true, as mobile devices have short registration lifetimes (60 seconds). So we proceed with implementing a front-end registrar, capable of soaking up all the registration traffic.

December 15, 2016, at 06:22 PM by liviu -
Changed lines 12-13 from:

This tutorial will teach you how to deploy an OpenSIPS mid-registrar to an existing platform (e.g. a hosted PBX) in order to reduce the rate of incoming registrations into the existing servers. This will allow you to expand your user base and grow your business with no additional software costs, minimal configuration of the current components and close to no additional hardware.

to:

This tutorial will teach you how to deploy an OpenSIPS mid-registrar to an existing platform (e.g. a hosted PBX) in order to reduce the rate of registrations to its existing servers. This will allow you to expand your user base and grow your business with no additional software costs, minimal configuration of the current components and close to no additional hardware.

Changed lines 20-21 from:

This is our initial example platform. Its voice services are provided by a layer of multi-purpose servers (main registrar layer). These servers also include SIP registration handling. By adding a mid-registrar traffic conversion front-end for these servers, we will free up a lot of platform resources, allowing us to support more subscribers. The resulting architecture will resemble the following:

to:

This is our initial example VoIP platform. Its services are provided by a layer of multi-purpose servers (represented as the main registrar box). To name a few services of the current platform: conferencing, call pickup and internet messaging (IM). Currently, the platform servers are reaching peak usage around 50,000 mobile device subscribers.


Our task is to find a solution to scale the platform to 500,000 subscribers. We first do an assessment of the types of VoIP traffic being handled by the platform, only to reach an interesting conclusion: 70%+ of the traffic that is hitting our servers is made up of REGISTER requests! This is entirely possible, as mobile devices have short registration lifetimes (60 seconds). So we proceed with implementing a front-end registrar, capable of soaking up all the registration traffic.


By adding a mid-registrar traffic conversion front-end for these servers, we will free up a lot of platform resources, allowing us to support more subscribers. The resulting architecture will resemble the following:

December 15, 2016, at 06:05 PM by liviu -
Changed line 20 from:

This is our initial example platform. Its voice services are provided by a layer of multi-purpose servers. These servers also include SIP registration handling. By adding a mid-registrar traffic conversion front-end for these servers, we will free up a lot of platform resources, allowing us to support more subscribers. The resulting architecture will resemble the following:

to:

This is our initial example platform. Its voice services are provided by a layer of multi-purpose servers (main registrar layer). These servers also include SIP registration handling. By adding a mid-registrar traffic conversion front-end for these servers, we will free up a lot of platform resources, allowing us to support more subscribers. The resulting architecture will resemble the following:

December 15, 2016, at 06:04 PM by liviu -
Changed lines 16-17 from:

http://www.opensips.org/images/tc-setup.png

to:

http://www.opensips.org/pub/images/mid-registrar-platform-before.png

Changed lines 24-25 from:

http://www.opensips.org/images/tc-setup.png

to:

http://opensips.org/pub/images/mid-registrar-platform-after.png

Added lines 98-107:

Call flows

Registration (AOR throttling)

http://opensips.org/pub/images/mid-registrar-aor-throttling.png

Calling (parallel forking)

http://opensips.org/pub/images/mid-registrar-parallel-forking.png

December 15, 2016, at 05:39 PM by liviu -
Changed lines 30-31 from:


to:
Module configuration
Changed lines 48-49 from:


to:
REGISTER handling
Changed line 74 from:

\\

to:
INVITE handling
December 15, 2016, at 05:21 PM by liviu -
Changed line 101 from:

Assuming the existing platform is using SIP authentication (if not, then please enable it!!), note that in working modes "1" and "2", the mid-registrar may generate De-REGISTER requests, in order to avoid zombie registrations. Since by default, OpenSIPS will not be able to authenticate itself to the main registrar (it has no credentials!), the mid-registrar IP address should be white listed on the main registrar.

to:

Assuming the existing platform is using SIP authentication (if not, then please enable it!!), note that in working modes "1" and "2", the mid-registrar may generate De-REGISTER requests, in order to avoid stale registrations on the main registrar. Since by default, OpenSIPS will not be able to authenticate itself to the main registrar (it has no credentials!), the mid-registrar IP address should be white listed on the main registrar.

December 15, 2016, at 05:15 PM by liviu -
Added lines 94-95:

\\

December 15, 2016, at 05:15 PM by liviu -
Changed line 95 from:

Contact lookup is identical to the stock OpenSIPS script. Note that mid_registrar_lookup() will behave according to the insertion and working modes. In our case, it may populate more than one branch for this call, since "mode = 2" instructs the mid-registrar to also take over parallel forking.

to:

Contact lookup is almost identical to the stock OpenSIPS script. The only big difference is that we are using mid_registrar_lookup() instead of lookup(). Note that mid_registrar_lookup() will behave according to the insertion and working modes. In our case, it may populate more than one branch for this call, since "mode = 2" instructs the mid-registrar to also take over parallel forking.

December 15, 2016, at 05:12 PM by liviu -
Changed line 103 from:

The full script is available here.

to:

The full script used in this tutorial is available here.

December 15, 2016, at 05:12 PM by liviu -
Changed line 103 from:

The full script is available for download here.

to:

The full script is available here.

December 15, 2016, at 05:12 PM by liviu -
Changed lines 99-100 from:

Note that in working modes "1" and "2", the mid-registrar may generate De-REGISTER requests, in order to avoid zombie registrations. Since by default, OpenSIPS will not be able to authenticate itself to the main registrar (it has no credentials!), the mid-registrar IP address should be white listed on the main registrar.

to:

Assuming the existing platform is using SIP authentication (if not, then please enable it!!), note that in working modes "1" and "2", the mid-registrar may generate De-REGISTER requests, in order to avoid zombie registrations. Since by default, OpenSIPS will not be able to authenticate itself to the main registrar (it has no credentials!), the mid-registrar IP address should be white listed on the main registrar.

Changed line 103 from:

The full script is available .

to:

The full script is available for download here.

December 15, 2016, at 05:02 PM by liviu -
Changed line 36 from:

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

to:

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

Changed lines 72-73 from:

For all registrations, we make sure to call mid_registrar_save(). As stated in its documentation, it will not process the contacts immediately, but rather do the necessary changes to the REGISTER request before it is relayed to the main registrar, while also preparing to transparently handle its replies. We are now done with REGISTER request handling!

to:

For all registrations, we make sure to call mid_registrar_save(). As stated in its documentation, it will not process the contacts immediately, but rather do the necessary changes to the REGISTER request before it is relayed to the main registrar, while also preparing to transparently handle its replies. The above code stays the same regardless of the module's working mode or insertion mode. We are now done with REGISTER request handling!

Deleted line 82:
        # do lookup with method filtering
Changed lines 95-103 from:

Example

to:

Contact lookup is identical to the stock OpenSIPS script. Note that mid_registrar_lookup() will behave according to the insertion and working modes. In our case, it may populate more than one branch for this call, since "mode = 2" instructs the mid-registrar to also take over parallel forking.

SIP Authentication

Note that in working modes "1" and "2", the mid-registrar may generate De-REGISTER requests, in order to avoid zombie registrations. Since by default, OpenSIPS will not be able to authenticate itself to the main registrar (it has no credentials!), the mid-registrar IP address should be white listed on the main registrar.

Downloads

The full script is available .

December 15, 2016, at 04:43 PM by liviu -
Changed line 81 from:
    # initial requests from main registrar --> need to look them up!
to:
    # initial requests from main registrar, need to look them up!
Changed line 96 from:

Example

to:

Example

December 15, 2016, at 04:39 PM by liviu -
Changed lines 81-93 from:
    if (is_method("REGISTER")) {
        mid_registrar_save("location");
        switch ($retcode) {
        case 1:
            xlog("forwarding REGISTER to main registrar ($$ci=$ci)\n");
            $ru = "sip:10.0.0.3:5070";
            t_relay();
            break;
        case 2:
            xlog("absorbing REGISTER! ($$ci=$ci)\n");
            break;
        default:
            xlog("failed to save registration! ($$ci=$ci)\n");
to:
    # initial requests from main registrar --> need to look them up!
    if (is_method("INVITE|MESSAGE") && $si == "10.0.0.3" && $sp == 5070) {
        # do lookup with method filtering
        xlog("looking up $ru!\n");
        if (!mid_registrar_lookup("location")) {
            t_reply("404", "Not Found");
            exit;
Added lines 90-91:
        t_relay();
Changed line 96 from:

Example

to:

Example

December 15, 2016, at 04:24 PM by liviu -
Changed lines 76-77 from:

We now proceed with contact lookup handling:

to:

Next, we proceed with contact lookup during calls or instant messages:

Changed line 100 from:

Example

to:

Example

December 15, 2016, at 04:24 PM by liviu -
Changed lines 72-73 from:

For all registrations, we make sure to call mid_registrar_save(). As stated in its documentation, it will not process the contacts immediately, but rather do the necessary changes to the REGISTER request before it is relayed to the main registrar, while also preparing to transparently handle its replies. We are done with REGISTER request handling, the replies will be properly taken care of by the mid-registrar!

to:

For all registrations, we make sure to call mid_registrar_save(). As stated in its documentation, it will not process the contacts immediately, but rather do the necessary changes to the REGISTER request before it is relayed to the main registrar, while also preparing to transparently handle its replies. We are now done with REGISTER request handling!

Changed line 100 from:

Example

to:

Example

December 15, 2016, at 04:24 PM by liviu -
Changed lines 72-73 from:

For all registrations, we make sure to call mid_registrar_save(). As stated in its documentation, it will not process the contacts immediately, but rather do the necessary changes to the REGISTER request, and prepare to transparently handle its replies. We are done with REGISTER request handling, the replies will be properly taken care of by the mid-registrar!

to:

For all registrations, we make sure to call mid_registrar_save(). As stated in its documentation, it will not process the contacts immediately, but rather do the necessary changes to the REGISTER request before it is relayed to the main registrar, while also preparing to transparently handle its replies. We are done with REGISTER request handling, the replies will be properly taken care of by the mid-registrar!

Changed line 100 from:

Example

to:

Example

December 15, 2016, at 04:23 PM by liviu -
Added lines 70-71:


Changed line 100 from:

Example

to:

Example

December 15, 2016, at 04:23 PM by liviu -
Changed lines 70-72 from:

Example

to:

For all registrations, we make sure to call mid_registrar_save(). As stated in its documentation, it will not process the contacts immediately, but rather do the necessary changes to the REGISTER request, and prepare to transparently handle its replies. We are done with REGISTER request handling, the replies will be properly taken care of by the mid-registrar!


We now proceed with contact lookup handling:


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

        exit;
    }

Example

December 15, 2016, at 04:18 PM by liviu -
Changed lines 51-52 from:
    if (is_method("REGISTER"))
    {
to:
    if (is_method("REGISTER")) {
Changed line 55 from:
            # hashing algorithm, etc. Destination registrar is selected!
to:
            xlog("forwarding REGISTER to main registrar ($$ci=$ci)\n");
Changed lines 57-65 from:
            #$rd = "10.0.0.3";
            #$rU = "liviu";
            #$rp = 5070;

            #uac_replace_to("Liviu Chircu", "sip:liviu@8.8.8.8");

            if (!t_relay())
                send_reply("500", "Internal Error 77");
            xlog("NEED TO FORWARD!!! '$rm' with $(hdr(Expires))\n");
to:
            t_relay();
Changed line 60 from:
            xlog("---- NO NEED TO FORWARD!!!\n");
to:
            xlog("absorbing REGISTER! ($$ci=$ci)\n");
Changed line 63 from:
            xlog("ERRRRRRRORRRRRRRRRR!!!\n");
to:
            xlog("failed to save registration! ($$ci=$ci)\n");
Changed line 72 from:

Example

to:

Example

December 15, 2016, at 04:14 PM by liviu -
Changed lines 48-49 from:

Example

to:


    if (is_method("REGISTER"))
    {
        mid_registrar_save("location");
        switch ($retcode) {
        case 1:
            # hashing algorithm, etc. Destination registrar is selected!
            $ru = "sip:10.0.0.3:5070";
            #$rd = "10.0.0.3";
            #$rU = "liviu";
            #$rp = 5070;

            #uac_replace_to("Liviu Chircu", "sip:liviu@8.8.8.8");

            if (!t_relay())
                send_reply("500", "Internal Error 77");
            xlog("NEED TO FORWARD!!! '$rm' with $(hdr(Expires))\n");
            break;
        case 2:
            xlog("---- NO NEED TO FORWARD!!!\n");
            break;
        default:
            xlog("ERRRRRRRORRRRRRRRRR!!!\n");
        }

        exit;
    }

Example

December 15, 2016, at 04:13 PM by liviu -
Added lines 28-29:

Let's extend the default OpenSIPS script with mid-registrar capabilities, step by step:

Changed line 49 from:

Example

to:

Example

December 15, 2016, at 04:08 PM by liviu -
Changed lines 44-47 from:
  • "insertion_mode" - specifies how the mid-registrar will insert itself on the call flow. Insertion mode "0" leads to rewrite of the Contact header field "host" part, while in insertion mode "1", the mid-registrar will append a Path header field to all REGISTER requests.

Example

to:
  • "insertion_mode" - specifies how the mid-registrar will insert itself on the call flow. Insertion mode "0" leads to rewrite of the Contact header field "host" part, while in insertion mode "1", the mid-registrar will append a Path header field to all REGISTER requests. In both cases, the header field values will contain the network interface used to relay the request.

Example

December 15, 2016, at 04:06 PM by liviu -
Changed lines 44-47 from:
  • "insertion_mode" - specifies how the mid-registrar will insert itself on the call flow. Insertion mode "0" leads to rewrite of the Contact header field "host" part, while in insertion mode "1", the mid-registrar will simply use a Path header field.

Example

to:
  • "insertion_mode" - specifies how the mid-registrar will insert itself on the call flow. Insertion mode "0" leads to rewrite of the Contact header field "host" part, while in insertion mode "1", the mid-registrar will append a Path header field to all REGISTER requests.

Example

December 15, 2016, at 04:04 PM by liviu -
Changed line 33 from:

modparam("mid_registrar", "outgoing_expires", 100)

to:

modparam("mid_registrar", "outgoing_expires", 7200)

Changed line 47 from:

Example

to:

Example

December 15, 2016, at 04:04 PM by liviu -
Deleted lines 34-36:

modparam("mid_registrar", "contact_match_mode", 0) /* 0 = by param; 1 = by user */ modparam("mid_registrar", "contact_match_param", "ionel")

Changed line 47 from:

Example

to:

Example

December 15, 2016, at 04:04 PM by liviu -
Changed lines 31-37 from:
to:

loadmodule "mid_registrar.so" modparam("mid_registrar", "mode", 2) /* 0 = mirror / 1 = ct / 2 = AoR */ modparam("mid_registrar", "outgoing_expires", 100) modparam("mid_registrar", "contact_routing_mode", 0) /* 0 = contact; 1 = path */

modparam("mid_registrar", "contact_match_mode", 0) /* 0 = by param; 1 = by user */ modparam("mid_registrar", "contact_match_param", "ionel")

Changed line 50 from:

Example

to:

Example

December 15, 2016, at 04:03 PM by liviu -
Changed lines 39-44 from:
  • a
  • b
  • c

Example

to:
  • "mode" - the working mode of the mid_registrar module. In this case, "2" means "AOR throttling", where the module will both reduce the amount of registration traffic to the main registrar, and also aggregate contacts into a single one when forwarding registrations to it.
  • "outgoing_expires" - the default value for the expirations of the contacts that the mid-registrar will relay to the main registrar. The mid_registrar_save() function also has a similar optional parameter, for more fine grained control.
  • "insertion_mode" - specifies how the mid-registrar will insert itself on the call flow. Insertion mode "0" leads to rewrite of the Contact header field "host" part, while in insertion mode "1", the mid-registrar will simply use a Path header field.

Example

December 15, 2016, at 03:50 PM by liviu -
Changed line 44 from:

Example

to:

Example

December 15, 2016, at 03:50 PM by liviu -
Changed lines 30-32 from:

http://www.opensips.org/images/tc-setup.png

to:

Changed lines 39-41 from:

Example

to:
  • a
  • b
  • c

Example

December 15, 2016, at 02:51 PM by liviu -
Changed line 39 from:

Example

to:

Example

December 15, 2016, at 02:51 PM by liviu -
Changed lines 14-15 from:

Example platform

to:

Example scenario

Changed lines 26-39 from:

\\

to:

OpenSIPS script


http://www.opensips.org/images/tc-setup.png


We first load the module and set its parameters. Going through each parameter:

Example

December 15, 2016, at 12:34 PM by liviu -
Changed line 20 from:

This is our initial example platform. Its voice services are built on top of an all-in-one box, which includes SIP registration handling.

to:

This is our initial example platform. Its voice services are provided by a layer of multi-purpose servers. These servers also include SIP registration handling. By adding a mid-registrar traffic conversion front-end for these servers, we will free up a lot of platform resources, allowing us to support more subscribers. The resulting architecture will resemble the following:

December 15, 2016, at 12:23 PM by liviu -
Added lines 18-19:


Added lines 21-22:

\\

December 14, 2016, at 07:17 PM by liviu -
December 14, 2016, at 07:17 PM by liviu -
Changed lines 14-16 from:

Initial platform

Final platform

to:

Example platform

http://www.opensips.org/images/tc-setup.png

This is our initial example platform. Its voice services are built on top of an all-in-one box, which includes SIP registration handling.

http://www.opensips.org/images/tc-setup.png

December 14, 2016, at 04:20 PM by liviu -
Deleted lines 16-19:

This tutorial illustrates the required steps in order to perform audio transcoding with the D-series cards manufactured by Sangoma, using the sngtc_server daemon and the OpenSIPS sngtc module as its client. The latest version of the transcoding library, as of 1 August 2013 is: sng-tc-linux-1.3.4.1

December 14, 2016, at 04:20 PM by liviu -
Changed line 12 from:

This tutorial will teach you how to deploy an OpenSIPS mid-registrar to an existing platform (i.e. a hosted PBX) in order to reduce the rate of incoming registrations into the existing servers. All this can be done with minimal configuration and almost no additional hardware.

to:

This tutorial will teach you how to deploy an OpenSIPS mid-registrar to an existing platform (e.g. a hosted PBX) in order to reduce the rate of incoming registrations into the existing servers. This will allow you to expand your user base and grow your business with no additional software costs, minimal configuration of the current components and close to no additional hardware.

December 14, 2016, at 04:15 PM by liviu -
Added lines 1-22:
Documentation -> Tutorials -> Scaling registrations with an OpenSIPS mid-registrar

This page has been visited 21566 times.

Scaling registrations with an OpenSIPS mid-registrar

written by Liviu Chircu

(:toc-float Table of Content:)


Tutorial Overview

This tutorial will teach you how to deploy an OpenSIPS mid-registrar to an existing platform (i.e. a hosted PBX) in order to reduce the rate of incoming registrations into the existing servers. All this can be done with minimal configuration and almost no additional hardware.

Initial platform

Final platform

This tutorial illustrates the required steps in order to perform audio transcoding with the D-series cards manufactured by Sangoma, using the sngtc_server daemon and the OpenSIPS sngtc module as its client. The latest version of the transcoding library, as of 1 August 2013 is: sng-tc-linux-1.3.4.1

\\


Page last modified on February 26, 2018, at 06:24 PM