[Asterisk-code-review] short (asterisk[master])
HZMI8gkCvPpom0tM
asteriskteam at digium.com
Wed Jul 22 08:09:55 CDT 2015
HZMI8gkCvPpom0tM has uploaded a new change for review.
https://gerrit.asterisk.org/943
Change subject: short
......................................................................
short
Change-Id: I09e09b8045eedfae0089e7f8356c165db0cd82bf
---
M contrib/ast-db-manage/config/versions/10aedae86a32_add_outgoing_enum_va.py
M contrib/ast-db-manage/config/versions/1758e8bbf6b_increase_useragent_column_size.py
M contrib/ast-db-manage/config/versions/1d50859ed02e_create_accountcode.py
M contrib/ast-db-manage/config/versions/21e526ad3040_add_pjsip_debug_option.py
M contrib/ast-db-manage/config/versions/28887f25a46f_create_queue_tables.py
M contrib/ast-db-manage/config/versions/2fc7930b41b3_add_pjsip_endpoint_options_for_12_1.py
M contrib/ast-db-manage/config/versions/3855ee4e5f85_add_missing_pjsip_options.py
M contrib/ast-db-manage/config/versions/43956d550a44_add_tables_for_pjsip.py
M contrib/ast-db-manage/config/versions/4c573e7135bd_fix_tos_field_types.py
M contrib/ast-db-manage/config/versions/4da0c5f79a9c_create_tables.py
M contrib/ast-db-manage/config/versions/5139253c0423_make_q_member_uniqueid_autoinc.py
M contrib/ast-db-manage/config/versions/51f8cb66540e_add_further_dtls_options.py
M contrib/ast-db-manage/config/versions/581a4264e537_adding_extensions.py
M contrib/ast-db-manage/config/versions/5950038a6ead_fix_pjsip_verifiy_typo.py
M contrib/ast-db-manage/config/versions/c6d929b23a8_create_pjsip_subscription_persistence_.py
M contrib/ast-db-manage/config/versions/e96a0b8071c_increase_pjsip_column_size.py
16 files changed, 1,386 insertions(+), 762 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/43/943/1
diff --git a/contrib/ast-db-manage/config/versions/10aedae86a32_add_outgoing_enum_va.py b/contrib/ast-db-manage/config/versions/10aedae86a32_add_outgoing_enum_va.py
index b4ea71c..e3a6a9a 100755
--- a/contrib/ast-db-manage/config/versions/10aedae86a32_add_outgoing_enum_va.py
+++ b/contrib/ast-db-manage/config/versions/10aedae86a32_add_outgoing_enum_va.py
@@ -39,45 +39,50 @@
new_type = sa.Enum(*NEW_ENUM, name='sip_directmedia_values_v2')
tcr = sa.sql.table('sippeers', sa.Column('directmedia', new_type,
- nullable=True))
+ nullable=True))
def upgrade():
- context = op.get_context()
+ currentcontext = op.get_context()
- # Upgrading to this revision WILL clear your directmedia values.
- if context.bind.dialect.name != 'postgresql':
- op.alter_column('sippeers', 'directmedia',
- type_=new_type,
- existing_type=old_type)
- else:
- enum = ENUM("yes", "no", "nonat", "update", "outgoing",
- name="sip_directmedia_values_v2")
- enum.create(op.get_bind(), checkfirst=False)
+ # Upgrading to this revision WILL clear your directmedia values.
+ if currentcontext.bind.dialect.name != 'postgresql':
+ if currentcontext.bind.dialect.name != 'oracle':
+ op.alter_column('sippeers', 'directmedia',
+ type_=new_type,
+ existing_type=old_type)
+ if currentcontext.bind.dialect.name == 'oracle':
+ op.alter_column('sippeers', 'directmedia',type_=sa.String(10))
+
+
+ else:
+ enum = ENUM("yes", "no", "nonat", "update", "outgoing",
+ name="sip_directmedia_values_v2")
+ enum.create(op.get_bind(), checkfirst=False)
- op.execute('ALTER TABLE sippeers ALTER COLUMN directmedia TYPE'
- ' sip_directmedia_values_v2 USING'
- ' directmedia::text::sip_directmedia_values_v2')
+ op.execute('ALTER TABLE sippeers ALTER COLUMN directmedia TYPE'
+ ' sip_directmedia_values_v2 USING'
+ ' directmedia::text::sip_directmedia_values_v2')
- ENUM(name="sip_directmedia_values").drop(op.get_bind(), checkfirst=False)
+ ENUM(name="sip_directmedia_values").drop(op.get_bind(), checkfirst=False)
def downgrade():
- context = op.get_context()
+ currentcontext = op.get_context()
- op.execute(tcr.update().where(tcr.c.directmedia==u'outgoing')
- .values(directmedia=None))
+ op.execute(tcr.update().where(tcr.c.directmedia==u'outgoing')
+ .values(directmedia=None))
- if context.bind.dialect.name != 'postgresql':
- op.alter_column('sippeers', 'directmedia',
- type_=old_type,
- existing_type=new_type)
- else:
- enum = ENUM("yes", "no", "nonat", "update",
- name="sip_directmedia_values")
- enum.create(op.get_bind(), checkfirst=False)
+ if currentcontext.bind.dialect.name != 'postgresql':
+ op.alter_column('sippeers', 'directmedia',
+ type_=old_type,
+ existing_type=new_type)
+ else:
+ enum = ENUM("yes", "no", "nonat", "update",
+ name="sip_directmedia_values")
+ enum.create(op.get_bind(), checkfirst=False)
- op.execute('ALTER TABLE sippeers ALTER COLUMN directmedia TYPE'
- ' sip_directmedia_values USING'
- ' directmedia::text::sip_directmedia_values')
+ op.execute('ALTER TABLE sippeers ALTER COLUMN directmedia TYPE'
+ ' sip_directmedia_values USING'
+ ' directmedia::text::sip_directmedia_values')
- ENUM(name="sip_directmedia_values_v2").drop(op.get_bind(),
- checkfirst=False)
+ ENUM(name="sip_directmedia_values_v2").drop(op.get_bind(),
+ checkfirst=False)
diff --git a/contrib/ast-db-manage/config/versions/1758e8bbf6b_increase_useragent_column_size.py b/contrib/ast-db-manage/config/versions/1758e8bbf6b_increase_useragent_column_size.py
index 215726f..d65c9e0 100755
--- a/contrib/ast-db-manage/config/versions/1758e8bbf6b_increase_useragent_column_size.py
+++ b/contrib/ast-db-manage/config/versions/1758e8bbf6b_increase_useragent_column_size.py
@@ -33,9 +33,9 @@
def upgrade():
- op.alter_column('sippeers', 'useragent', type_=sa.String(255))
+ op.alter_column('sippeers', 'useragent', type_=sa.String(255))
def downgrade():
- op.alter_column('sippeers', 'useragent', type_=sa.String(20))
+ op.alter_column('sippeers', 'useragent', type_=sa.String(20))
diff --git a/contrib/ast-db-manage/config/versions/1d50859ed02e_create_accountcode.py b/contrib/ast-db-manage/config/versions/1d50859ed02e_create_accountcode.py
index eb20001..2607e19 100644
--- a/contrib/ast-db-manage/config/versions/1d50859ed02e_create_accountcode.py
+++ b/contrib/ast-db-manage/config/versions/1d50859ed02e_create_accountcode.py
@@ -14,7 +14,7 @@
import sqlalchemy as sa
def upgrade():
- op.add_column('ps_endpoints', sa.Column('accountcode', sa.String(20)))
+ op.add_column('ps_endpoints', sa.Column('accountcode', sa.String(20)))
def downgrade():
- op.drop_column('ps_endpoints', 'accountcode')
+ op.drop_column('ps_endpoints', 'accountcode')
diff --git a/contrib/ast-db-manage/config/versions/21e526ad3040_add_pjsip_debug_option.py b/contrib/ast-db-manage/config/versions/21e526ad3040_add_pjsip_debug_option.py
index 2adca62..2cac223 100755
--- a/contrib/ast-db-manage/config/versions/21e526ad3040_add_pjsip_debug_option.py
+++ b/contrib/ast-db-manage/config/versions/21e526ad3040_add_pjsip_debug_option.py
@@ -15,7 +15,7 @@
def upgrade():
- op.add_column('ps_globals', sa.Column('debug', sa.String(40)))
+ op.add_column('ps_globals', sa.Column('debug', sa.String(40)))
def downgrade():
- op.drop_column('ps_globals', 'debug')
+ op.drop_column('ps_globals', 'debug')
diff --git a/contrib/ast-db-manage/config/versions/28887f25a46f_create_queue_tables.py b/contrib/ast-db-manage/config/versions/28887f25a46f_create_queue_tables.py
index 59ddac7..965b4e8 100755
--- a/contrib/ast-db-manage/config/versions/28887f25a46f_create_queue_tables.py
+++ b/contrib/ast-db-manage/config/versions/28887f25a46f_create_queue_tables.py
@@ -39,103 +39,179 @@
QUEUE_STRATEGY_NAME = 'queue_strategy_values'
QUEUE_STRATEGY_VALUES = [ 'ringall', 'leastrecent', 'fewestcalls', 'random', 'rrmemory',
- 'linear', 'wrandom', 'rrordered', ]
+ 'linear', 'wrandom', 'rrordered', ]
QUEUE_AUTOPAUSE_NAME = 'queue_autopause_values'
QUEUE_AUTOPAUSE_VALUES = ['yes', 'no', 'all']
def upgrade():
- ############################# Enums ##############################
+ ############################# 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)
+ # 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)
- queue_strategy_values = sa.Enum(*QUEUE_STRATEGY_VALUES, name=QUEUE_STRATEGY_NAME)
- queue_autopause_values = sa.Enum(*QUEUE_AUTOPAUSE_VALUES, name=QUEUE_AUTOPAUSE_NAME)
+ queue_strategy_values = sa.Enum(*QUEUE_STRATEGY_VALUES, name=QUEUE_STRATEGY_NAME)
+ queue_autopause_values = sa.Enum(*QUEUE_AUTOPAUSE_VALUES, name=QUEUE_AUTOPAUSE_NAME)
- ######################### create tables ##########################
+ ######################### create tables ##########################
- op.create_table(
- 'queues',
- sa.Column('name', sa.String(128), primary_key=True, nullable=False),
- sa.Column('musiconhold', sa.String(128)),
- sa.Column('announce', sa.String(128)),
- sa.Column('context', sa.String(128)),
- sa.Column('timeout', sa.Integer),
- sa.Column('ringinuse', yesno_values),
- sa.Column('setinterfacevar', yesno_values),
- sa.Column('setqueuevar', yesno_values),
- sa.Column('setqueueentryvar', yesno_values),
- sa.Column('monitor_format', sa.String(8)),
- sa.Column('membermacro', sa.String(512)),
- sa.Column('membergosub', sa.String(512)),
- sa.Column('queue_youarenext', sa.String(128)),
- sa.Column('queue_thereare', sa.String(128)),
- sa.Column('queue_callswaiting', sa.String(128)),
- sa.Column('queue_quantity1', sa.String(128)),
- sa.Column('queue_quantity2', sa.String(128)),
- sa.Column('queue_holdtime', sa.String(128)),
- sa.Column('queue_minutes', sa.String(128)),
- sa.Column('queue_minute', sa.String(128)),
- sa.Column('queue_seconds', sa.String(128)),
- sa.Column('queue_thankyou', sa.String(128)),
- sa.Column('queue_callerannounce', sa.String(128)),
- sa.Column('queue_reporthold', sa.String(128)),
- sa.Column('announce_frequency', sa.Integer),
- sa.Column('announce_to_first_user', yesno_values),
- sa.Column('min_announce_frequency', sa.Integer),
- sa.Column('announce_round_seconds', sa.Integer),
- sa.Column('announce_holdtime', sa.String(128)),
- sa.Column('announce_position', sa.String(128)),
- sa.Column('announce_position_limit', sa.Integer),
- sa.Column('periodic_announce', sa.String(50)),
- sa.Column('periodic_announce_frequency', sa.Integer),
- sa.Column('relative_periodic_announce', yesno_values),
- sa.Column('random_periodic_announce', yesno_values),
- sa.Column('retry', sa.Integer),
- sa.Column('wrapuptime', sa.Integer),
- sa.Column('penaltymemberslimit', sa.Integer),
- sa.Column('autofill', yesno_values),
- sa.Column('monitor_type', sa.String(128)),
- sa.Column('autopause', queue_autopause_values),
- sa.Column('autopausedelay', sa.Integer),
- sa.Column('autopausebusy', yesno_values),
- sa.Column('autopauseunavail', yesno_values),
- sa.Column('maxlen', sa.Integer),
- sa.Column('servicelevel', sa.Integer),
- sa.Column('strategy', queue_strategy_values),
- sa.Column('joinempty', sa.String(128)),
- sa.Column('leavewhenempty', sa.String(128)),
- sa.Column('reportholdtime', yesno_values),
- sa.Column('memberdelay', sa.Integer),
- sa.Column('weight', sa.Integer),
- sa.Column('timeoutrestart', yesno_values),
- sa.Column('defaultrule', sa.String(128)),
- sa.Column('timeoutpriority', sa.String(128))
- )
+ currentcontext = op.get_context()
+ if currentcontext.bind.dialect.name != 'oracle':
+
+ op.create_table(
+ 'queues',
+ sa.Column('name', sa.String(128), primary_key=True, nullable=False),
+ sa.Column('musiconhold', sa.String(128)),
+ sa.Column('announce', sa.String(128)),
+ sa.Column('context', sa.String(128)),
+ sa.Column('timeout', sa.Integer),
+ sa.Column('ringinuse', yesno_values),
+ sa.Column('setinterfacevar', yesno_values),
+ sa.Column('setqueuevar', yesno_values),
+ sa.Column('setqueueentryvar', yesno_values),
+ sa.Column('monitor_format', sa.String(8)),
+ sa.Column('membermacro', sa.String(512)),
+ sa.Column('membergosub', sa.String(512)),
+ sa.Column('queue_youarenext', sa.String(128)),
+ sa.Column('queue_thereare', sa.String(128)),
+ sa.Column('queue_callswaiting', sa.String(128)),
+ sa.Column('queue_quantity1', sa.String(128)),
+ sa.Column('queue_quantity2', sa.String(128)),
+ sa.Column('queue_holdtime', sa.String(128)),
+ sa.Column('queue_minutes', sa.String(128)),
+ sa.Column('queue_minute', sa.String(128)),
+ sa.Column('queue_seconds', sa.String(128)),
+ sa.Column('queue_thankyou', sa.String(128)),
+ sa.Column('queue_callerannounce', sa.String(128)),
+ sa.Column('queue_reporthold', sa.String(128)),
+ sa.Column('announce_frequency', sa.Integer),
+ sa.Column('announce_to_first_user', yesno_values),
+ sa.Column('min_announce_frequency', sa.Integer),
+ sa.Column('announce_round_seconds', sa.Integer),
+ sa.Column('announce_holdtime', sa.String(128)),
+ sa.Column('announce_position', sa.String(128)),
+ sa.Column('announce_position_limit', sa.Integer),
+ sa.Column('periodic_announce', sa.String(50)),
+ sa.Column('periodic_announce_frequency', sa.Integer),
+ sa.Column('relative_periodic_announce', yesno_values),
+ sa.Column('random_periodic_announce', yesno_values),
+ sa.Column('retry', sa.Integer),
+ sa.Column('wrapuptime', sa.Integer),
+ sa.Column('penaltymemberslimit', sa.Integer),
+ sa.Column('autofill', yesno_values),
+ sa.Column('monitor_type', sa.String(128)),
+ sa.Column('autopause', queue_autopause_values),
+ sa.Column('autopausedelay', sa.Integer),
+ sa.Column('autopausebusy', yesno_values),
+ sa.Column('autopauseunavail', yesno_values),
+ sa.Column('maxlen', sa.Integer),
+ sa.Column('servicelevel', sa.Integer),
+ sa.Column('strategy', queue_strategy_values),
+ sa.Column('joinempty', sa.String(128)),
+ sa.Column('leavewhenempty', sa.String(128)),
+ sa.Column('reportholdtime', yesno_values),
+ sa.Column('memberdelay', sa.Integer),
+ sa.Column('weight', sa.Integer),
+ sa.Column('timeoutrestart', yesno_values),
+ sa.Column('defaultrule', sa.String(128)),
+ sa.Column('timeoutpriority', sa.String(128))
+ )
- op.create_table(
- 'queue_members',
- sa.Column('queue_name', sa.String(80), primary_key=True, nullable=False),
- sa.Column('interface', sa.String(80), primary_key=True, nullable=False),
- sa.Column('uniqueid', sa.String(80), nullable=False),
- sa.Column('membername', sa.String(80)),
- sa.Column('state_interface', sa.String(80)),
- sa.Column('penalty', sa.Integer),
- sa.Column('paused', sa.Integer)
- )
-
+ op.create_table(
+ 'queue_members',
+ sa.Column('queue_name', sa.String(80), primary_key=True, nullable=False),
+ sa.Column('interface', sa.String(80), primary_key=True, nullable=False),
+ sa.Column('uniqueid', sa.String(80), nullable=False),
+ sa.Column('membername', sa.String(80)),
+ sa.Column('state_interface', sa.String(80)),
+ sa.Column('penalty', sa.Integer),
+ sa.Column('paused', sa.Integer)
+ )
+ if currentcontext.bind.dialect.name == 'oracle':
+
+ op.create_table(
+ 'queues',
+ sa.Column('name', sa.String(128), nullable=False),
+ sa.Column('musiconhold', sa.String(128)),
+ sa.Column('announce', sa.String(128)),
+ sa.Column('context', sa.String(128)),
+ sa.Column('timeout', sa.Integer),
+ sa.Column('ringinuse', sa.Enum(*YESNO_VALUES, name='queYnNringinuse')),
+ sa.Column('setinterfacevar', sa.Enum(*YESNO_VALUES, name='queYnNsetinterfacevar')),
+ sa.Column('setqueuevar', sa.Enum(*YESNO_VALUES, name='queYnNsetqueuevar' )),
+ sa.Column('setqueueentryvar', sa.Enum(*YESNO_VALUES, name='queYnNsetqueueentryvar')),
+ sa.Column('monitor_format', sa.String(8)),
+ sa.Column('membermacro', sa.String(512)),
+ sa.Column('membergosub', sa.String(512)),
+ sa.Column('queue_youarenext', sa.String(128)),
+ sa.Column('queue_thereare', sa.String(128)),
+ sa.Column('queue_callswaiting', sa.String(128)),
+ sa.Column('queue_quantity1', sa.String(128)),
+ sa.Column('queue_quantity2', sa.String(128)),
+ sa.Column('queue_holdtime', sa.String(128)),
+ sa.Column('queue_minutes', sa.String(128)),
+ sa.Column('queue_minute', sa.String(128)),
+ sa.Column('queue_seconds', sa.String(128)),
+ sa.Column('queue_thankyou', sa.String(128)),
+ sa.Column('queue_callerannounce', sa.String(128)),
+ sa.Column('queue_reporthold', sa.String(128)),
+ sa.Column('announce_frequency', sa.Integer),
+ sa.Column('announce_to_first_user', sa.Enum(*YESNO_VALUES, name='queYnNannouncetofirstuser')),
+ sa.Column('min_announce_frequency', sa.Integer),
+ sa.Column('announce_round_seconds', sa.Integer),
+ sa.Column('announce_holdtime', sa.String(128)),
+ sa.Column('announce_position', sa.String(128)),
+ sa.Column('announce_position_limit', sa.Integer),
+ sa.Column('periodic_announce', sa.String(50)),
+ sa.Column('periodic_announce_frequency', sa.Integer),
+ sa.Column('relative_periodic_announce', sa.Enum(*YESNO_VALUES, name='queYnNrelativeperiodicannounce')),
+ sa.Column('random_periodic_announce', sa.Enum(*YESNO_VALUES, name='queYnNrandomperiodicannounce')),
+ sa.Column('retry', sa.Integer),
+ sa.Column('wrapuptime', sa.Integer),
+ sa.Column('penaltymemberslimit', sa.Integer),
+ sa.Column('autofill', sa.Enum(*YESNO_VALUES, name='queYnNautofill')),
+ sa.Column('monitor_type', sa.String(128)),
+ sa.Column('autopause', sa.Enum(*QUEUE_AUTOPAUSE_VALUES, name='queautopause')),
+ sa.Column('autopausedelay', sa.Integer),
+ sa.Column('autopausebusy', sa.Enum(*YESNO_VALUES, name='queYnNautopausebusy')),
+ sa.Column('autopauseunavail', sa.Enum(*YESNO_VALUES, name='queYnNautopauseunavail')),
+ sa.Column('maxlen', sa.Integer),
+ sa.Column('servicelevel', sa.Integer),
+ sa.Column('strategy', sa.Enum(*QUEUE_STRATEGY_VALUES, name='questrategy')),
+ sa.Column('joinempty', sa.String(128)),
+ sa.Column('leavewhenempty', sa.String(128)),
+ sa.Column('reportholdtime', sa.Enum(*YESNO_VALUES, name='queYnNreportholdtime')),
+ sa.Column('memberdelay', sa.Integer),
+ sa.Column('weight', sa.Integer),
+ sa.Column('timeoutrestart', sa.Enum(*YESNO_VALUES, name='queYnNtimeoutrestart')),
+ sa.Column('defaultrule', sa.String(128)),
+ sa.Column('timeoutpriority', sa.String(128))
+ )
+ op.create_primary_key('pkque_name', 'queues', ['name'])
+
+ op.create_table(
+ 'queue_members',
+ sa.Column('queue_name', sa.String(80), nullable=False),
+ sa.Column('interface', sa.String(80), nullable=False),
+ sa.Column('uniqueid', sa.String(80), nullable=False),
+ sa.Column('membername', sa.String(80)),
+ sa.Column('state_interface', sa.String(80)),
+ sa.Column('penalty', sa.Integer),
+ sa.Column('paused', sa.Integer)
+ )
+ op.create_primary_key('pkquem_name', 'queue_members', ['queue_name'])
+ op.create_index('idxquem_interface', 'queue_members', ['interface'], unique=True)
def downgrade():
- ########################## drop tables ###########################
+ ########################## drop tables ###########################
- op.drop_table('queues')
- op.drop_table('queue_members')
+ op.drop_table('queues')
+ op.drop_table('queue_members')
- ########################## drop enums ############################
+ ########################## drop enums ############################
- sa.Enum(name=QUEUE_STRATEGY_NAME).drop(op.get_bind(), checkfirst=False)
- sa.Enum(name=QUEUE_AUTOPAUSE_NAME).drop(op.get_bind(), checkfirst=False)
+ sa.Enum(name=QUEUE_STRATEGY_NAME).drop(op.get_bind(), checkfirst=False)
+ sa.Enum(name=QUEUE_AUTOPAUSE_NAME).drop(op.get_bind(), checkfirst=False)
diff --git a/contrib/ast-db-manage/config/versions/2fc7930b41b3_add_pjsip_endpoint_options_for_12_1.py b/contrib/ast-db-manage/config/versions/2fc7930b41b3_add_pjsip_endpoint_options_for_12_1.py
index 564897e..a8e8502 100755
--- a/contrib/ast-db-manage/config/versions/2fc7930b41b3_add_pjsip_endpoint_options_for_12_1.py
+++ b/contrib/ast-db-manage/config/versions/2fc7930b41b3_add_pjsip_endpoint_options_for_12_1.py
@@ -23,154 +23,247 @@
PJSIP_TRANSPORT_METHOD_NAME = 'pjsip_transport_method_values'
PJSIP_TRANSPORT_METHOD_VALUES = ['default', 'unspecified', 'tlsv1', 'sslv2',
- 'sslv3', 'sslv23']
+ 'sslv3', 'sslv23']
PJSIP_TRANSPORT_PROTOCOL_NAME = 'pjsip_transport_protocol_values'
PJSIP_TRANSPORT_PROTOCOL_VALUES = ['udp', 'tcp', 'tls', 'ws', 'wss']
def upgrade():
- ############################# Enums ##############################
+ currentcontext = op.get_context()
+ ############################# 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)
+ # 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)
- # for some reason when using 'add_column' if you don't create the enum
- # first it will think it already exists and fail
- pjsip_redirect_method_values = sa.Enum(
- *PJSIP_REDIRECT_METHOD_VALUES, name=PJSIP_REDIRECT_METHOD_NAME)
- check = False if context.is_offline_mode() else True
- pjsip_redirect_method_values.create(op.get_bind(), checkfirst=check)
+ # for some reason when using 'add_column' if you don't create the enum
+ # first it will think it already exists and fail
+ pjsip_redirect_method_values = sa.Enum(
+ *PJSIP_REDIRECT_METHOD_VALUES, name=PJSIP_REDIRECT_METHOD_NAME)
+ check = False if context.is_offline_mode() else True
+ pjsip_redirect_method_values.create(op.get_bind(), checkfirst=check)
- pjsip_transport_method_values = sa.Enum(
- *PJSIP_TRANSPORT_METHOD_VALUES, name=PJSIP_TRANSPORT_METHOD_NAME)
+ pjsip_transport_method_values = sa.Enum(
+ *PJSIP_TRANSPORT_METHOD_VALUES, name=PJSIP_TRANSPORT_METHOD_NAME)
- pjsip_transport_protocol_values = sa.Enum(
- *PJSIP_TRANSPORT_PROTOCOL_VALUES, name=PJSIP_TRANSPORT_PROTOCOL_NAME)
+ pjsip_transport_protocol_values = sa.Enum(
+ *PJSIP_TRANSPORT_PROTOCOL_VALUES, name=PJSIP_TRANSPORT_PROTOCOL_NAME)
- ######################### create tables ##########################
+ ######################### create tables ##########################
- op.create_table(
- 'ps_systems',
- sa.Column('id', sa.String(40), nullable=False, unique=True),
- sa.Column('timer_t1', sa.Integer),
- sa.Column('timer_b', sa.Integer),
- sa.Column('compact_headers', yesno_values),
- sa.Column('threadpool_initial_size', sa.Integer),
- sa.Column('threadpool_auto_increment', sa.Integer),
- sa.Column('threadpool_idle_timeout', sa.Integer),
- sa.Column('threadpool_max_size', sa.Integer),
- )
- op.create_index('ps_systems_id', 'ps_systems', ['id'])
+ if currentcontext.bind.dialect.name != 'oracle':
+ op.create_table(
+ 'ps_systems',
+ sa.Column('id', sa.String(40), nullable=False, unique=True),
+ sa.Column('timer_t1', sa.Integer),
+ sa.Column('timer_b', sa.Integer),
+ sa.Column('compact_headers', yesno_values),
+ sa.Column('threadpool_initial_size', sa.Integer),
+ sa.Column('threadpool_auto_increment', sa.Integer),
+ sa.Column('threadpool_idle_timeout', sa.Integer),
+ sa.Column('threadpool_max_size', sa.Integer),
+ )
- op.create_table(
- 'ps_globals',
- sa.Column('id', sa.String(40), nullable=False, unique=True),
- sa.Column('max_forwards', sa.Integer),
- sa.Column('user_agent', sa.String(40)),
- sa.Column('default_outbound_endpoint', sa.String(40)),
- )
+ op.create_index('ps_systems_id', 'ps_systems', ['id'])
- op.create_index('ps_globals_id', 'ps_globals', ['id'])
+ op.create_table(
+ 'ps_globals',
+ sa.Column('id', sa.String(40), nullable=False, unique=True),
+ sa.Column('max_forwards', sa.Integer),
+ sa.Column('user_agent', sa.String(40)),
+ sa.Column('default_outbound_endpoint', sa.String(40)),
+ )
- op.create_table(
- 'ps_transports',
- sa.Column('id', sa.String(40), nullable=False, unique=True),
- sa.Column('async_operations', sa.Integer),
- sa.Column('bind', sa.String(40)),
- sa.Column('ca_list_file', sa.String(200)),
- sa.Column('cert_file', sa.String(200)),
- sa.Column('cipher', sa.String(200)),
- sa.Column('domain', sa.String(40)),
- sa.Column('external_media_address', sa.String(40)),
- sa.Column('external_signaling_address', sa.String(40)),
- sa.Column('external_signaling_port', sa.Integer),
- sa.Column('method', pjsip_transport_method_values),
- sa.Column('local_net', sa.String(40)),
- sa.Column('password', sa.String(40)),
- sa.Column('priv_key_file', sa.String(200)),
- sa.Column('protocol', pjsip_transport_protocol_values),
- sa.Column('require_client_cert', yesno_values),
- sa.Column('verify_client', yesno_values),
- sa.Column('verifiy_server', yesno_values),
- sa.Column('tos', yesno_values),
- sa.Column('cos', yesno_values),
- )
+ op.create_index('ps_globals_id', 'ps_globals', ['id'])
- op.create_index('ps_transports_id', 'ps_transports', ['id'])
+ op.create_table(
+ 'ps_transports',
+ sa.Column('id', sa.String(40), nullable=False, unique=True),
+ sa.Column('async_operations', sa.Integer),
+ sa.Column('bind', sa.String(40)),
+ sa.Column('ca_list_file', sa.String(200)),
+ sa.Column('cert_file', sa.String(200)),
+ sa.Column('cipher', sa.String(200)),
+ sa.Column('domain', sa.String(40)),
+ sa.Column('external_media_address', sa.String(40)),
+ sa.Column('external_signaling_address', sa.String(40)),
+ sa.Column('external_signaling_port', sa.Integer),
+ sa.Column('method', pjsip_transport_method_values),
+ sa.Column('local_net', sa.String(40)),
+ sa.Column('password', sa.String(40)),
+ sa.Column('priv_key_file', sa.String(200)),
+ sa.Column('protocol', pjsip_transport_protocol_values),
+ sa.Column('require_client_cert', yesno_values),
+ sa.Column('verify_client', yesno_values),
+ sa.Column('verifiy_server', yesno_values),
+ sa.Column('tos', yesno_values),
+ sa.Column('cos', yesno_values),
+ )
- op.create_table(
- 'ps_registrations',
- sa.Column('id', sa.String(40), nullable=False, unique=True),
- sa.Column('auth_rejection_permanent', yesno_values),
- sa.Column('client_uri', sa.String(40)),
- sa.Column('contact_user', sa.String(40)),
- sa.Column('expiration', sa.Integer),
- sa.Column('max_retries', sa.Integer),
- sa.Column('outbound_auth', sa.String(40)),
- sa.Column('outbound_proxy', sa.String(40)),
- sa.Column('retry_interval', sa.Integer),
- sa.Column('forbidden_retry_interval', sa.Integer),
- sa.Column('server_uri', sa.String(40)),
- sa.Column('transport', sa.String(40)),
- sa.Column('support_path', yesno_values),
- )
+ op.create_index('ps_transports_id', 'ps_transports', ['id'])
- op.create_index('ps_registrations_id', 'ps_registrations', ['id'])
+ op.create_table(
+ 'ps_registrations',
+ sa.Column('id', sa.String(40), nullable=False, unique=True),
+ sa.Column('auth_rejection_permanent', yesno_values),
+ sa.Column('client_uri', sa.String(40)),
+ sa.Column('contact_user', sa.String(40)),
+ sa.Column('expiration', sa.Integer),
+ sa.Column('max_retries', sa.Integer),
+ sa.Column('outbound_auth', sa.String(40)),
+ sa.Column('outbound_proxy', sa.String(40)),
+ sa.Column('retry_interval', sa.Integer),
+ sa.Column('forbidden_retry_interval', sa.Integer),
+ sa.Column('server_uri', sa.String(40)),
+ sa.Column('transport', sa.String(40)),
+ sa.Column('support_path', yesno_values),
+ )
- ########################## add columns ###########################
+ op.create_index('ps_registrations_id', 'ps_registrations', ['id'])
- # new columns for endpoints
- op.add_column('ps_endpoints', sa.Column('media_address', sa.String(40)))
- op.add_column('ps_endpoints', sa.Column('redirect_method',
- pjsip_redirect_method_values))
- op.add_column('ps_endpoints', sa.Column('set_var', sa.Text()))
+ ########################## add columns ###########################
- # rename mwi_fromuser to mwi_from_user
- op.alter_column('ps_endpoints', 'mwi_fromuser',
- new_column_name='mwi_from_user',
- existing_type=sa.String(40))
+ # new columns for endpoints
+ op.add_column('ps_endpoints', sa.Column('media_address', sa.String(40)))
+ op.add_column('ps_endpoints', sa.Column('redirect_method',
+ pjsip_redirect_method_values))
+ op.add_column('ps_endpoints', sa.Column('set_var', sa.Text()))
- # new columns for contacts
- op.add_column('ps_contacts', sa.Column('outbound_proxy', sa.String(40)))
- op.add_column('ps_contacts', sa.Column('path', sa.Text()))
+ # rename mwi_fromuser to mwi_from_user
+ op.alter_column('ps_endpoints', 'mwi_fromuser',
+ new_column_name='mwi_from_user',
+ existing_type=sa.String(40))
- # new columns for aors
- op.add_column('ps_aors', sa.Column('maximum_expiration', sa.Integer))
- op.add_column('ps_aors', sa.Column('outbound_proxy', sa.String(40)))
- op.add_column('ps_aors', sa.Column('support_path', yesno_values))
+ # new columns for contacts
+ op.add_column('ps_contacts', sa.Column('outbound_proxy', sa.String(40)))
+ op.add_column('ps_contacts', sa.Column('path', sa.Text()))
+ # new columns for aors
+ op.add_column('ps_aors', sa.Column('maximum_expiration', sa.Integer))
+ op.add_column('ps_aors', sa.Column('outbound_proxy', sa.String(40)))
+ op.add_column('ps_aors', sa.Column('support_path', yesno_values))
+
+ if currentcontext.bind.dialect.name == 'oracle':
+ op.create_table(
+ 'ps_systems',
+ sa.Column('id', sa.String(40), nullable=False),
+ sa.Column('timer_t1', sa.Integer),
+ sa.Column('timer_b', sa.Integer),
+ sa.Column('compact_headers', sa.Enum(*YESNO_VALUES, name='pssysYnNcompactheaders')),
+ sa.Column('threadpool_initial_size', sa.Integer),
+ sa.Column('threadpool_auto_increment', sa.Integer),
+ sa.Column('threadpool_idle_timeout', sa.Integer),
+ sa.Column('threadpool_max_size', sa.Integer),
+ )
+
+ op.create_index('ps_systems_id', 'ps_systems', ['id'], unique=True)
+
+ op.create_table(
+ 'ps_globals',
+ sa.Column('id', sa.String(40), nullable=False),
+ sa.Column('max_forwards', sa.Integer),
+ sa.Column('user_agent', sa.String(40)),
+ sa.Column('default_outbound_endpoint', sa.String(40)),
+ )
+
+ op.create_index('ps_globals_id', 'ps_globals', ['id'], unique=True)
+
+ op.create_table(
+ 'ps_transports',
+ sa.Column('id', sa.String(40), nullable=False),
+ sa.Column('async_operations', sa.Integer),
+ sa.Column('bind', sa.String(40)),
+ sa.Column('ca_list_file', sa.String(200)),
+ sa.Column('cert_file', sa.String(200)),
+ sa.Column('cipher', sa.String(200)),
+ sa.Column('domain', sa.String(40)),
+ sa.Column('external_media_address', sa.String(40)),
+ sa.Column('external_signaling_address', sa.String(40)),
+ sa.Column('external_signaling_port', sa.Integer),
+ sa.Column('method', sa.Enum(*PJSIP_TRANSPORT_METHOD_VALUES, name='pstramethod')),
+ sa.Column('local_net', sa.String(40)),
+ sa.Column('password', sa.String(40)),
+ sa.Column('priv_key_file', sa.String(200)),
+ sa.Column('protocol', sa.Enum(*PJSIP_TRANSPORT_PROTOCOL_VALUES, name='pstraprotocol')),
+ sa.Column('require_client_cert', sa.Enum(*YESNO_VALUES, name='pstraYnNrequireclientcert')),
+ sa.Column('verify_client',sa.Enum(*YESNO_VALUES, name='pstraYnNverifyclient')),
+ sa.Column('verify_server',sa.Enum(*YESNO_VALUES, name='pstraYnNverifyserver')),
+ sa.Column('tos', sa.Enum(*YESNO_VALUES, name='pstraYnNtos')),
+ sa.Column('cos', sa.Enum(*YESNO_VALUES, name='pstraYnNcos')),
+ )
+
+ op.create_index('ps_transports_id', 'ps_transports', ['id'], unique=True)
+
+ op.create_table(
+ 'ps_registrations',
+ sa.Column('id', sa.String(40), nullable=False),
+ sa.Column('auth_rejection_permanent', sa.Enum(*YESNO_VALUES, name='psregYnNauthrejectionpermanent')),
+ sa.Column('client_uri', sa.String(40)),
+ sa.Column('contact_user', sa.String(40)),
+ sa.Column('expiration', sa.Integer),
+ sa.Column('max_retries', sa.Integer),
+ sa.Column('outbound_auth', sa.String(40)),
+ sa.Column('outbound_proxy', sa.String(40)),
+ sa.Column('retry_interval', sa.Integer),
+ sa.Column('forbidden_retry_interval', sa.Integer),
+ sa.Column('server_uri', sa.String(40)),
+ sa.Column('transport', sa.String(40)),
+ sa.Column('support_path', sa.Enum(*YESNO_VALUES, name='psregYnNsupportpath')),
+ )
+
+ op.create_index('ps_registrations_id', 'ps_registrations', ['id'], unique=True)
+
+ ########################## add columns ###########################
+
+ # new columns for endpoints
+ op.add_column('ps_endpoints', sa.Column('media_address', sa.String(40)))
+ op.add_column('ps_endpoints', sa.Column('redirect_method',sa.Enum(*PJSIP_REDIRECT_METHOD_VALUES, name='psepredirectmethod')))
+ op.add_column('ps_endpoints', sa.Column('set_var', sa.Text()))
+
+ # rename mwi_fromuser to mwi_from_user
+ op.alter_column('ps_endpoints', 'mwi_fromuser',new_column_name='mwi_from_user',existing_type=sa.String(40))
+
+ # new columns for contacts
+ op.add_column('ps_contacts', sa.Column('outbound_proxy', sa.String(40)))
+ op.add_column('ps_contacts', sa.Column('path', sa.Text()))
+
+ # new columns for aors
+ op.add_column('ps_aors', sa.Column('maximum_expiration', sa.Integer))
+ op.add_column('ps_aors', sa.Column('outbound_proxy', sa.String(40)))
+ op.add_column('ps_aors', sa.Column('support_path', sa.Enum(*YESNO_VALUES, name='psaorsYnNsupportpath')))
+
+
def downgrade():
- ########################## drop columns ##########################
+ ########################## drop columns ##########################
- op.drop_column('ps_aors', 'support_path')
- op.drop_column('ps_aors', 'outbound_proxy')
- op.drop_column('ps_aors', 'maximum_expiration')
+ currentcontext = op.get_context()
+
+ op.drop_column('ps_aors', 'support_path')
+ op.drop_column('ps_aors', 'outbound_proxy')
+ op.drop_column('ps_aors', 'maximum_expiration')
- op.drop_column('ps_contacts', 'path')
- op.drop_column('ps_contacts', 'outbound_proxy')
+ op.drop_column('ps_contacts', 'path')
+ op.drop_column('ps_contacts', 'outbound_proxy')
- op.alter_column('ps_endpoints', 'mwi_from_user',
- new_column_name='mwi_fromuser',
- existing_type=sa.String(40))
+ op.alter_column('ps_endpoints', 'mwi_from_user',
+ new_column_name='mwi_fromuser',
+ existing_type=sa.String(40))
- op.drop_column('ps_endpoints', 'set_var')
- op.drop_column('ps_endpoints', 'redirect_method')
- op.drop_column('ps_endpoints', 'media_address')
+ op.drop_column('ps_endpoints', 'set_var')
+ op.drop_column('ps_endpoints', 'redirect_method')
+ op.drop_column('ps_endpoints', 'media_address')
- ########################## drop tables ###########################
+ ########################## drop tables ###########################
- op.drop_table('ps_registrations')
- op.drop_table('ps_transports')
- op.drop_table('ps_globals')
- op.drop_table('ps_systems')
+ op.drop_table('ps_registrations')
+ op.drop_table('ps_transports')
+ op.drop_table('ps_globals')
+ op.drop_table('ps_systems')
+
+ ########################## drop enums ############################
- ########################## drop enums ############################
+ sa.Enum(name=PJSIP_TRANSPORT_PROTOCOL_NAME).drop(op.get_bind(), checkfirst=False)
+ sa.Enum(name=PJSIP_TRANSPORT_METHOD_NAME).drop(op.get_bind(), checkfirst=False)
+ sa.Enum(name=PJSIP_REDIRECT_METHOD_NAME).drop(op.get_bind(), checkfirst=False)
- sa.Enum(name=PJSIP_TRANSPORT_PROTOCOL_NAME).drop(
- op.get_bind(), checkfirst=False)
- sa.Enum(name=PJSIP_TRANSPORT_METHOD_NAME).drop(
- op.get_bind(), checkfirst=False)
- sa.Enum(name=PJSIP_REDIRECT_METHOD_NAME).drop(
- op.get_bind(), checkfirst=False)
diff --git a/contrib/ast-db-manage/config/versions/3855ee4e5f85_add_missing_pjsip_options.py b/contrib/ast-db-manage/config/versions/3855ee4e5f85_add_missing_pjsip_options.py
index afc1beb..0b16928 100644
--- a/contrib/ast-db-manage/config/versions/3855ee4e5f85_add_missing_pjsip_options.py
+++ b/contrib/ast-db-manage/config/versions/3855ee4e5f85_add_missing_pjsip_options.py
@@ -15,10 +15,10 @@
def upgrade():
- op.add_column('ps_endpoints', sa.Column('message_context', sa.String(40)))
- op.add_column('ps_contacts', sa.Column('user_agent', sa.String(40)))
+ op.add_column('ps_endpoints', sa.Column('message_context', sa.String(40)))
+ op.add_column('ps_contacts', sa.Column('user_agent', sa.String(40)))
def downgrade():
- op.drop_column('ps_contacts', 'user_agent')
- op.drop_column('ps_endpoints', 'message_context')
+ op.drop_column('ps_contacts', 'user_agent')
+ op.drop_column('ps_endpoints', 'message_context')
diff --git a/contrib/ast-db-manage/config/versions/43956d550a44_add_tables_for_pjsip.py b/contrib/ast-db-manage/config/versions/43956d550a44_add_tables_for_pjsip.py
index 0c4d9c8..ac4bb50 100755
--- a/contrib/ast-db-manage/config/versions/43956d550a44_add_tables_for_pjsip.py
+++ b/contrib/ast-db-manage/config/versions/43956d550a44_add_tables_for_pjsip.py
@@ -16,9 +16,9 @@
YESNO_VALUES = ['yes', 'no']
PJSIP_CID_PRIVACY_VALUES = ['allowed_not_screened', 'allowed_passed_screened',
- 'allowed_failed_screened', 'allowed',
- 'prohib_not_screened', 'prohib_passed_screened',
- 'prohib_failed_screened', 'prohib', 'unavailable']
+ 'allowed_failed_screened', 'allowed',
+ 'prohib_not_screened', 'prohib_passed_screened',
+ 'prohib_failed_screened', 'prohib', 'unavailable']
PJSIP_100REL_VALUES = ['no', 'required', 'yes']
PJSIP_CONNECTED_LINE_METHOD_VALUES = ['invite', 'reinvite', 'update']
PJSIP_DIRECT_MEDIA_GLARE_MITIGATION_VALUES = ['none', 'outgoing', 'incoming']
@@ -30,160 +30,308 @@
PJSIP_DTLS_SETUP_VALUES = ['active', 'passive', 'actpass']
PJSIP_AUTH_TYPE_VALUES = ['md5', 'userpass']
PJSIP_TRANSPORT_METHOD_VALUES = ['default', 'unspecified', 'tlsv1', 'sslv2',
- 'sslv3', 'sslv23']
+ 'sslv3', 'sslv23']
PJSIP_TRANSPORT_PROTOCOL_VALUES = ['udp', 'tcp', 'tls', 'ws', 'wss']
def upgrade():
- op.create_table(
- 'ps_endpoints',
- sa.Column('id', sa.String(40), nullable=False, unique=True),
- sa.Column('transport', sa.String(40)),
- sa.Column('aors', sa.String(200)),
- sa.Column('auth', sa.String(40)),
- sa.Column('context', sa.String(40)),
- sa.Column('disallow', sa.String(200)),
- sa.Column('allow', sa.String(200)),
- sa.Column('direct_media', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('connected_line_method',
- sa.Enum(*PJSIP_CONNECTED_LINE_METHOD_VALUES, name='pjsip_connected_line_method_values')),
- sa.Column('direct_media_method',
- sa.Enum(*PJSIP_CONNECTED_LINE_METHOD_VALUES, name='pjsip_connected_line_method_values')),
- sa.Column('direct_media_glare_mitigation',
- sa.Enum(*PJSIP_DIRECT_MEDIA_GLARE_MITIGATION_VALUES, name='pjsip_direct_media_glare_mitigation_values')),
- sa.Column('disable_direct_media_on_nat', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('dtmf_mode', sa.Enum(*PJSIP_DTMF_MODE_VALUES, name='pjsip_dtmf_mode_values')),
- sa.Column('external_media_address', sa.String(40)),
- sa.Column('force_rport', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('ice_support', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('identify_by', sa.Enum(*PJSIP_IDENTIFY_BY_VALUES, name='pjsip_identify_by_values')),
- sa.Column('mailboxes', sa.String(40)),
- sa.Column('moh_suggest', sa.String(40)),
- sa.Column('outbound_auth', sa.String(40)),
- sa.Column('outbound_proxy', sa.String(40)),
- sa.Column('rewrite_contact', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('rtp_ipv6', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('rtp_symmetric', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('send_diversion', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('send_pai', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('send_rpid', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('timers_min_se', sa.Integer),
- sa.Column('timers', sa.Enum(*PJSIP_TIMERS_VALUES, name='pjsip_timer_values')),
- sa.Column('timers_sess_expires', sa.Integer),
- sa.Column('callerid', sa.String(40)),
- sa.Column('callerid_privacy', sa.Enum(*PJSIP_CID_PRIVACY_VALUES, name='pjsip_cid_privacy_values')),
- sa.Column('callerid_tag', sa.String(40)),
- sa.Column('100rel', sa.Enum(*PJSIP_100REL_VALUES, name='pjsip_100rel_values')),
- sa.Column('aggregate_mwi', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('trust_id_inbound', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('trust_id_outbound', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('use_ptime', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('use_avpf', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('media_encryption', sa.Enum(*PJSIP_MEDIA_ENCRYPTION_VALUES, name='pjsip_media_encryption_values')),
- sa.Column('inband_progress', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('call_group', sa.String(40)),
- sa.Column('pickup_group', sa.String(40)),
- sa.Column('named_call_group', sa.String(40)),
- sa.Column('named_pickup_group', sa.String(40)),
- sa.Column('device_state_busy_at', sa.Integer),
- sa.Column('fax_detect', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('t38_udptl', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('t38_udptl_ec', sa.Enum(*PJSIP_T38UDPTL_EC_VALUES, name='pjsip_t38udptl_ec_values')),
- sa.Column('t38_udptl_maxdatagram', sa.Integer),
- sa.Column('t38_udptl_nat', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('t38_udptl_ipv6', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('tone_zone', sa.String(40)),
- sa.Column('language', sa.String(40)),
- sa.Column('one_touch_recording', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('record_on_feature', sa.String(40)),
- sa.Column('record_off_feature', sa.String(40)),
- sa.Column('rtp_engine', sa.String(40)),
- sa.Column('allow_transfer', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('allow_subscribe', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('sdp_owner', sa.String(40)),
- sa.Column('sdp_session', sa.String(40)),
- sa.Column('tos_audio', sa.Integer),
- sa.Column('tos_video', sa.Integer),
- sa.Column('cos_audio', sa.Integer),
- sa.Column('cos_video', sa.Integer),
- sa.Column('sub_min_expiry', sa.Integer),
- sa.Column('from_domain', sa.String(40)),
- sa.Column('from_user', sa.String(40)),
- sa.Column('mwi_fromuser', sa.String(40)),
- sa.Column('dtls_verify', sa.String(40)),
- sa.Column('dtls_rekey', sa.String(40)),
- sa.Column('dtls_cert_file', sa.String(200)),
- sa.Column('dtls_private_key', sa.String(200)),
- sa.Column('dtls_cipher', sa.String(200)),
- sa.Column('dtls_ca_file', sa.String(200)),
- sa.Column('dtls_ca_path', sa.String(200)),
- sa.Column('dtls_setup', sa.Enum(*PJSIP_DTLS_SETUP_VALUES, name='pjsip_dtls_setup_values')),
- sa.Column('srtp_tag_32', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- )
+ currentcontext = op.get_context()
+ if currentcontext.bind.dialect.name != 'oracle':
+ op.create_table(
+ 'ps_endpoints',
+ sa.Column('id', sa.String(40), nullable=False, unique=True),
+ sa.Column('transport', sa.String(40)),
+ sa.Column('aors', sa.String(200)),
+ sa.Column('auth', sa.String(40)),
+ sa.Column('context', sa.String(40)),
+ sa.Column('disallow', sa.String(200)),
+ sa.Column('allow', sa.String(200)),
+ sa.Column('direct_media', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('connected_line_method',
+ sa.Enum(*PJSIP_CONNECTED_LINE_METHOD_VALUES, name='pjsip_connected_line_method_values')),
+ sa.Column('direct_media_method',
+ sa.Enum(*PJSIP_CONNECTED_LINE_METHOD_VALUES, name='pjsip_connected_line_method_values')),
+ sa.Column('direct_media_glare_mitigation',
+ sa.Enum(*PJSIP_DIRECT_MEDIA_GLARE_MITIGATION_VALUES, name='pjsip_direct_media_glare_mitigation_values')),
+ sa.Column('disable_direct_media_on_nat', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('dtmf_mode', sa.Enum(*PJSIP_DTMF_MODE_VALUES, name='pjsip_dtmf_mode_values')),
+ sa.Column('external_media_address', sa.String(40)),
+ sa.Column('force_rport', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('ice_support', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('identify_by', sa.Enum(*PJSIP_IDENTIFY_BY_VALUES, name='pjsip_identify_by_values')),
+ sa.Column('mailboxes', sa.String(40)),
+ sa.Column('moh_suggest', sa.String(40)),
+ sa.Column('outbound_auth', sa.String(40)),
+ sa.Column('outbound_proxy', sa.String(40)),
+ sa.Column('rewrite_contact', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('rtp_ipv6', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('rtp_symmetric', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('send_diversion', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('send_pai', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('send_rpid', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('timers_min_se', sa.Integer),
+ sa.Column('timers', sa.Enum(*PJSIP_TIMERS_VALUES, name='pjsip_timer_values')),
+ sa.Column('timers_sess_expires', sa.Integer),
+ sa.Column('callerid', sa.String(40)),
+ sa.Column('callerid_privacy', sa.Enum(*PJSIP_CID_PRIVACY_VALUES, name='pjsip_cid_privacy_values')),
+ sa.Column('callerid_tag', sa.String(40)),
+ sa.Column('100rel', sa.Enum(*PJSIP_100REL_VALUES, name='pjsip_100rel_values')),
+ sa.Column('aggregate_mwi', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('trust_id_inbound', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('trust_id_outbound', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('use_ptime', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('use_avpf', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('media_encryption', sa.Enum(*PJSIP_MEDIA_ENCRYPTION_VALUES, name='pjsip_media_encryption_values')),
+ sa.Column('inband_progress', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('call_group', sa.String(40)),
+ sa.Column('pickup_group', sa.String(40)),
+ sa.Column('named_call_group', sa.String(40)),
+ sa.Column('named_pickup_group', sa.String(40)),
+ sa.Column('device_state_busy_at', sa.Integer),
+ sa.Column('fax_detect', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('t38_udptl', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('t38_udptl_ec', sa.Enum(*PJSIP_T38UDPTL_EC_VALUES, name='pjsip_t38udptl_ec_values')),
+ sa.Column('t38_udptl_maxdatagram', sa.Integer),
+ sa.Column('t38_udptl_nat', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('t38_udptl_ipv6', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('tone_zone', sa.String(40)),
+ sa.Column('language', sa.String(40)),
+ sa.Column('one_touch_recording', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('record_on_feature', sa.String(40)),
+ sa.Column('record_off_feature', sa.String(40)),
+ sa.Column('rtp_engine', sa.String(40)),
+ sa.Column('allow_transfer', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('allow_subscribe', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('sdp_owner', sa.String(40)),
+ sa.Column('sdp_session', sa.String(40)),
+ sa.Column('tos_audio', sa.Integer),
+ sa.Column('tos_video', sa.Integer),
+ sa.Column('cos_audio', sa.Integer),
+ sa.Column('cos_video', sa.Integer),
+ sa.Column('sub_min_expiry', sa.Integer),
+ sa.Column('from_domain', sa.String(40)),
+ sa.Column('from_user', sa.String(40)),
+ sa.Column('mwi_fromuser', sa.String(40)),
+ sa.Column('dtls_verify', sa.String(40)),
+ sa.Column('dtls_rekey', sa.String(40)),
+ sa.Column('dtls_cert_file', sa.String(200)),
+ sa.Column('dtls_private_key', sa.String(200)),
+ sa.Column('dtls_cipher', sa.String(200)),
+ sa.Column('dtls_ca_file', sa.String(200)),
+ sa.Column('dtls_ca_path', sa.String(200)),
+ sa.Column('dtls_setup', sa.Enum(*PJSIP_DTLS_SETUP_VALUES, name='pjsip_dtls_setup_values')),
+ sa.Column('srtp_tag_32', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ )
- op.create_index('ps_endpoints_id', 'ps_endpoints', ['id'])
+ op.create_index('ps_endpoints_id', 'ps_endpoints', ['id'])
- op.create_table(
- 'ps_auths',
- sa.Column('id', sa.String(40), nullable=False, unique=True),
- sa.Column('auth_type', sa.Enum(*PJSIP_AUTH_TYPE_VALUES, name='pjsip_auth_type_values')),
- sa.Column('nonce_lifetime', sa.Integer),
- sa.Column('md5_cred', sa.String(40)),
- sa.Column('password', sa.String(80)),
- sa.Column('realm', sa.String(40)),
- sa.Column('username', sa.String(40)),
- )
+ op.create_table(
+ 'ps_auths',
+ sa.Column('id', sa.String(40), nullable=False, unique=True),
+ sa.Column('auth_type', sa.Enum(*PJSIP_AUTH_TYPE_VALUES, name='pjsip_auth_type_values')),
+ sa.Column('nonce_lifetime', sa.Integer),
+ sa.Column('md5_cred', sa.String(40)),
+ sa.Column('password', sa.String(80)),
+ sa.Column('realm', sa.String(40)),
+ sa.Column('username', sa.String(40)),
+ )
- op.create_index('ps_auths_id', 'ps_auths', ['id'])
+ op.create_index('ps_auths_id', 'ps_auths', ['id'])
- op.create_table(
- 'ps_aors',
- sa.Column('id', sa.String(40), nullable=False, unique=True),
- sa.Column('contact', sa.String(40)),
- sa.Column('default_expiration', sa.Integer),
- sa.Column('mailboxes', sa.String(80)),
- sa.Column('max_contacts', sa.Integer),
- sa.Column('minimum_expiration', sa.Integer),
- sa.Column('remove_existing', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- sa.Column('qualify_frequency', sa.Integer),
- sa.Column('authenticate_qualify', sa.Enum(*YESNO_VALUES, name='yesno_values')),
- )
+ op.create_table(
+ 'ps_aors',
+ sa.Column('id', sa.String(40), nullable=False, unique=True),
+ sa.Column('contact', sa.String(40)),
+ sa.Column('default_expiration', sa.Integer),
+ sa.Column('mailboxes', sa.String(80)),
+ sa.Column('max_contacts', sa.Integer),
+ sa.Column('minimum_expiration', sa.Integer),
+ sa.Column('remove_existing', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ sa.Column('qualify_frequency', sa.Integer),
+ sa.Column('authenticate_qualify', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+ )
- op.create_index('ps_aors_id', 'ps_aors', ['id'])
+ op.create_index('ps_aors_id', 'ps_aors', ['id'])
- op.create_table(
- 'ps_contacts',
- sa.Column('id', sa.String(40), nullable=False, unique=True),
- sa.Column('uri', sa.String(40)),
- sa.Column('expiration_time', sa.String(40)),
- sa.Column('qualify_frequency', sa.Integer),
- )
+ op.create_table(
+ 'ps_contacts',
+ sa.Column('id', sa.String(40), nullable=False, unique=True),
+ sa.Column('uri', sa.String(40)),
+ sa.Column('expiration_time', sa.String(40)),
+ sa.Column('qualify_frequency', sa.Integer),
+ )
- op.create_index('ps_contacts_id', 'ps_contacts', ['id'])
+ op.create_index('ps_contacts_id', 'ps_contacts', ['id'])
- op.create_table(
- 'ps_domain_aliases',
- sa.Column('id', sa.String(40), nullable=False, unique=True),
- sa.Column('domain', sa.String(80)),
- )
+ op.create_table(
+ 'ps_domain_aliases',
+ sa.Column('id', sa.String(40), nullable=False, unique=True),
+ sa.Column('domain', sa.String(80)),
+ )
- op.create_index('ps_domain_aliases_id', 'ps_domain_aliases', ['id'])
+ op.create_index('ps_domain_aliases_id', 'ps_domain_aliases', ['id'])
- op.create_table(
- 'ps_endpoint_id_ips',
- sa.Column('id', sa.String(40), nullable=False, unique=True),
- sa.Column('endpoint', sa.String(40)),
- sa.Column('match', sa.String(80)),
- )
+ op.create_table(
+ 'ps_endpoint_id_ips',
+ sa.Column('id', sa.String(40), nullable=False, unique=True),
+ sa.Column('endpoint', sa.String(40)),
+ sa.Column('match', sa.String(80)),
+ )
- op.create_index('ps_endpoint_id_ips_id',
- 'ps_endpoint_id_ips', ['id'])
+ op.create_index('ps_endpoint_id_ips_id',
+ 'ps_endpoint_id_ips', ['id'])
+
+ if currentcontext.bind.dialect.name == 'oracle':
+ op.create_table(
+ 'ps_endpoints',
+ sa.Column('id', sa.String(40), nullable=False),
+ sa.Column('transport', sa.String(40)),
+ sa.Column('aors', sa.String(200)),
+ sa.Column('auth', sa.String(40)),
+ sa.Column('context', sa.String(40)),
+ sa.Column('disallow', sa.String(200)),
+ sa.Column('allow', sa.String(200)),
+ sa.Column('direct_media', sa.Enum(*YESNO_VALUES, name='psepYnNdirectmedia')),
+ sa.Column('connected_line_method',
+ sa.Enum(*PJSIP_CONNECTED_LINE_METHOD_VALUES, name='psepconnectedlinemethod')),
+ sa.Column('direct_media_method',
+ sa.Enum(*PJSIP_CONNECTED_LINE_METHOD_VALUES, name='psepdirectmediamethod')),
+ sa.Column('direct_media_glare_mitigation',
+ sa.Enum(*PJSIP_DIRECT_MEDIA_GLARE_MITIGATION_VALUES, name='psepdirectmediaglaremitigation')),
+ sa.Column('disable_direct_media_on_nat', sa.Enum(*YESNO_VALUES, name='psepYnN')),
+ sa.Column('dtmf_mode', sa.Enum(*PJSIP_DTMF_MODE_VALUES, name='psepdtmfmode')),
+ sa.Column('external_media_address', sa.String(40)),
+ sa.Column('force_rport', sa.Enum(*YESNO_VALUES, name='psepYnNforcerport')),
+ sa.Column('ice_support', sa.Enum(*YESNO_VALUES, name='psepYnNicesupport')),
+ sa.Column('identify_by', sa.Enum(*PJSIP_IDENTIFY_BY_VALUES, name='psepidentifyby')),
+ sa.Column('mailboxes', sa.String(40)),
+ sa.Column('moh_suggest', sa.String(40)),
+ sa.Column('outbound_auth', sa.String(40)),
+ sa.Column('outbound_proxy', sa.String(40)),
+ sa.Column('rewrite_contact', sa.Enum(*YESNO_VALUES, name='psepYnNrewritecontact')),
+ sa.Column('rtp_ipv6', sa.Enum(*YESNO_VALUES, name='psepYnNrtpipv6')),
+ sa.Column('rtp_symmetric', sa.Enum(*YESNO_VALUES, name='psepYnNrtpsymmetric')),
+ sa.Column('send_diversion', sa.Enum(*YESNO_VALUES, name='psepYnNsenddiversion')),
+ sa.Column('send_pai', sa.Enum(*YESNO_VALUES, name='psepYnNsendpai')),
+ sa.Column('send_rpid', sa.Enum(*YESNO_VALUES, name='psepYnNsendrpid')),
+ sa.Column('timers_min_se', sa.Integer),
+ sa.Column('timers', sa.Enum(*PJSIP_TIMERS_VALUES, name='pseptimer')),
+ sa.Column('timers_sess_expires', sa.Integer),
+ sa.Column('callerid', sa.String(40)),
+ sa.Column('callerid_privacy', sa.Enum(*PJSIP_CID_PRIVACY_VALUES, name='psepcidprivacy')),
+ sa.Column('callerid_tag', sa.String(40)),
+ sa.Column('100rel', sa.Enum(*PJSIP_100REL_VALUES, name='psep100rel')),
+ sa.Column('aggregate_mwi', sa.Enum(*YESNO_VALUES, name='psepYnNaggregate_mwi')),
+ sa.Column('trust_id_inbound', sa.Enum(*YESNO_VALUES, name='psepYnNtrustidinbound')),
+ sa.Column('trust_id_outbound', sa.Enum(*YESNO_VALUES, name='psepYnNtrustidoutbound')),
+ sa.Column('use_ptime', sa.Enum(*YESNO_VALUES, name='psepYnNuseptime')),
+ sa.Column('use_avpf', sa.Enum(*YESNO_VALUES, name='psepYnNuseavpf')),
+ sa.Column('media_encryption', sa.Enum(*PJSIP_MEDIA_ENCRYPTION_VALUES, name='psepmediaencryption')),
+ sa.Column('inband_progress', sa.Enum(*YESNO_VALUES, name='psepYnNinbandprogress')),
+ sa.Column('call_group', sa.String(40)),
+ sa.Column('pickup_group', sa.String(40)),
+ sa.Column('named_call_group', sa.String(40)),
+ sa.Column('named_pickup_group', sa.String(40)),
+ sa.Column('device_state_busy_at', sa.Integer),
+ sa.Column('fax_detect', sa.Enum(*YESNO_VALUES, name='psepYnNfaxdetect')),
+ sa.Column('t38_udptl', sa.Enum(*YESNO_VALUES, name='psepYnNt38udptl')),
+ sa.Column('t38_udptl_ec', sa.Enum(*PJSIP_T38UDPTL_EC_VALUES, name='psept38udptlec')),
+ sa.Column('t38_udptl_maxdatagram', sa.Integer),
+ sa.Column('t38_udptl_nat', sa.Enum(*YESNO_VALUES, name='psepYnNt38udptlnat')),
+ sa.Column('t38_udptl_ipv6', sa.Enum(*YESNO_VALUES, name='psepYnNt38udptlipv6')),
+ sa.Column('tone_zone', sa.String(40)),
+ sa.Column('language', sa.String(40)),
+ sa.Column('one_touch_recording', sa.Enum(*YESNO_VALUES, name='psepYnNonetouchrecording')),
+ sa.Column('record_on_feature', sa.String(40)),
+ sa.Column('record_off_feature', sa.String(40)),
+ sa.Column('rtp_engine', sa.String(40)),
+ sa.Column('allow_transfer', sa.Enum(*YESNO_VALUES, name='psepYnNallowtransfer')),
+ sa.Column('allow_subscribe', sa.Enum(*YESNO_VALUES, name='psepYnNallowsubscribe')),
+ sa.Column('sdp_owner', sa.String(40)),
+ sa.Column('sdp_session', sa.String(40)),
+ sa.Column('tos_audio', sa.Integer),
+ sa.Column('tos_video', sa.Integer),
+ sa.Column('cos_audio', sa.Integer),
+ sa.Column('cos_video', sa.Integer),
+ sa.Column('sub_min_expiry', sa.Integer),
+ sa.Column('from_domain', sa.String(40)),
+ sa.Column('from_user', sa.String(40)),
+ sa.Column('mwi_fromuser', sa.String(40)),
+ sa.Column('dtls_verify', sa.String(40)),
+ sa.Column('dtls_rekey', sa.String(40)),
+ sa.Column('dtls_cert_file', sa.String(200)),
+ sa.Column('dtls_private_key', sa.String(200)),
+ sa.Column('dtls_cipher', sa.String(200)),
+ sa.Column('dtls_ca_file', sa.String(200)),
+ sa.Column('dtls_ca_path', sa.String(200)),
+ sa.Column('dtls_setup', sa.Enum(*PJSIP_DTLS_SETUP_VALUES, name='psepdtlssetup')),
+ sa.Column('srtp_tag_32', sa.Enum(*YESNO_VALUES, name='psepYnNsrtptag32')),
+ )
+
+ op.create_index('ps_endpoints_id', 'ps_endpoints', ['id'], unique=True)
+
+ op.create_table(
+ 'ps_auths',
+ sa.Column('id', sa.String(40), nullable=False),
+ sa.Column('auth_type', sa.Enum(*PJSIP_AUTH_TYPE_VALUES, name='psaauthtype')),
+ sa.Column('nonce_lifetime', sa.Integer),
+ sa.Column('md5_cred', sa.String(40)),
+ sa.Column('password', sa.String(80)),
+ sa.Column('realm', sa.String(40)),
+ sa.Column('username', sa.String(40)),
+ )
+
+ op.create_index('ps_auths_id', 'ps_auths', ['id'], unique=True)
+
+ op.create_table(
+ 'ps_aors',
+ sa.Column('id', sa.String(40), nullable=False),
+ sa.Column('contact', sa.String(40)),
+ sa.Column('default_expiration', sa.Integer),
+ sa.Column('mailboxes', sa.String(80)),
+ sa.Column('max_contacts', sa.Integer),
+ sa.Column('minimum_expiration', sa.Integer),
+ sa.Column('remove_existing', sa.Enum(*YESNO_VALUES, name='psaorsYnNremoveexisting')),
+ sa.Column('qualify_frequency', sa.Integer),
+ sa.Column('authenticate_qualify', sa.Enum(*YESNO_VALUES, name='psaorsYnNauthenticatequalify')),
+ )
+
+ op.create_index('ps_aors_id', 'ps_aors', ['id'], unique=True)
+
+ op.create_table(
+ 'ps_contacts',
+ sa.Column('id', sa.String(40), nullable=False),
+ sa.Column('uri', sa.String(40)),
+ sa.Column('expiration_time', sa.String(40)),
+ sa.Column('qualify_frequency', sa.Integer),
+ )
+
+ op.create_index('ps_contacts_id', 'ps_contacts', ['id'], unique=True)
+
+ op.create_table(
+ 'ps_domain_aliases',
+ sa.Column('id', sa.String(40), nullable=False),
+ sa.Column('domain', sa.String(80)),
+ )
+
+ op.create_index('ps_domain_aliases_id', 'ps_domain_aliases', ['id'], unique=True)
+
+ op.create_table(
+ 'ps_endpoint_id_ips',
+ sa.Column('id', sa.String(40), nullable=False),
+ sa.Column('endpoint', sa.String(40)),
+ sa.Column('match', sa.String(80)),
+ )
+
+ op.create_index('ps_endpoint_id_ips_id',
+ 'ps_endpoint_id_ips', ['id'], unique=True)
+
def downgrade():
- op.drop_table('ps_endpoints')
- op.drop_table('ps_auths')
- op.drop_table('ps_aors')
- op.drop_table('ps_contacts')
- op.drop_table('ps_domain_aliases')
- op.drop_table('ps_endpoint_id_ips')
+ op.drop_table('ps_endpoints')
+ op.drop_table('ps_auths')
+ op.drop_table('ps_aors')
+ op.drop_table('ps_contacts')
+ op.drop_table('ps_domain_aliases')
+ op.drop_table('ps_endpoint_id_ips')
diff --git a/contrib/ast-db-manage/config/versions/4c573e7135bd_fix_tos_field_types.py b/contrib/ast-db-manage/config/versions/4c573e7135bd_fix_tos_field_types.py
index aefddd1..f58f7f9 100755
--- a/contrib/ast-db-manage/config/versions/4c573e7135bd_fix_tos_field_types.py
+++ b/contrib/ast-db-manage/config/versions/4c573e7135bd_fix_tos_field_types.py
@@ -19,43 +19,45 @@
YESNO_VALUES = ['yes', 'no']
def upgrade():
- op.alter_column('ps_endpoints', 'tos_audio',
- type_=sa.String(10))
- op.alter_column('ps_endpoints', 'tos_video',
- type_=sa.String(10))
- op.alter_column('ps_transports', 'tos',
- type_=sa.String(10))
+ op.alter_column('ps_endpoints', 'tos_audio',
+ type_=sa.String(10))
+ op.alter_column('ps_endpoints', 'tos_video',
+ type_=sa.String(10))
+ op.alter_column('ps_transports', 'tos',
+ type_=sa.String(10))
- # Can't cast YENO_VALUES to Integers, so dropping and adding is required
- op.drop_column('ps_endpoints', 'cos_audio')
- op.drop_column('ps_endpoints', 'cos_video')
- op.drop_column('ps_transports', 'cos')
+ # Can't cast YENO_VALUES to Integers, so dropping and adding is required
+ op.drop_column('ps_endpoints', 'cos_audio')
+ op.drop_column('ps_endpoints', 'cos_video')
+ op.drop_column('ps_transports', 'cos')
- op.add_column('ps_endpoints', sa.Column('cos_audio', sa.Integer))
- op.add_column('ps_endpoints', sa.Column('cos_video', sa.Integer))
- op.add_column('ps_transports', sa.Column('cos', sa.Integer))
- pass
+ op.add_column('ps_endpoints', sa.Column('cos_audio', sa.Integer))
+ op.add_column('ps_endpoints', sa.Column('cos_video', sa.Integer))
+ op.add_column('ps_transports', sa.Column('cos', sa.Integer))
+ pass
def downgrade():
+ currentcontext = op.get_context()
+
+ yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
- yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
+ # Can't cast string to YESNO_VALUES, so dropping and adding is required
+ if currentcontext.bind.dialect.name != 'oracle':
+ op.drop_column('ps_endpoints', 'tos_audio')
+ op.drop_column('ps_endpoints', 'tos_video')
+ op.drop_column('ps_transports', 'tos')
- # Can't cast string to YESNO_VALUES, so dropping and adding is required
- op.drop_column('ps_endpoints', 'tos_audio')
- op.drop_column('ps_endpoints', 'tos_video')
- op.drop_column('ps_transports', 'tos')
+ op.add_column('ps_endpoints', sa.Column('tos_audio', yesno_values))
+ op.add_column('ps_endpoints', sa.Column('tos_video', yesno_values))
+ op.add_column('ps_transports', sa.Column('tos', yesno_values))
- op.add_column('ps_endpoints', sa.Column('tos_audio', yesno_values))
- op.add_column('ps_endpoints', sa.Column('tos_video', yesno_values))
- op.add_column('ps_transports', sa.Column('tos', yesno_values))
+ # Can't cast integers to YESNO_VALUES, so dropping and adding is required
+ op.drop_column('ps_endpoints', 'cos_audio')
+ op.drop_column('ps_endpoints', 'cos_video')
+ op.drop_column('ps_transports', 'cos')
- # Can't cast integers to YESNO_VALUES, so dropping and adding is required
- op.drop_column('ps_endpoints', 'cos_audio')
- op.drop_column('ps_endpoints', 'cos_video')
- op.drop_column('ps_transports', 'cos')
-
- op.add_column('ps_endpoints', sa.Column('cos_audio', yesno_values))
- op.add_column('ps_endpoints', sa.Column('cos_video', yesno_values))
- op.add_column('ps_transports', sa.Column('cos', yesno_values))
- pass
+ op.add_column('ps_endpoints', sa.Column('cos_audio', yesno_values))
+ op.add_column('ps_endpoints', sa.Column('cos_video', yesno_values))
+ op.add_column('ps_transports', sa.Column('cos', yesno_values))
+ pass
diff --git a/contrib/ast-db-manage/config/versions/4da0c5f79a9c_create_tables.py b/contrib/ast-db-manage/config/versions/4da0c5f79a9c_create_tables.py
index ffaff92..dfd9434 100755
--- a/contrib/ast-db-manage/config/versions/4da0c5f79a9c_create_tables.py
+++ b/contrib/ast-db-manage/config/versions/4da0c5f79a9c_create_tables.py
@@ -42,9 +42,9 @@
SIP_SESSION_TIMERS_VALUES = ['accept', 'refuse', 'originate']
SIP_SESSION_REFRESHER_VALUES = ['uac', 'uas']
SIP_CALLINGPRES_VALUES = ['allowed_not_screened', 'allowed_passed_screen',
- 'allowed_failed_screen', 'allowed',
- 'prohib_not_screened', 'prohib_passed_screen',
- 'prohib_failed_screen', 'prohib']
+ 'allowed_failed_screen', 'allowed',
+ 'prohib_not_screened', 'prohib_passed_screen',
+ 'prohib_failed_screen', 'prohib']
IAX_REQUIRECALLTOKEN_VALUES = ['yes', 'no', 'auto']
IAX_ENCRYPTION_VALUES = ['yes', 'no', 'aes128']
@@ -54,277 +54,515 @@
def upgrade():
- op.create_table(
- 'sippeers',
- sa.Column('id', sa.Integer, primary_key=True, nullable=False,
- autoincrement=True),
- sa.Column('name', sa.String(40), nullable=False, unique=True),
- sa.Column('ipaddr', sa.String(45)),
- sa.Column('port', sa.Integer),
- sa.Column('regseconds', sa.Integer),
- sa.Column('defaultuser', sa.String(40)),
- sa.Column('fullcontact', sa.String(80)),
- sa.Column('regserver', sa.String(20)),
- sa.Column('useragent', sa.String(20)),
- sa.Column('lastms', sa.Integer),
- sa.Column('host', sa.String(40)),
- sa.Column('type', sa.Enum(*TYPE_VALUES, name='type_values')),
- sa.Column('context', sa.String(40)),
- sa.Column('permit', sa.String(95)),
- sa.Column('deny', sa.String(95)),
- sa.Column('secret', sa.String(40)),
- sa.Column('md5secret', sa.String(40)),
- sa.Column('remotesecret', sa.String(40)),
- sa.Column('transport', sa.Enum(*SIP_TRANSPORT_VALUES,
- name='sip_transport_values')),
- sa.Column('dtmfmode', sa.Enum(*SIP_DTMFMODE_VALUES,
- name='sip_dtmfmode_values')),
- sa.Column('directmedia', sa.Enum(*SIP_DIRECTMEDIA_VALUES,
- name='sip_directmedia_values')),
- sa.Column('nat', sa.String(29)),
- sa.Column('callgroup', sa.String(40)),
- sa.Column('pickupgroup', sa.String(40)),
- sa.Column('language', sa.String(40)),
- sa.Column('disallow', sa.String(200)),
- sa.Column('allow', sa.String(200)),
- sa.Column('insecure', sa.String(40)),
- sa.Column('trustrpid', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('progressinband', sa.Enum(*SIP_PROGRESSINBAND_VALUES,
- name='sip_progressinband_values')),
- sa.Column('promiscredir', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('useclientcode', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('accountcode', sa.String(40)),
- sa.Column('setvar', sa.String(200)),
- sa.Column('callerid', sa.String(40)),
- sa.Column('amaflags', sa.String(40)),
- sa.Column('callcounter', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('busylevel', sa.Integer),
- sa.Column('allowoverlap', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('allowsubscribe', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('videosupport', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('maxcallbitrate', sa.Integer),
- sa.Column('rfc2833compensate', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('mailbox', sa.String(40)),
- sa.Column('session-timers', sa.Enum(*SIP_SESSION_TIMERS_VALUES,
- name='sip_session_timers_values')),
- sa.Column('session-expires', sa.Integer),
- sa.Column('session-minse', sa.Integer),
- sa.Column('session-refresher', sa.Enum(*SIP_SESSION_REFRESHER_VALUES,
- name='sip_session_refresher_values')),
- sa.Column('t38pt_usertpsource', sa.String(40)),
- sa.Column('regexten', sa.String(40)),
- sa.Column('fromdomain', sa.String(40)),
- sa.Column('fromuser', sa.String(40)),
- sa.Column('qualify', sa.String(40)),
- sa.Column('defaultip', sa.String(45)),
- sa.Column('rtptimeout', sa.Integer),
- sa.Column('rtpholdtimeout', sa.Integer),
- sa.Column('sendrpid', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('outboundproxy', sa.String(40)),
- sa.Column('callbackextension', sa.String(40)),
- sa.Column('timert1', sa.Integer),
- sa.Column('timerb', sa.Integer),
- sa.Column('qualifyfreq', sa.Integer),
- sa.Column('constantssrc', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('contactpermit', sa.String(95)),
- sa.Column('contactdeny', sa.String(95)),
- sa.Column('usereqphone', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
- sa.Column('textsupport', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
- sa.Column('faxdetect', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
- sa.Column('buggymwi', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
- sa.Column('auth', sa.String(40)),
- sa.Column('fullname', sa.String(40)),
- sa.Column('trunkname', sa.String(40)),
- sa.Column('cid_number', sa.String(40)),
- sa.Column('callingpres', sa.Enum(*SIP_CALLINGPRES_VALUES,
- name='sip_callingpres_values')),
- sa.Column('mohinterpret', sa.String(40)),
- sa.Column('mohsuggest', sa.String(40)),
- sa.Column('parkinglot', sa.String(40)),
- sa.Column('hasvoicemail', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('subscribemwi', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('vmexten', sa.String(40)),
- sa.Column('autoframing', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
- sa.Column('rtpkeepalive', sa.Integer),
- sa.Column('call-limit', sa.Integer),
- sa.Column('g726nonstandard', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('ignoresdpversion', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('allowtransfer', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('dynamic', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
- sa.Column('path', sa.String(256)),
- sa.Column('supportpath', sa.Enum(*YESNO_VALUES, name='yes_no_values'))
- )
- op.create_index('sippeers_name', 'sippeers', ['name'])
- op.create_index('sippeers_name_host', 'sippeers', ['name', 'host'])
- op.create_index('sippeers_ipaddr_port', 'sippeers', ['ipaddr', 'port'])
- op.create_index('sippeers_host_port', 'sippeers', ['host', 'port'])
+ currentcontext = op.get_context()
- op.create_table(
- 'iaxfriends',
- sa.Column('id', sa.Integer, primary_key=True, nullable=False,
- autoincrement=True),
- sa.Column('name', sa.String(40), nullable=False, unique=True),
- sa.Column('type', sa.Enum(*TYPE_VALUES, name='type_values')),
- sa.Column('username', sa.String(40)),
- sa.Column('mailbox', sa.String(40)),
- sa.Column('secret', sa.String(40)),
- sa.Column('dbsecret', sa.String(40)),
- sa.Column('context', sa.String(40)),
- sa.Column('regcontext', sa.String(40)),
- sa.Column('host', sa.String(40)),
- sa.Column('ipaddr', sa.String(40)),
- sa.Column('port', sa.Integer),
- sa.Column('defaultip', sa.String(20)),
- sa.Column('sourceaddress', sa.String(20)),
- sa.Column('mask', sa.String(20)),
- sa.Column('regexten', sa.String(40)),
- sa.Column('regseconds', sa.Integer),
- sa.Column('accountcode', sa.String(20)),
- sa.Column('mohinterpret', sa.String(20)),
- sa.Column('mohsuggest', sa.String(20)),
- sa.Column('inkeys', sa.String(40)),
- sa.Column('outkeys', sa.String(40)),
- sa.Column('language', sa.String(10)),
- sa.Column('callerid', sa.String(100)),
- sa.Column('cid_number', sa.String(40)),
- sa.Column('sendani', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
- sa.Column('fullname', sa.String(40)),
- sa.Column('trunk', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
- sa.Column('auth', sa.String(20)),
- sa.Column('maxauthreq', sa.Integer),
- sa.Column('requirecalltoken', sa.Enum(*IAX_REQUIRECALLTOKEN_VALUES,
- name='iax_requirecalltoken_values')),
- sa.Column('encryption', sa.Enum(*IAX_ENCRYPTION_VALUES,
- name='iax_encryption_values')),
- sa.Column('transfer', sa.Enum(*IAX_TRANSFER_VALUES,
- name='iax_transfer_values')),
- sa.Column('jitterbuffer', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('forcejitterbuffer', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('disallow', sa.String(200)),
- sa.Column('allow', sa.String(200)),
- sa.Column('codecpriority', sa.String(40)),
- sa.Column('qualify', sa.String(10)),
- sa.Column('qualifysmoothing',
- sa.Enum(*YESNO_VALUES, name='yes_no_values')),
- sa.Column('qualifyfreqok', sa.String(10)),
- sa.Column('qualifyfreqnotok', sa.String(10)),
- sa.Column('timezone', sa.String(20)),
- sa.Column('adsi', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
- sa.Column('amaflags', sa.String(20)),
- sa.Column('setvar', sa.String(200))
- )
- op.create_index('iaxfriends_name', 'iaxfriends', ['name'])
- op.create_index('iaxfriends_name_host', 'iaxfriends', ['name', 'host'])
- op.create_index('iaxfriends_name_ipaddr_port', 'iaxfriends',
- ['name', 'ipaddr', 'port'])
- op.create_index('iaxfriends_ipaddr_port', 'iaxfriends', ['ipaddr', 'port'])
- op.create_index('iaxfriends_host_port', 'iaxfriends', ['host', 'port'])
+ if currentcontext.bind.dialect.name != 'oracle':
+ op.create_table(
+ 'sippeers',
+ sa.Column('id', sa.Integer, primary_key=True, nullable=False,
+ autoincrement=True),
+ sa.Column('name', sa.String(40), nullable=False, unique=True),
+ sa.Column('ipaddr', sa.String(45)),
+ sa.Column('port', sa.Integer),
+ sa.Column('regseconds', sa.Integer),
+ sa.Column('defaultuser', sa.String(40)),
+ sa.Column('fullcontact', sa.String(80)),
+ sa.Column('regserver', sa.String(20)),
+ sa.Column('useragent', sa.String(20)),
+ sa.Column('lastms', sa.Integer),
+ sa.Column('host', sa.String(40)),
+ sa.Column('type', sa.Enum(*TYPE_VALUES, name='type_values')),
+ sa.Column('context', sa.String(40)),
+ sa.Column('permit', sa.String(95)),
+ sa.Column('deny', sa.String(95)),
+ sa.Column('secret', sa.String(40)),
+ sa.Column('md5secret', sa.String(40)),
+ sa.Column('remotesecret', sa.String(40)),
+ sa.Column('transport', sa.Enum(*SIP_TRANSPORT_VALUES,
+ name='sip_transport_values')),
+ sa.Column('dtmfmode', sa.Enum(*SIP_DTMFMODE_VALUES,
+ name='sip_dtmfmode_values')),
+ sa.Column('directmedia', sa.Enum(*SIP_DIRECTMEDIA_VALUES,
+ name='sip_directmedia_values')),
+ sa.Column('nat', sa.String(29)),
+ sa.Column('callgroup', sa.String(40)),
+ sa.Column('pickupgroup', sa.String(40)),
+ sa.Column('language', sa.String(40)),
+ sa.Column('disallow', sa.String(200)),
+ sa.Column('allow', sa.String(200)),
+ sa.Column('insecure', sa.String(40)),
+ sa.Column('trustrpid', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('progressinband', sa.Enum(*SIP_PROGRESSINBAND_VALUES,
+ name='sip_progressinband_values')),
+ sa.Column('promiscredir', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('useclientcode', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('accountcode', sa.String(40)),
+ sa.Column('setvar', sa.String(200)),
+ sa.Column('callerid', sa.String(40)),
+ sa.Column('amaflags', sa.String(40)),
+ sa.Column('callcounter', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('busylevel', sa.Integer),
+ sa.Column('allowoverlap', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('allowsubscribe', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('videosupport', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('maxcallbitrate', sa.Integer),
+ sa.Column('rfc2833compensate', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('mailbox', sa.String(40)),
+ sa.Column('session-timers', sa.Enum(*SIP_SESSION_TIMERS_VALUES,
+ name='sip_session_timers_values')),
+ sa.Column('session-expires', sa.Integer),
+ sa.Column('session-minse', sa.Integer),
+ sa.Column('session-refresher', sa.Enum(*SIP_SESSION_REFRESHER_VALUES,
+ name='sip_session_refresher_values')),
+ sa.Column('t38pt_usertpsource', sa.String(40)),
+ sa.Column('regexten', sa.String(40)),
+ sa.Column('fromdomain', sa.String(40)),
+ sa.Column('fromuser', sa.String(40)),
+ sa.Column('qualify', sa.String(40)),
+ sa.Column('defaultip', sa.String(45)),
+ sa.Column('rtptimeout', sa.Integer),
+ sa.Column('rtpholdtimeout', sa.Integer),
+ sa.Column('sendrpid', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('outboundproxy', sa.String(40)),
+ sa.Column('callbackextension', sa.String(40)),
+ sa.Column('timert1', sa.Integer),
+ sa.Column('timerb', sa.Integer),
+ sa.Column('qualifyfreq', sa.Integer),
+ sa.Column('constantssrc', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('contactpermit', sa.String(95)),
+ sa.Column('contactdeny', sa.String(95)),
+ sa.Column('usereqphone', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+ sa.Column('textsupport', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+ sa.Column('faxdetect', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+ sa.Column('buggymwi', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+ sa.Column('auth', sa.String(40)),
+ sa.Column('fullname', sa.String(40)),
+ sa.Column('trunkname', sa.String(40)),
+ sa.Column('cid_number', sa.String(40)),
+ sa.Column('callingpres', sa.Enum(*SIP_CALLINGPRES_VALUES,
+ name='sip_callingpres_values')),
+ sa.Column('mohinterpret', sa.String(40)),
+ sa.Column('mohsuggest', sa.String(40)),
+ sa.Column('parkinglot', sa.String(40)),
+ sa.Column('hasvoicemail', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('subscribemwi', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('vmexten', sa.String(40)),
+ sa.Column('autoframing', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+ sa.Column('rtpkeepalive', sa.Integer),
+ sa.Column('call-limit', sa.Integer),
+ sa.Column('g726nonstandard', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('ignoresdpversion', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('allowtransfer', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('dynamic', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+ sa.Column('path', sa.String(256)),
+ sa.Column('supportpath', sa.Enum(*YESNO_VALUES, name='yes_no_values'))
+ )
+ op.create_index('sippeers_name', 'sippeers', ['name'])
+ op.create_index('sippeers_name_host', 'sippeers', ['name', 'host'])
+ op.create_index('sippeers_ipaddr_port', 'sippeers', ['ipaddr', 'port'])
+ op.create_index('sippeers_host_port', 'sippeers', ['host', 'port'])
- op.create_table(
- 'voicemail',
- sa.Column('uniqueid', sa.Integer, primary_key=True, nullable=False,
- autoincrement=True),
- sa.Column('context', sa.String(80), nullable=False),
- sa.Column('mailbox', sa.String(80), nullable=False),
- sa.Column('password', sa.String(80), nullable=False),
- sa.Column('fullname', sa.String(80)),
- sa.Column('alias', sa.String(80)),
- sa.Column('email', sa.String(80)),
- sa.Column('pager', sa.String(80)),
- sa.Column('attach', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
- sa.Column('attachfmt', sa.String(10)),
- sa.Column('serveremail', sa.String(80)),
- sa.Column('language', sa.String(20)),
- sa.Column('tz', sa.String(30)),
- sa.Column('deletevoicemail', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('saycid', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('sendvoicemail', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('review', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('tempgreetwarn', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('operator', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('envelope', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('sayduration', sa.Integer),
- sa.Column('forcename', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('forcegreetings', sa.Enum(*YESNO_VALUES,
- name='yes_no_values')),
- sa.Column('callback', sa.String(80)),
- sa.Column('dialout', sa.String(80)),
- sa.Column('exitcontext', sa.String(80)),
- sa.Column('maxmsg', sa.Integer),
- sa.Column('volgain', sa.Numeric(precision=5, scale=2)),
- sa.Column('imapuser', sa.String(80)),
- sa.Column('imappassword', sa.String(80)),
- sa.Column('imapserver', sa.String(80)),
- sa.Column('imapport', sa.String(8)),
- sa.Column('imapflags', sa.String(80)),
- sa.Column('stamp', sa.DateTime())
- )
- op.create_index('voicemail_mailbox', 'voicemail', ['mailbox'])
- op.create_index('voicemail_context', 'voicemail', ['context'])
- op.create_index('voicemail_mailbox_context', 'voicemail',
- ['mailbox', 'context'])
- op.create_index('voicemail_imapuser', 'voicemail', ['imapuser'])
+ op.create_table(
+ 'iaxfriends',
+ sa.Column('id', sa.Integer, primary_key=True, nullable=False,
+ autoincrement=True),
+ sa.Column('name', sa.String(40), nullable=False, unique=True),
+ sa.Column('type', sa.Enum(*TYPE_VALUES, name='type_values')),
+ sa.Column('username', sa.String(40)),
+ sa.Column('mailbox', sa.String(40)),
+ sa.Column('secret', sa.String(40)),
+ sa.Column('dbsecret', sa.String(40)),
+ sa.Column('context', sa.String(40)),
+ sa.Column('regcontext', sa.String(40)),
+ sa.Column('host', sa.String(40)),
+ sa.Column('ipaddr', sa.String(40)),
+ sa.Column('port', sa.Integer),
+ sa.Column('defaultip', sa.String(20)),
+ sa.Column('sourceaddress', sa.String(20)),
+ sa.Column('mask', sa.String(20)),
+ sa.Column('regexten', sa.String(40)),
+ sa.Column('regseconds', sa.Integer),
+ sa.Column('accountcode', sa.String(20)),
+ sa.Column('mohinterpret', sa.String(20)),
+ sa.Column('mohsuggest', sa.String(20)),
+ sa.Column('inkeys', sa.String(40)),
+ sa.Column('outkeys', sa.String(40)),
+ sa.Column('language', sa.String(10)),
+ sa.Column('callerid', sa.String(100)),
+ sa.Column('cid_number', sa.String(40)),
+ sa.Column('sendani', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+ sa.Column('fullname', sa.String(40)),
+ sa.Column('trunk', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+ sa.Column('auth', sa.String(20)),
+ sa.Column('maxauthreq', sa.Integer),
+ sa.Column('requirecalltoken', sa.Enum(*IAX_REQUIRECALLTOKEN_VALUES,
+ name='iax_requirecalltoken_values')),
+ sa.Column('encryption', sa.Enum(*IAX_ENCRYPTION_VALUES,
+ name='iax_encryption_values')),
+ sa.Column('transfer', sa.Enum(*IAX_TRANSFER_VALUES,
+ name='iax_transfer_values')),
+ sa.Column('jitterbuffer', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('forcejitterbuffer', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('disallow', sa.String(200)),
+ sa.Column('allow', sa.String(200)),
+ sa.Column('codecpriority', sa.String(40)),
+ sa.Column('qualify', sa.String(10)),
+ sa.Column('qualifysmoothing',
+ sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+ sa.Column('qualifyfreqok', sa.String(10)),
+ sa.Column('qualifyfreqnotok', sa.String(10)),
+ sa.Column('timezone', sa.String(20)),
+ sa.Column('adsi', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+ sa.Column('amaflags', sa.String(20)),
+ sa.Column('setvar', sa.String(200))
+ )
+ op.create_index('iaxfriends_name', 'iaxfriends', ['name'])
+ op.create_index('iaxfriends_name_host', 'iaxfriends', ['name', 'host'])
+ op.create_index('iaxfriends_name_ipaddr_port', 'iaxfriends',
+ ['name', 'ipaddr', 'port'])
+ op.create_index('iaxfriends_ipaddr_port', 'iaxfriends', ['ipaddr', 'port'])
+ op.create_index('iaxfriends_host_port', 'iaxfriends', ['host', 'port'])
- op.create_table(
- 'meetme',
- sa.Column('bookid', sa.Integer, primary_key=True, nullable=False,
- autoincrement=True),
- sa.Column('confno', sa.String(80), nullable=False),
- sa.Column('starttime', sa.DateTime()),
- sa.Column('endtime', sa.DateTime()),
- sa.Column('pin', sa.String(20)),
- sa.Column('adminpin', sa.String(20)),
- sa.Column('opts', sa.String(20)),
- sa.Column('adminopts', sa.String(20)),
- sa.Column('recordingfilename', sa.String(80)),
- sa.Column('recordingformat', sa.String(10)),
- sa.Column('maxusers', sa.Integer),
- sa.Column('members', sa.Integer, nullable=False, default=0)
- )
- op.create_index('meetme_confno_start_end', 'meetme',
- ['confno', 'starttime', 'endtime'])
+ op.create_table(
+ 'voicemail',
+ sa.Column('uniqueid', sa.Integer, primary_key=True, nullable=False,
+ autoincrement=True),
+ sa.Column('context', sa.String(80), nullable=False),
+ sa.Column('mailbox', sa.String(80), nullable=False),
+ sa.Column('password', sa.String(80), nullable=False),
+ sa.Column('fullname', sa.String(80)),
+ sa.Column('alias', sa.String(80)),
+ sa.Column('email', sa.String(80)),
+ sa.Column('pager', sa.String(80)),
+ sa.Column('attach', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
+ sa.Column('attachfmt', sa.String(10)),
+ sa.Column('serveremail', sa.String(80)),
+ sa.Column('language', sa.String(20)),
+ sa.Column('tz', sa.String(30)),
+ sa.Column('deletevoicemail', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('saycid', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('sendvoicemail', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('review', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('tempgreetwarn', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('operator', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('envelope', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('sayduration', sa.Integer),
+ sa.Column('forcename', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('forcegreetings', sa.Enum(*YESNO_VALUES,
+ name='yes_no_values')),
+ sa.Column('callback', sa.String(80)),
+ sa.Column('dialout', sa.String(80)),
+ sa.Column('exitcontext', sa.String(80)),
+ sa.Column('maxmsg', sa.Integer),
+ sa.Column('volgain', sa.Numeric(precision=5, scale=2)),
+ sa.Column('imapuser', sa.String(80)),
+ sa.Column('imappassword', sa.String(80)),
+ sa.Column('imapserver', sa.String(80)),
+ sa.Column('imapport', sa.String(8)),
+ sa.Column('imapflags', sa.String(80)),
+ sa.Column('stamp', sa.DateTime())
+ )
+ op.create_index('voicemail_mailbox', 'voicemail', ['mailbox'])
+ op.create_index('voicemail_context', 'voicemail', ['context'])
+ op.create_index('voicemail_mailbox_context', 'voicemail',
+ ['mailbox', 'context'])
+ op.create_index('voicemail_imapuser', 'voicemail', ['imapuser'])
- op.create_table(
- 'musiconhold',
- sa.Column('name', sa.String(80), primary_key=True, nullable=False),
- sa.Column('mode', sa.Enum(*MOH_MODE_VALUES, name='moh_mode_values')),
- sa.Column('directory', sa.String(255)),
- sa.Column('application', sa.String(255)),
- sa.Column('digit', sa.String(1)),
- sa.Column('sort', sa.String(10)),
- sa.Column('format', sa.String(10)),
- sa.Column('stamp', sa.DateTime())
- )
+ op.create_table(
+ 'meetme',
+ sa.Column('bookid', sa.Integer, primary_key=True, nullable=False,
+ autoincrement=True),
+ sa.Column('confno', sa.String(80), nullable=False),
+ sa.Column('starttime', sa.DateTime()),
+ sa.Column('endtime', sa.DateTime()),
+ sa.Column('pin', sa.String(20)),
+ sa.Column('adminpin', sa.String(20)),
+ sa.Column('opts', sa.String(20)),
+ sa.Column('adminopts', sa.String(20)),
+ sa.Column('recordingfilename', sa.String(80)),
+ sa.Column('recordingformat', sa.String(10)),
+ sa.Column('maxusers', sa.Integer),
+ sa.Column('members', sa.Integer, nullable=False, default=0)
+ )
+ op.create_index('meetme_confno_start_end', 'meetme',
+ ['confno', 'starttime', 'endtime'])
+ op.create_table(
+ 'musiconhold',
+ sa.Column('name', sa.String(80), primary_key=True, nullable=False),
+ sa.Column('mode', sa.Enum(*MOH_MODE_VALUES, name='moh_mode_values')),
+ sa.Column('directory', sa.String(255)),
+ sa.Column('application', sa.String(255)),
+ sa.Column('digit', sa.String(1)),
+ sa.Column('sort', sa.String(10)),
+ sa.Column('format', sa.String(10)),
+ sa.Column('stamp', sa.DateTime())
+ )
+
+ if currentcontext.bind.dialect.name == 'oracle':
+ op.create_table(
+ 'sippeers',
+ sa.Column('id', sa.Integer, nullable=False,
+ autoincrement=True),
+ sa.Column('name', sa.String(40), nullable=False),
+ sa.Column('ipaddr', sa.String(45)),
+ sa.Column('port', sa.Integer),
+ sa.Column('regseconds', sa.Integer),
+ sa.Column('defaultuser', sa.String(40)),
+ sa.Column('fullcontact', sa.String(80)),
+ sa.Column('regserver', sa.String(20)),
+ sa.Column('useragent', sa.String(20)),
+ sa.Column('lastms', sa.Integer),
+ sa.Column('host', sa.String(40)),
+ sa.Column('type', sa.Enum(*TYPE_VALUES, name='sptype')),
+ sa.Column('context', sa.String(40)),
+ sa.Column('permit', sa.String(95)),
+ sa.Column('deny', sa.String(95)),
+ sa.Column('secret', sa.String(40)),
+ sa.Column('md5secret', sa.String(40)),
+ sa.Column('remotesecret', sa.String(40)),
+ sa.Column('transport', sa.Enum(*SIP_TRANSPORT_VALUES,name='sptransport')),
+ sa.Column('dtmfmode', sa.Enum(*SIP_DTMFMODE_VALUES,name='spdtmfmode')),
+ sa.Column('directmedia', sa.Enum(*SIP_DIRECTMEDIA_VALUES,name='spdirectmedia')),
+ sa.Column('nat', sa.String(29)),
+ sa.Column('callgroup', sa.String(40)),
+ sa.Column('pickupgroup', sa.String(40)),
+ sa.Column('language', sa.String(40)),
+ sa.Column('disallow', sa.String(200)),
+ sa.Column('allow', sa.String(200)),
+ sa.Column('insecure', sa.String(40)),
+ sa.Column('trustrpid', sa.Enum(*YESNO_VALUES,name='spYnNtrustrpid')),
+ sa.Column('progressinband', sa.Enum(*SIP_PROGRESSINBAND_VALUES,name='sp_progressinband')),
+ sa.Column('promiscredir', sa.Enum(*YESNO_VALUES,name='sp_YnNpromiscredir')),
+ sa.Column('useclientcode', sa.Enum(*YESNO_VALUES,name='sp_YnNuseclientcode')),
+ sa.Column('accountcode', sa.String(40)),
+ sa.Column('setvar', sa.String(200)),
+ sa.Column('callerid', sa.String(40)),
+ sa.Column('amaflags', sa.String(40)),
+ sa.Column('callcounter', sa.Enum(*YESNO_VALUES,name='sp_YnNcallcounter')),
+ sa.Column('busylevel', sa.Integer),
+ sa.Column('allowoverlap', sa.Enum(*YESNO_VALUES,name='sp_YnNallowoverlap')),
+ sa.Column('allowsubscribe', sa.Enum(*YESNO_VALUES,name='sp_YnNallowsubscribe')),
+ sa.Column('videosupport', sa.Enum(*YESNO_VALUES,name='sp_YnNvideosupport')),
+ sa.Column('maxcallbitrate', sa.Integer),
+ sa.Column('rfc2833compensate', sa.Enum(*YESNO_VALUES,name='sp_YnNrfc2833compensate')),
+ sa.Column('mailbox', sa.String(40)),
+ sa.Column('session-timers', sa.Enum(*SIP_SESSION_TIMERS_VALUES,name='sp_sessiontimers')),
+ sa.Column('session-expires', sa.Integer),
+ sa.Column('session-minse', sa.Integer),
+ sa.Column('session-refresher', sa.Enum(*SIP_SESSION_REFRESHER_VALUES,name='sp_sessionrefresher')),
+ sa.Column('t38pt_usertpsource', sa.String(40)),
+ sa.Column('regexten', sa.String(40)),
+ sa.Column('fromdomain', sa.String(40)),
+ sa.Column('fromuser', sa.String(40)),
+ sa.Column('qualify', sa.String(40)),
+ sa.Column('defaultip', sa.String(45)),
+ sa.Column('rtptimeout', sa.Integer),
+ sa.Column('rtpholdtimeout', sa.Integer),
+ sa.Column('sendrpid', sa.Enum(*YESNO_VALUES, name='spYnNsendrpid')),
+ sa.Column('outboundproxy', sa.String(40)),
+ sa.Column('callbackextension', sa.String(40)),
+ sa.Column('timert1', sa.Integer),
+ sa.Column('timerb', sa.Integer),
+ sa.Column('qualifyfreq', sa.Integer),
+ sa.Column('constantssrc', sa.Enum(*YESNO_VALUES,name='spYnNconstantssrc')),
+ sa.Column('contactpermit', sa.String(95)),
+ sa.Column('contactdeny', sa.String(95)),
+ sa.Column('usereqphone', sa.Enum(*YESNO_VALUES, name='spYnNusereqphone')),
+ sa.Column('textsupport', sa.Enum(*YESNO_VALUES, name='spYnNtextsupport')),
+ sa.Column('faxdetect', sa.Enum(*YESNO_VALUES, name='spYnNfaxdetect')),
+ sa.Column('buggymwi', sa.Enum(*YESNO_VALUES, name='spYnNbuggymwi')),
+ sa.Column('auth', sa.String(40)),
+ sa.Column('fullname', sa.String(40)),
+ sa.Column('trunkname', sa.String(40)),
+ sa.Column('cid_number', sa.String(40)),
+ sa.Column('callingpres', sa.Enum(*SIP_CALLINGPRES_VALUES,name='spcallingpres')),
+ sa.Column('mohinterpret', sa.String(40)),
+ sa.Column('mohsuggest', sa.String(40)),
+ sa.Column('parkinglot', sa.String(40)),
+ sa.Column('hasvoicemail', sa.Enum(*YESNO_VALUES,name='spYnNhasvoicemail')),
+ sa.Column('subscribemwi', sa.Enum(*YESNO_VALUES,name='spYnNsubscribemwi')),
+ sa.Column('vmexten', sa.String(40)),
+ sa.Column('autoframing', sa.Enum(*YESNO_VALUES, name='spYnNautoframing')),
+ sa.Column('rtpkeepalive', sa.Integer),
+ sa.Column('call-limit', sa.Integer),
+ sa.Column('g726nonstandard', sa.Enum(*YESNO_VALUES,name='spYnNg726nonstandard')),
+ sa.Column('ignoresdpversion', sa.Enum(*YESNO_VALUES,name='spYnNignoresdpversion')),
+ sa.Column('allowtransfer', sa.Enum(*YESNO_VALUES,name='spYnNallowtransfer')),
+ sa.Column('dynamic', sa.Enum(*YESNO_VALUES, name='spYnNdynamic')),
+ sa.Column('path', sa.String(256)),
+ sa.Column('supportpath', sa.Enum(*YESNO_VALUES, name='spYnNsupportpath'))
+ )
+ op.create_primary_key('pksp_id', 'sippeers', ['id'])
+ op.create_index('idxsp_name', 'sippeers', ['name'], unique=True)
+ op.create_index('idxsp_name_host', 'sippeers', ['name', 'host'])
+ op.create_index('idxsp_ipaddr_port', 'sippeers', ['ipaddr', 'port'])
+ op.create_index('idxsp_host_port', 'sippeers', ['host', 'port'])
+ op.create_table(
+ 'iaxfriends',
+ sa.Column('id', sa.Integer, nullable=False,
+ autoincrement=True),
+ sa.Column('name', sa.String(40), nullable=False),
+ sa.Column('type', sa.Enum(*TYPE_VALUES, name='iaxfrtype')),
+ sa.Column('username', sa.String(40)),
+ sa.Column('mailbox', sa.String(40)),
+ sa.Column('secret', sa.String(40)),
+ sa.Column('dbsecret', sa.String(40)),
+ sa.Column('context', sa.String(40)),
+ sa.Column('regcontext', sa.String(40)),
+ sa.Column('host', sa.String(40)),
+ sa.Column('ipaddr', sa.String(40)),
+ sa.Column('port', sa.Integer),
+ sa.Column('defaultip', sa.String(20)),
+ sa.Column('sourceaddress', sa.String(20)),
+ sa.Column('mask', sa.String(20)),
+ sa.Column('regexten', sa.String(40)),
+ sa.Column('regseconds', sa.Integer),
+ sa.Column('accountcode', sa.String(20)),
+ sa.Column('mohinterpret', sa.String(20)),
+ sa.Column('mohsuggest', sa.String(20)),
+ sa.Column('inkeys', sa.String(40)),
+ sa.Column('outkeys', sa.String(40)),
+ sa.Column('language', sa.String(10)),
+ sa.Column('callerid', sa.String(100)),
+ sa.Column('cid_number', sa.String(40)),
+ sa.Column('sendani', sa.Enum(*YESNO_VALUES, name='iaxfrYnNsendani')),
+ sa.Column('fullname', sa.String(40)),
+ sa.Column('trunk', sa.Enum(*YESNO_VALUES, name='iaxfrYnNtrunk')),
+ sa.Column('auth', sa.String(20)),
+ sa.Column('maxauthreq', sa.Integer),
+ sa.Column('requirecalltoken', sa.Enum(*IAX_REQUIRECALLTOKEN_VALUES,name='iaxfrrequirecalltoken')),
+ sa.Column('encryption', sa.Enum(*IAX_ENCRYPTION_VALUES,name='iaxfrencryption')),
+ sa.Column('transfer', sa.Enum(*IAX_TRANSFER_VALUES,name='iaxfrtransfer')),
+ sa.Column('jitterbuffer', sa.Enum(*YESNO_VALUES,name='iaxfrYnNjitterbuffer')),
+ sa.Column('forcejitterbuffer', sa.Enum(*YESNO_VALUES,name='iaxfrYnNforcejitterbuffer')),
+ sa.Column('disallow', sa.String(200)),
+ sa.Column('allow', sa.String(200)),
+ sa.Column('codecpriority', sa.String(40)),
+ sa.Column('qualify', sa.String(10)),
+ sa.Column('qualifysmoothing',sa.Enum(*YESNO_VALUES, name='iaxfrYnNqualifysmoothing')),
+ sa.Column('qualifyfreqok', sa.String(10)),
+ sa.Column('qualifyfreqnotok', sa.String(10)),
+ sa.Column('timezone', sa.String(20)),
+ sa.Column('adsi', sa.Enum(*YESNO_VALUES, name='iaxfrYnNadsi')),
+ sa.Column('amaflags', sa.String(20)),
+ sa.Column('setvar', sa.String(200))
+ )
+ op.create_primary_key('pkiaxfr_id', 'iaxfriends', ['id'])
+ op.create_index('iaxfriends_name', 'iaxfriends', ['name'], unique=True)
+ op.create_index('iaxfriends_name_host', 'iaxfriends', ['name', 'host'])
+ op.create_index('iaxfriends_name_ipaddr_port', 'iaxfriends',
+ ['name', 'ipaddr', 'port'])
+ op.create_index('iaxfriends_ipaddr_port', 'iaxfriends', ['ipaddr', 'port'])
+ op.create_index('iaxfriends_host_port', 'iaxfriends', ['host', 'port'])
+
+ op.create_table(
+ 'voicemail',
+ sa.Column('uniqueid', sa.Integer, nullable=False,
+ autoincrement=True),
+ sa.Column('context', sa.String(80), nullable=False),
+ sa.Column('mailbox', sa.String(80), nullable=False),
+ sa.Column('password', sa.String(80), nullable=False),
+ sa.Column('fullname', sa.String(80)),
+ sa.Column('alias', sa.String(80)),
+ sa.Column('email', sa.String(80)),
+ sa.Column('pager', sa.String(80)),
+ sa.Column('attach', sa.Enum(*YESNO_VALUES, name='vmYnNattach')),
+ sa.Column('attachfmt', sa.String(10)),
+ sa.Column('serveremail', sa.String(80)),
+ sa.Column('language', sa.String(20)),
+ sa.Column('tz', sa.String(30)),
+ sa.Column('deletevoicemail', sa.Enum(*YESNO_VALUES,name='vmYnNdeletevoicemail')),
+ sa.Column('saycid', sa.Enum(*YESNO_VALUES,name='vmYnNsaycid')),
+ sa.Column('sendvoicemail', sa.Enum(*YESNO_VALUES,name='vmYnNsendvoicemail')),
+ sa.Column('review', sa.Enum(*YESNO_VALUES,name='vmYnNreview')),
+ sa.Column('tempgreetwarn', sa.Enum(*YESNO_VALUES,name='vmYnNtempgreetwarn')),
+ sa.Column('operator', sa.Enum(*YESNO_VALUES,name='vmYnNoperator')),
+ sa.Column('envelope', sa.Enum(*YESNO_VALUES,name='vmYnNenvelope')),
+ sa.Column('sayduration', sa.Integer),
+ sa.Column('forcename', sa.Enum(*YESNO_VALUES,name='vmYnNforcename')),
+ sa.Column('forcegreetings', sa.Enum(*YESNO_VALUES,name='vmYnNforcegreetings')),
+ sa.Column('callback', sa.String(80)),
+ sa.Column('dialout', sa.String(80)),
+ sa.Column('exitcontext', sa.String(80)),
+ sa.Column('maxmsg', sa.Integer),
+ sa.Column('volgain', sa.Numeric(precision=5, scale=2)),
+ sa.Column('imapuser', sa.String(80)),
+ sa.Column('imappassword', sa.String(80)),
+ sa.Column('imapserver', sa.String(80)),
+ sa.Column('imapport', sa.String(8)),
+ sa.Column('imapflags', sa.String(80)),
+ sa.Column('stamp', sa.DateTime())
+ )
+ op.create_primary_key('pkvm_uniqueid', 'voicemail', ['uniqueid'])
+ op.create_index('voicemail_mailbox', 'voicemail', ['mailbox'])
+ op.create_index('voicemail_context', 'voicemail', ['context'])
+ op.create_index('voicemail_mailbox_context', 'voicemail',
+ ['mailbox', 'context'])
+ op.create_index('voicemail_imapuser', 'voicemail', ['imapuser'])
+
+ op.create_table(
+ 'meetme',
+ sa.Column('bookid', sa.Integer, nullable=False,
+ autoincrement=True),
+ sa.Column('confno', sa.String(80), nullable=False),
+ sa.Column('starttime', sa.DateTime()),
+ sa.Column('endtime', sa.DateTime()),
+ sa.Column('pin', sa.String(20)),
+ sa.Column('adminpin', sa.String(20)),
+ sa.Column('opts', sa.String(20)),
+ sa.Column('adminopts', sa.String(20)),
+ sa.Column('recordingfilename', sa.String(80)),
+ sa.Column('recordingformat', sa.String(10)),
+ sa.Column('maxusers', sa.Integer),
+ sa.Column('members', sa.Integer, nullable=False, default=0)
+ )
+ op.create_primary_key('pkmeetme_bookid', 'meetme', ['bookid'])
+ op.create_index('meetme_confno_start_end', 'meetme',
+ ['confno', 'starttime', 'endtime'])
+
+ op.create_table(
+ 'musiconhold',
+ sa.Column('name', sa.String(80), nullable=False),
+ sa.Column('mode', sa.Enum(*MOH_MODE_VALUES, name='mohmode')),
+ sa.Column('directory', sa.String(255)),
+ sa.Column('application', sa.String(255)),
+ sa.Column('digit', sa.String(1)),
+ sa.Column('sort', sa.String(10)),
+ sa.Column('format', sa.String(10)),
+ sa.Column('stamp', sa.DateTime())
+ )
+ op.create_primary_key('pkmoh_name', 'musiconhold', ['name'])
+
def downgrade():
- op.drop_table('sippeers')
- op.drop_table('iaxfriends')
- op.drop_table('voicemail')
- op.drop_table('meetme')
- op.drop_table('musiconhold')
+ op.drop_table('sippeers')
+ op.drop_table('iaxfriends')
+ op.drop_table('voicemail')
+ op.drop_table('meetme')
+ op.drop_table('musiconhold')
diff --git a/contrib/ast-db-manage/config/versions/5139253c0423_make_q_member_uniqueid_autoinc.py b/contrib/ast-db-manage/config/versions/5139253c0423_make_q_member_uniqueid_autoinc.py
index 6bcaa9a..1a503f6 100755
--- a/contrib/ast-db-manage/config/versions/5139253c0423_make_q_member_uniqueid_autoinc.py
+++ b/contrib/ast-db-manage/config/versions/5139253c0423_make_q_member_uniqueid_autoinc.py
@@ -33,28 +33,39 @@
def upgrade():
- # Was unable to find a way to use op.alter_column() to add the unique
- # index property.
- op.drop_column('queue_members', 'uniqueid')
- op.add_column(
- 'queue_members',
- sa.Column(
- name='uniqueid', type_=sa.Integer, nullable=False,
- unique=True))
- # The postgres backend does not like the autoincrement needed for
- # mysql here. It is just the backend that is giving a warning and
- # not the database itself.
- op.alter_column(
- table_name='queue_members', column_name='uniqueid',
- existing_type=sa.Integer, existing_nullable=False,
- autoincrement=True)
-
+
+ currentcontext = op.get_context()
+ if currentcontext.bind.dialect.name != 'oracle':
+ # Was unable to find a way to use op.alter_column() to add the unique
+ # It is easy Richard. Yon need just to create unique index for column . But you did everything
+ # right because it is possible that this column already have non unique
+ # record so dropping ensure us that new index will be unique.
+ op.drop_column('queue_members', 'uniqueid')
+ op.add_column(
+ 'queue_members',
+ sa.Column(
+ name='uniqueid', type_=sa.Integer, nullable=False,
+ unique=True))
+ # The postgres backend does not like the autoincrement needed for
+ # mysql here. It is just the backend that is giving a warning and
+ # not the database itself.
+ op.alter_column(
+ table_name='queue_members', column_name='uniqueid',
+ existing_type=sa.Integer, existing_nullable=False,
+ autoincrement=True)
+ if currentcontext.bind.dialect.name == 'oracle':
+ op.drop_column('queue_members', 'uniqueid')
+ op.add_column(
+ 'queue_members',
+ sa.Column(name='uniqueid', type_=sa.Integer, nullable=False))
+ op.create_index('idxquem_uniqueid', 'queue_members', ['uniqueid'], unique=True)
+
def downgrade():
- # Was unable to find a way to use op.alter_column() to remove the
- # unique index property.
- op.drop_column('queue_members', 'uniqueid')
- op.add_column(
- 'queue_members',
- sa.Column(name='uniqueid', type_=sa.String(80), nullable=False))
+ # Was unable to find a way to use op.alter_column() to remove the
+ # unique index property.
+ op.drop_column('queue_members', 'uniqueid')
+ op.add_column(
+ 'queue_members',
+ sa.Column(name='uniqueid', type_=sa.String(80), nullable=False))
diff --git a/contrib/ast-db-manage/config/versions/51f8cb66540e_add_further_dtls_options.py b/contrib/ast-db-manage/config/versions/51f8cb66540e_add_further_dtls_options.py
index c2dacda..96b86a2 100644
--- a/contrib/ast-db-manage/config/versions/51f8cb66540e_add_further_dtls_options.py
+++ b/contrib/ast-db-manage/config/versions/51f8cb66540e_add_further_dtls_options.py
@@ -18,15 +18,19 @@
YESNO_VALUES = ['yes', 'no']
def upgrade():
- ############################# Enums ##############################
+ ############################# 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_endpoints', sa.Column('force_avp', yesno_values))
- op.add_column('ps_endpoints', sa.Column('media_use_received_transport', yesno_values))
+ # 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)
+ currentcontext = op.get_context()
+ if currentcontext.bind.dialect.name != 'oracle':
+ op.add_column('ps_endpoints', sa.Column('force_avp', yesno_values))
+ op.add_column('ps_endpoints', sa.Column('media_use_received_transport', yesno_values))
+ if currentcontext.bind.dialect.name == 'oracle':
+ op.add_column('ps_endpoints', sa.Column('force_avp', sa.Enum(*YESNO_VALUES, name='psepYnNforceavp')))
+ op.add_column('ps_endpoints', sa.Column('media_use_received_transport',sa.Enum(*YESNO_VALUES, name='psepYnNmediausereceivedtrans')))
def downgrade():
- op.drop_column('ps_endpoints', 'force_avp')
- op.drop_column('ps_endpoints', 'media_use_received_transport')
+ op.drop_column('ps_endpoints', 'force_avp')
+ op.drop_column('ps_endpoints', 'media_use_received_transport')
diff --git a/contrib/ast-db-manage/config/versions/581a4264e537_adding_extensions.py b/contrib/ast-db-manage/config/versions/581a4264e537_adding_extensions.py
index ecee0e0..83c2203 100755
--- a/contrib/ast-db-manage/config/versions/581a4264e537_adding_extensions.py
+++ b/contrib/ast-db-manage/config/versions/581a4264e537_adding_extensions.py
@@ -33,18 +33,34 @@
def upgrade():
- op.create_table(
- 'extensions',
- sa.Column('id', sa.BigInteger, primary_key=True, nullable=False,
- unique=True, autoincrement=True),
- sa.Column('context', sa.String(40), primary_key=True, nullable=False),
- sa.Column('exten', sa.String(40), primary_key=True, nullable=False),
- sa.Column('priority', sa.Integer, primary_key=True, nullable=False,
- autoincrement=True),
- sa.Column('app', sa.String(40), nullable=False),
- sa.Column('appdata', sa.String(256), nullable=False),
- )
-
+ currentcontext = op.get_context()
+ if currentcontext.bind.dialect.name != 'oracle':
+ op.create_table(
+ 'extensions',
+ sa.Column('id', sa.BigInteger, primary_key=True, nullable=False,
+ unique=True, autoincrement=True),
+ sa.Column('context', sa.String(40), primary_key=True, nullable=False),
+ sa.Column('exten', sa.String(40), primary_key=True, nullable=False),
+ sa.Column('priority', sa.Integer, primary_key=True, nullable=False,
+ autoincrement=True),
+ sa.Column('app', sa.String(40), nullable=False),
+ sa.Column('appdata', sa.String(256), nullable=False),
+ )
+ if currentcontext.bind.dialect.name == 'oracle':
+ # oracle can have only one primary key . Using unique index instead due to same functionality
+ op.create_table(
+ 'extensions',
+ sa.Column('id', sa.BigInteger, nullable=False,autoincrement=True),
+ sa.Column('context', sa.String(40), nullable=False),
+ sa.Column('exten', sa.String(40), nullable=False),
+ sa.Column('priority', sa.Integer, nullable=False,autoincrement=True),
+ sa.Column('app', sa.String(40), nullable=False),
+ sa.Column('appdata', sa.String(256), nullable=False),
+ )
+ op.create_primary_key('pkext_id', 'extensions', ['id'])
+ op.create_index('idxext_context', 'extensions', ['context'], unique=True)
+ op.create_index('idxext_exten', 'extensions', ['exten'], unique=True)
+ op.create_index('idxext_priority', 'extensions', ['priority'], unique=True)
def downgrade():
- op.drop_table('extensions')
+ op.drop_table('extensions')
diff --git a/contrib/ast-db-manage/config/versions/5950038a6ead_fix_pjsip_verifiy_typo.py b/contrib/ast-db-manage/config/versions/5950038a6ead_fix_pjsip_verifiy_typo.py
index 28ebc8b..e788dee 100644
--- a/contrib/ast-db-manage/config/versions/5950038a6ead_fix_pjsip_verifiy_typo.py
+++ b/contrib/ast-db-manage/config/versions/5950038a6ead_fix_pjsip_verifiy_typo.py
@@ -18,12 +18,23 @@
def upgrade():
- yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
- op.alter_column('ps_transports', 'verifiy_server', type_=yesno_values,
- new_column_name='verify_server')
+ currentcontext = op.get_context()
+ if currentcontext.bind.dialect.name != 'oracle':
+ yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
+ op.alter_column('ps_transports', 'verifiy_server', type_=yesno_values,
+ new_column_name='verify_server')
+ if currentcontext.bind.dialect.name == 'oracle':
+ #it is already fixed in moment of creation for oracle
+ #op.alter_column('ps_transports', 'verifiy_server', new_column_name='verify_server')
+ #op.alter_column('ps_transports', 'verify_server', type_=ENUM(*YESNO_VALUES, name='pstrYnNverifyserver'), existing_type=ENUM(*YESNO_VALUES, name='pstrYnNverifiy_server'))
+ pass
def downgrade():
- yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
- op.alter_column('ps_transports', 'verify_server', type_=yesno_values,
- new_column_name='verifiy_server')
+ currentcontext = op.get_context()
+ if currentcontext.bind.dialect.name != 'oracle':
+ yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
+ op.alter_column('ps_transports', 'verify_server', type_=yesno_values,
+ new_column_name='verifiy_server')
+ if currentcontext.bind.dialect.name == 'oracle':
+ pass
\ No newline at end of file
diff --git a/contrib/ast-db-manage/config/versions/c6d929b23a8_create_pjsip_subscription_persistence_.py b/contrib/ast-db-manage/config/versions/c6d929b23a8_create_pjsip_subscription_persistence_.py
index aa5c8c4..e7442fb 100644
--- a/contrib/ast-db-manage/config/versions/c6d929b23a8_create_pjsip_subscription_persistence_.py
+++ b/contrib/ast-db-manage/config/versions/c6d929b23a8_create_pjsip_subscription_persistence_.py
@@ -15,22 +15,42 @@
def upgrade():
- op.create_table(
- 'ps_subscription_persistence',
- sa.Column('id', sa.String(40), nullable=False, unique=True),
- sa.Column('packet', sa.String(2048)),
- sa.Column('src_name', sa.String(128)),
- sa.Column('src_port', sa.Integer),
- sa.Column('transport_key', sa.String(64)),
- sa.Column('local_name', sa.String(128)),
- sa.Column('local_port', sa.Integer),
- sa.Column('cseq', sa.Integer),
- sa.Column('tag', sa.String(128)),
- sa.Column('endpoint', sa.String(40)),
- sa.Column('expires', sa.Integer),
- )
+ currentcontext = op.get_context()
+ if currentcontext.bind.dialect.name != 'oracle':
+ op.create_table(
+ 'ps_subscription_persistence',
+ sa.Column('id', sa.String(40), nullable=False, unique=True),
+ sa.Column('packet', sa.String(2048)),
+ sa.Column('src_name', sa.String(128)),
+ sa.Column('src_port', sa.Integer),
+ sa.Column('transport_key', sa.String(64)),
+ sa.Column('local_name', sa.String(128)),
+ sa.Column('local_port', sa.Integer),
+ sa.Column('cseq', sa.Integer),
+ sa.Column('tag', sa.String(128)),
+ sa.Column('endpoint', sa.String(40)),
+ sa.Column('expires', sa.Integer),
+ )
- op.create_index('ps_subscription_persistence_id', 'ps_subscription_persistence', ['id'])
+ op.create_index('ps_subscription_persistence_id', 'ps_subscription_persistence', ['id'])
+
+ if currentcontext.bind.dialect.name == 'oracle':
+ op.create_table(
+ 'ps_subscription_persistence',
+ sa.Column('id', sa.String(40), nullable=False),
+ sa.Column('packet', sa.String(2048)),
+ sa.Column('src_name', sa.String(128)),
+ sa.Column('src_port', sa.Integer),
+ sa.Column('transport_key', sa.String(64)),
+ sa.Column('local_name', sa.String(128)),
+ sa.Column('local_port', sa.Integer),
+ sa.Column('cseq', sa.Integer),
+ sa.Column('tag', sa.String(128)),
+ sa.Column('endpoint', sa.String(40)),
+ sa.Column('expires', sa.Integer),
+ )
+
+ op.create_index('ps_subscription_persistence_id', 'ps_subscription_persistence', ['id'], unique=True)
def downgrade():
op.drop_table('ps_subscription_persistence')
diff --git a/contrib/ast-db-manage/config/versions/e96a0b8071c_increase_pjsip_column_size.py b/contrib/ast-db-manage/config/versions/e96a0b8071c_increase_pjsip_column_size.py
index d386ded..d9254f9 100644
--- a/contrib/ast-db-manage/config/versions/e96a0b8071c_increase_pjsip_column_size.py
+++ b/contrib/ast-db-manage/config/versions/e96a0b8071c_increase_pjsip_column_size.py
@@ -15,25 +15,25 @@
def upgrade():
- op.alter_column('ps_globals', 'user_agent', type_=sa.String(255))
+ op.alter_column('ps_globals', 'user_agent', type_=sa.String(255))
- op.alter_column('ps_contacts', 'id', type_=sa.String(255))
- op.alter_column('ps_contacts', 'uri', type_=sa.String(255))
- op.alter_column('ps_contacts', 'user_agent', type_=sa.String(255))
+ op.alter_column('ps_contacts', 'id', type_=sa.String(255))
+ op.alter_column('ps_contacts', 'uri', type_=sa.String(255))
+ op.alter_column('ps_contacts', 'user_agent', type_=sa.String(255))
- op.alter_column('ps_registrations', 'client_uri', type_=sa.String(255))
- op.alter_column('ps_registrations', 'server_uri', type_=sa.String(255))
+ op.alter_column('ps_registrations', 'client_uri', type_=sa.String(255))
+ op.alter_column('ps_registrations', 'server_uri', type_=sa.String(255))
def downgrade():
- op.alter_column('ps_registrations', 'server_uri', type_=sa.String(40))
- op.alter_column('ps_registrations', 'client_uri', type_=sa.String(40))
+ op.alter_column('ps_registrations', 'server_uri', type_=sa.String(40))
+ op.alter_column('ps_registrations', 'client_uri', type_=sa.String(40))
- op.alter_column('ps_contacts', 'user_agent', type_=sa.String(40))
- op.alter_column('ps_contacts', 'uri', type_=sa.String(40))
- op.alter_column('ps_contacts', 'id', type_=sa.String(40))
+ op.alter_column('ps_contacts', 'user_agent', type_=sa.String(40))
+ op.alter_column('ps_contacts', 'uri', type_=sa.String(40))
+ op.alter_column('ps_contacts', 'id', type_=sa.String(40))
- op.alter_column('ps_globals', 'user_agent', type_=sa.String(40))
+ op.alter_column('ps_globals', 'user_agent', type_=sa.String(40))
--
To view, visit https://gerrit.asterisk.org/943
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I09e09b8045eedfae0089e7f8356c165db0cd82bf
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: HZMI8gkCvPpom0tM <fuxfwgc4a2i1gr at gmail.com>
More information about the asterisk-code-review
mailing list