res_pjsip_outbound_registration: Make max random delay configurable.

Currently, PJSIP will randomly wait up to 10 seconds for each
outbound registration's initial attempt. The reason for this
is to avoid having all outbound registrations attempt to register
simultaneously.

This can create limitations with the test suite where we need to
be able to receive inbound calls potentially within 10 seconds of
starting up. For instance, we might register to another server
and then try to receive a call through the registration, but if
the registration hasn't happened yet, this will fail, and hence
this inconsistent behavior can cause tests to fail. Ultimately,
this requires a smaller random value because there may be no good
reason to wait for up to 10 seconds in these circumstances.

To address this, a new config option is introduced which makes this
maximum delay configurable. This allows, for instance, this to be
set to a very small value in test systems to ensure that registrations
happen immediately without an unnecessary delay, and can be used more
generally to control how "tight" the initial outbound registrations
are.

ASTERISK-29965 #close

Change-Id: Iab989a8e94323e645f3a21cbb6082287c7b2f3fd
This commit is contained in:
Naveen Albert
2022-03-12 18:27:41 +00:00
committed by Joshua Colp
parent 5f0581c5f5
commit 31dc28ab09
3 changed files with 42 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
"""max_random_initial_delay
Revision ID: 18e0805d367f
Revises: 0bee61aa9425
Create Date: 2022-05-18 17:07:02.626045
"""
# revision identifiers, used by Alembic.
revision = '18e0805d367f'
down_revision = '0bee61aa9425'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('ps_registrations', sa.Column('max_random_initial_delay', sa.Integer))
def downgrade():
op.drop_column('ps_registrations', 'max_random_initial_delay')