mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
res_pjsip: Add mediasec capabilities.
This patch adds support for mediasec SIP headers and SDP attributes. These are defined in RFC 3329, 3GPP TS 24.229 and draft-dawes-sipcore-mediasec-parameter. The new features are implemented so that a backbone for RFC 3329 is present to streamline future work on RFC 3329. With this patch, Asterisk can communicate with Deutsche Telekom trunks which require these fields. ASTERISK-30032 Change-Id: Ia7f5b5ba42db18074fdd5428c4e1838728586be2
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
"""add security_negotiation and security_mechanisms to endpoint
|
||||
|
||||
Revision ID: 417c0247fd7e
|
||||
Revises: 539f68bede2c
|
||||
Create Date: 2022-08-08 15:35:31.416964
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '417c0247fd7e'
|
||||
down_revision = '539f68bede2c'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects.postgresql import ENUM
|
||||
|
||||
SECURITY_NEGOTIATION_NAME = 'security_negotiation_values'
|
||||
SECURITY_NEGOTIATION_VALUES = ['no', 'mediasec']
|
||||
|
||||
def upgrade():
|
||||
context = op.get_context()
|
||||
|
||||
if context.bind.dialect.name == 'postgresql':
|
||||
security_negotiation_values = ENUM(*SECURITY_NEGOTIATION_VALUES, name=SECURITY_NEGOTIATION_NAME)
|
||||
security_negotiation_values.create(op.get_bind(), checkfirst=False)
|
||||
|
||||
op.add_column('ps_endpoints', sa.Column('security_negotiation',
|
||||
ENUM(*SECURITY_NEGOTIATION_VALUES, name=SECURITY_NEGOTIATION_NAME, create_type=False)))
|
||||
op.add_column('ps_endpoints', sa.Column('security_mechanisms', sa.String(512)))
|
||||
|
||||
op.add_column('ps_registrations', sa.Column('security_negotiation',
|
||||
ENUM(*SECURITY_NEGOTIATION_VALUES, name=SECURITY_NEGOTIATION_NAME, create_type=False)))
|
||||
op.add_column('ps_registrations', sa.Column('security_mechanisms', sa.String(512)))
|
||||
|
||||
def downgrade():
|
||||
context = op.get_context()
|
||||
|
||||
if context.bind.dialect.name == 'mssql':
|
||||
op.drop_constraint('ck_ps_endpoints_security_negotiation_security_negotiation_values', 'ps_endpoints')
|
||||
op.drop_constraint('ck_ps_registrations_security_negotiation_security_negotiation_values', 'ps_registrations')
|
||||
|
||||
op.drop_column('ps_endpoints', 'security_negotiation')
|
||||
op.drop_column('ps_endpoints', 'security_mechanisms')
|
||||
op.drop_column('ps_registrations', 'security_negotiation')
|
||||
op.drop_column('ps_registrations', 'security_mechanisms')
|
||||
|
||||
if context.bind.dialect.name == 'postgresql':
|
||||
enum = ENUM(*SECURITY_NEGOTIATION_VALUES, name=SECURITY_NEGOTIATION_NAME)
|
||||
enum.drop(op.get_bind(), checkfirst=False)
|
Reference in New Issue
Block a user