mirror of https://github.com/asterisk/asterisk
Add a new global flag to res_pjsip to allow the callerid to be used as the username in the contact header. This allows chan_pjsip to have the same behavour as chan_sip ASTERISK-28087 #close Change-Id: I9a720e058323f6862a91c62f8a8c1a4b5c087b9516.1
parent
3f4f31fed6
commit
3ba66b8a9d
@ -0,0 +1,34 @@
|
||||
"""pjsip add use_callerid_contact
|
||||
|
||||
Revision ID: 2bb1a85135ad
|
||||
Revises: 7f85dd44c775
|
||||
Create Date: 2018-10-18 15:13:40.462354
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '2bb1a85135ad'
|
||||
down_revision = '7f85dd44c775'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects.postgresql import ENUM
|
||||
|
||||
YESNO_NAME = 'yesno_values'
|
||||
YESNO_VALUES = ['yes', 'no']
|
||||
|
||||
|
||||
def upgrade():
|
||||
############################# Enums ##############################
|
||||
|
||||
# yesno_values have already been created, so use postgres enum object
|
||||
# type to get around "already created" issue - works okay with mysql
|
||||
yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
|
||||
|
||||
op.add_column('ps_globals', sa.Column('use_callerid_contact', yesno_values))
|
||||
|
||||
|
||||
def downgrade():
|
||||
if op.get_context().bind.dialect.name == 'mssql':
|
||||
op.drop_constraint('ck_ps_globals_use_callerid_contact_yesno_values','ps_globals')
|
||||
op.drop_column('ps_globals', 'use_callerid_contact')
|
Loading…
Reference in new issue