Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weight-based contacts call termination distribution #2167

Closed
marcocapetta opened this issue Dec 6, 2019 · 1 comment
Closed

Weight-based contacts call termination distribution #2167

marcocapetta opened this issue Dec 6, 2019 · 1 comment
Assignees

Comments

@marcocapetta
Copy link
Contributor

Description

Implement a new TM logic to distribute calls to contacts belonging to the same subscriber similar to the weight mechanism that is used in lcr module. This mechanism should support primary/backup, load-sharing or a combination of both.

Expected behavior

Currently, with the existing serial forking using q-value:

  • if the q-values are different, the devices will ring serially but always in the same order
  • if the q-values are equals, the devices will ring in parallel

With the new mechanism, instead, I have to be able, for example, to register 2 devices and send:

  • the 50% of the call to device 1 and then to device 2 as a backup
  • the 50% of the call to device 2 and then to device 1 as a backup

Possible Solutions

A possible approach is to extend the existing load_contact function and re-use the q-value as a weight.
For example:

  • contact 1 has Q value 1
  • contact 2 has Q value 0.5
  • contact 3 has Q value 0.5
  • contact 4 has Q value 0
    Then kamailio distributes the calls using the following proportion:
    Q : total_Q = call_prob : 100
    So:
  • contact 1 has probability to ring of 50% (1 * 100 / 2)
  • contact 2 has probability to ring of 25% (0.5 * 100 / 2)
  • contact 3 has probability to ring of 25% (0.5 * 100 / 2)
  • contact 4 has probability to ring of 0 (0 * 100 / 2) but it is used as backup option if all other contacts fail

This should solves the limitations of serial forking and allows to achieve equal or predictable weight-based call termination distribution.

@miconda
Copy link
Member

miconda commented Jan 7, 2020

The related PR was merged.

@miconda miconda closed this as completed Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants