2fc7930b41b3_add_pjsip_endpoint_options_for_12_1 Namespace Reference


Functions

def downgrade
def upgrade

Variables

string down_revision = '581a4264e537'
string PJSIP_REDIRECT_METHOD_NAME = 'pjsip_redirect_method_values'
list PJSIP_REDIRECT_METHOD_VALUES = ['user', 'uri_core', 'uri_pjsip']
string PJSIP_TRANSPORT_METHOD_NAME = 'pjsip_transport_method_values'
list PJSIP_TRANSPORT_METHOD_VALUES
string PJSIP_TRANSPORT_PROTOCOL_NAME = 'pjsip_transport_protocol_values'
list PJSIP_TRANSPORT_PROTOCOL_VALUES = ['udp', 'tcp', 'tls', 'ws', 'wss']
string revision = '2fc7930b41b3'
string YESNO_NAME = 'yesno_values'
list YESNO_VALUES = ['yes', 'no']


Function Documentation

def 2fc7930b41b3_add_pjsip_endpoint_options_for_12_1::downgrade (  ) 

Definition at line 144 of file 2fc7930b41b3_add_pjsip_endpoint_options_for_12_1.py.

00144                :
00145     ########################## drop columns ##########################
00146 
00147     op.drop_column('ps_aors', 'support_path')
00148     op.drop_column('ps_aors', 'outbound_proxy')
00149     op.drop_column('ps_aors', 'maximum_expiration')
00150 
00151     op.drop_column('ps_contacts', 'path')
00152     op.drop_column('ps_contacts', 'outbound_proxy')
00153 
00154     op.alter_column('ps_endpoints', 'mwi_from_user',
00155                     new_column_name='mwi_fromuser',
00156                     existing_type=sa.String(40))
00157 
00158     op.drop_column('ps_endpoints', 'set_var')
00159     op.drop_column('ps_endpoints', 'redirect_method')
00160     op.drop_column('ps_endpoints', 'media_address')
00161 
00162     ########################## drop tables ###########################
00163 
00164     op.drop_table('ps_registrations')
00165     op.drop_table('ps_transports')
00166     op.drop_table('ps_globals')
00167     op.drop_table('ps_systems')
00168 
00169     ########################## drop enums ############################
00170 
00171     sa.Enum(name=PJSIP_TRANSPORT_PROTOCOL_NAME).drop(
00172         op.get_bind(), checkfirst=False)
00173     sa.Enum(name=PJSIP_TRANSPORT_METHOD_NAME).drop(
00174         op.get_bind(), checkfirst=False)
00175     sa.Enum(name=PJSIP_REDIRECT_METHOD_NAME).drop(
00176         op.get_bind(), checkfirst=False)
        op.get_bind(), checkfirst=False)

def 2fc7930b41b3_add_pjsip_endpoint_options_for_12_1::upgrade (  ) 

Definition at line 31 of file 2fc7930b41b3_add_pjsip_endpoint_options_for_12_1.py.

00031              :
00032     ############################# Enums ##############################
00033 
00034     # yesno_values have already been created, so use postgres enum object
00035     # type to get around "already created" issue - works okay with mysql
00036     yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
00037 
00038     # for some reason when using 'add_column' if you don't create the enum
00039     # first it will think it already exists and fail
00040     pjsip_redirect_method_values = sa.Enum(
00041         *PJSIP_REDIRECT_METHOD_VALUES, name=PJSIP_REDIRECT_METHOD_NAME)
00042     check = False if context.is_offline_mode() else True
00043     pjsip_redirect_method_values.create(op.get_bind(), checkfirst=check)
00044 
00045     pjsip_transport_method_values = sa.Enum(
00046         *PJSIP_TRANSPORT_METHOD_VALUES, name=PJSIP_TRANSPORT_METHOD_NAME)
00047 
00048     pjsip_transport_protocol_values = sa.Enum(
00049         *PJSIP_TRANSPORT_PROTOCOL_VALUES, name=PJSIP_TRANSPORT_PROTOCOL_NAME)
00050 
00051     ######################### create tables ##########################
00052 
00053     op.create_table(
00054         'ps_systems',
00055         sa.Column('id', sa.String(40), nullable=False, unique=True),
00056         sa.Column('timer_t1', sa.Integer),
00057         sa.Column('timer_b', sa.Integer),
00058         sa.Column('compact_headers', yesno_values),
00059         sa.Column('threadpool_initial_size', sa.Integer),
00060         sa.Column('threadpool_auto_increment', sa.Integer),
00061         sa.Column('threadpool_idle_timeout', sa.Integer),
00062         sa.Column('threadpool_max_size', sa.Integer),
00063     )
00064 
00065     op.create_index('ps_systems_id', 'ps_systems', ['id'])
00066 
00067     op.create_table(
00068         'ps_globals',
00069         sa.Column('id', sa.String(40), nullable=False, unique=True),
00070         sa.Column('max_forwards', sa.Integer),
00071         sa.Column('user_agent', sa.String(40)),
00072         sa.Column('default_outbound_endpoint', sa.String(40)),
00073     )
00074 
00075     op.create_index('ps_globals_id', 'ps_globals', ['id'])
00076 
00077     op.create_table(
00078         'ps_transports',
00079         sa.Column('id', sa.String(40), nullable=False, unique=True),
00080         sa.Column('async_operations', sa.Integer),
00081         sa.Column('bind', sa.String(40)),
00082         sa.Column('ca_list_file', sa.String(200)),
00083         sa.Column('cert_file', sa.String(200)),
00084         sa.Column('cipher', sa.String(200)),
00085         sa.Column('domain', sa.String(40)),
00086         sa.Column('external_media_address', sa.String(40)),
00087         sa.Column('external_signaling_address', sa.String(40)),
00088         sa.Column('external_signaling_port', sa.Integer),
00089         sa.Column('method', pjsip_transport_method_values),
00090         sa.Column('local_net', sa.String(40)),
00091         sa.Column('password', sa.String(40)),
00092         sa.Column('priv_key_file', sa.String(200)),
00093         sa.Column('protocol', pjsip_transport_protocol_values),
00094         sa.Column('require_client_cert', yesno_values),
00095         sa.Column('verify_client', yesno_values),
00096         sa.Column('verifiy_server', yesno_values),
00097         sa.Column('tos', yesno_values),
00098         sa.Column('cos', yesno_values),
00099     )
00100 
00101     op.create_index('ps_transports_id', 'ps_transports', ['id'])
00102 
00103     op.create_table(
00104         'ps_registrations',
00105         sa.Column('id', sa.String(40), nullable=False, unique=True),
00106         sa.Column('auth_rejection_permanent', yesno_values),
00107         sa.Column('client_uri', sa.String(40)),
00108         sa.Column('contact_user', sa.String(40)),
00109         sa.Column('expiration', sa.Integer),
00110         sa.Column('max_retries', sa.Integer),
00111         sa.Column('outbound_auth', sa.String(40)),
00112         sa.Column('outbound_proxy', sa.String(40)),
00113         sa.Column('retry_interval', sa.Integer),
00114         sa.Column('forbidden_retry_interval', sa.Integer),
00115         sa.Column('server_uri', sa.String(40)),
00116         sa.Column('transport', sa.String(40)),
00117         sa.Column('support_path', yesno_values),
00118     )
00119 
00120     op.create_index('ps_registrations_id', 'ps_registrations', ['id'])
00121 
00122     ########################## add columns ###########################
00123 
00124     # new columns for endpoints
00125     op.add_column('ps_endpoints', sa.Column('media_address', sa.String(40)))
00126     op.add_column('ps_endpoints', sa.Column('redirect_method',
00127                                             pjsip_redirect_method_values))
00128     op.add_column('ps_endpoints', sa.Column('set_var', sa.Text()))
00129 
00130     # rename mwi_fromuser to mwi_from_user
00131     op.alter_column('ps_endpoints', 'mwi_fromuser',
00132                     new_column_name='mwi_from_user',
00133                     existing_type=sa.String(40))
00134 
00135     # new columns for contacts
00136     op.add_column('ps_contacts', sa.Column('outbound_proxy', sa.String(40)))
00137     op.add_column('ps_contacts', sa.Column('path', sa.Text()))
00138 
00139     # new columns for aors
00140     op.add_column('ps_aors', sa.Column('maximum_expiration', sa.Integer))
00141     op.add_column('ps_aors', sa.Column('outbound_proxy', sa.String(40)))
00142     op.add_column('ps_aors', sa.Column('support_path', yesno_values))
00143 
def downgrade():


Variable Documentation

string down_revision = '581a4264e537'

string PJSIP_REDIRECT_METHOD_NAME = 'pjsip_redirect_method_values'

list PJSIP_REDIRECT_METHOD_VALUES = ['user', 'uri_core', 'uri_pjsip']

string PJSIP_TRANSPORT_METHOD_NAME = 'pjsip_transport_method_values'

Initial value:

['default', 'unspecified', 'tlsv1', 'sslv2',
                                 'sslv3', 'sslv23']

Definition at line 25 of file 2fc7930b41b3_add_pjsip_endpoint_options_for_12_1.py.

string PJSIP_TRANSPORT_PROTOCOL_NAME = 'pjsip_transport_protocol_values'

list PJSIP_TRANSPORT_PROTOCOL_VALUES = ['udp', 'tcp', 'tls', 'ws', 'wss']

string revision = '2fc7930b41b3'

string YESNO_NAME = 'yesno_values'

list YESNO_VALUES = ['yes', 'no']


Generated on Thu Apr 16 06:41:37 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6