res_pjsip/config_transport: Allow reloading transports.

The 'reload' mechanism actually involves closing the underlying
socket and calling the appropriate udp, tcp or tls start functions
again.  Only outbound_registration, pubsub and session needed work
to reset the transport before sending requests to insure that the
pjsip transport didn't get pulled out from under them.

In my testing, no calls were dropped when a transport was changed
for any of the 3 transport types even if ip addresses or ports were
changed. To be on the safe side however, a new transport option was
added (allow_reload) which defaults to 'no'.  Unless it's explicitly
set to 'yes' for a transport, changes to that transport will be ignored
on a reload of res_pjsip.  This should preserve the current behavior.

Change-Id: I5e759850e25958117d4c02f62ceb7244d7ec9edf
This commit is contained in:
George Joseph
2016-02-11 10:01:05 -07:00
parent 6fc57b3e1f
commit ba8adb4ce3
9 changed files with 284 additions and 70 deletions

View File

@@ -0,0 +1,27 @@
"""Add allow_reload to ps_transports
Revision ID: 3bcc0b5bc2c9
Revises: dbc44d5a908
Create Date: 2016-02-05 17:43:39.183785
"""
# revision identifiers, used by Alembic.
revision = '3bcc0b5bc2c9'
down_revision = 'dbc44d5a908'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import ENUM
YESNO_NAME = 'yesno_values'
YESNO_VALUES = ['yes', 'no']
def upgrade():
yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
op.add_column('ps_transports', sa.Column('allow_reload', yesno_values))
pass
def downgrade():
op.drop_column('ps_transports', 'allow_reload')
pass