res_pjsip.c: Added disable_rport option for pjsip.conf

Currently when the pjsip making an outgoing request, it keep adding the
rport parameter in a request message as a default.

This causes unexpected rport handle at the other end.

Added option for disable this behaviour in the pjsip.conf.

This is a system option, but working as a gloabl option.

ASTERISK-28959

Change-Id: I9596675e52a742774738b5aad5d1fec32f477abc
This commit is contained in:
sungtae kim
2020-06-24 01:27:47 +02:00
parent d093e44b1e
commit 81b5e4a73f
5 changed files with 61 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
"""pjsip add disable_rport
Revision ID: 79290b511e4b
Revises: fbb7766f17bc
Create Date: 2020-06-25 22:21:37.529880
"""
# revision identifiers, used by Alembic.
revision = '79290b511e4b'
down_revision = 'fbb7766f17bc'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import ENUM
AST_BOOL_NAME = 'ast_bool_values'
# We'll just ignore the n/y and f/t abbreviations as Asterisk does not write
# those aliases.
AST_BOOL_VALUES = [ '0', '1',
'off', 'on',
'false', 'true',
'no', 'yes' ]
def upgrade():
############################# Enums ##############################
# ast_bool_values has already been created, so use postgres enum object
# type to get around "already created" issue - works okay with mysql
ast_bool_values = ENUM(*AST_BOOL_VALUES, name=AST_BOOL_NAME, create_type=False)
op.add_column('ps_systems', sa.Column('disable_rport', ast_bool_values))
def downgrade():
if op.get_context().bind.dialect.name == 'mssql':
op.drop_constraint('ck_ps_systems_disable_rport_ast_bool_values','ps_systems')
op.drop_column('ps_systems', 'disable_rport')