Asterisk - The Open Source Telephony Project  18.5.0
Functions | Variables
4da0c5f79a9c_create_tables Namespace Reference

Functions

def downgrade ()
 
def upgrade ()
 

Variables

 down_revision = None
 
list IAX_ENCRYPTION_VALUES = ['yes', 'no', 'aes128']
 
list IAX_REQUIRECALLTOKEN_VALUES = ['yes', 'no', 'auto']
 
list IAX_TRANSFER_VALUES = ['yes', 'no', 'mediaonly']
 
list MOH_MODE_VALUES = ['custom', 'files', 'mp3nb', 'quietmp3nb', 'quietmp3']
 
string revision = '4da0c5f79a9c'
 
list SIP_CALLINGPRES_VALUES
 
list SIP_DIRECTMEDIA_VALUES = ['yes', 'no', 'nonat', 'update']
 
list SIP_DTMFMODE_VALUES = ['rfc2833', 'info', 'shortinfo', 'inband', 'auto']
 
list SIP_PROGRESSINBAND_VALUES = ['yes', 'no', 'never']
 
list SIP_SESSION_REFRESHER_VALUES = ['uac', 'uas']
 
list SIP_SESSION_TIMERS_VALUES = ['accept', 'refuse', 'originate']
 
list SIP_TRANSPORT_VALUES = ['udp', 'tcp', 'tls', 'ws', 'wss', 'udp,tcp', 'tcp,udp']
 
list TYPE_VALUES = ['friend', 'user', 'peer']
 
list YESNO_VALUES = ['yes', 'no']
 

Function Documentation

◆ downgrade()

def 4da0c5f79a9c_create_tables.downgrade ( )

Definition at line 325 of file 4da0c5f79a9c_create_tables.py.

325 def downgrade():
326  context = op.get_context()
327 
328  op.drop_table('sippeers')
329  op.drop_table('iaxfriends')
330  op.drop_table('voicemail')
331  op.drop_table('meetme')
332  op.drop_table('musiconhold')
333 
334  enums = ['type_values', 'yes_no_values',
335  'sip_transport_values','sip_dtmfmode_values','sip_directmedia_values',
336  'sip_progressinband_values','sip_session_timers_values','sip_session_refresher_values',
337  'sip_callingpres_values','iax_requirecalltoken_values','iax_encryption_values',
338  'iax_transfer_values','moh_mode_values']
339 
340  if context.bind.dialect.name == 'postgresql':
341  for e in enums:
342  ENUM(name=e).drop(op.get_bind(), checkfirst=False)

◆ upgrade()

def 4da0c5f79a9c_create_tables.upgrade ( )

Definition at line 56 of file 4da0c5f79a9c_create_tables.py.

56 def upgrade():
57  op.create_table(
58  'sippeers',
59  sa.Column('id', sa.Integer, primary_key=True, nullable=False,
60  autoincrement=True),
61  sa.Column('name', sa.String(40), nullable=False, unique=True),
62  sa.Column('ipaddr', sa.String(45)),
63  sa.Column('port', sa.Integer),
64  sa.Column('regseconds', sa.Integer),
65  sa.Column('defaultuser', sa.String(40)),
66  sa.Column('fullcontact', sa.String(80)),
67  sa.Column('regserver', sa.String(20)),
68  sa.Column('useragent', sa.String(20)),
69  sa.Column('lastms', sa.Integer),
70  sa.Column('host', sa.String(40)),
71  sa.Column('type', sa.Enum(*TYPE_VALUES, name='type_values')),
72  sa.Column('context', sa.String(40)),
73  sa.Column('permit', sa.String(95)),
74  sa.Column('deny', sa.String(95)),
75  sa.Column('secret', sa.String(40)),
76  sa.Column('md5secret', sa.String(40)),
77  sa.Column('remotesecret', sa.String(40)),
78  sa.Column('transport', sa.Enum(*SIP_TRANSPORT_VALUES,
79  name='sip_transport_values')),
80  sa.Column('dtmfmode', sa.Enum(*SIP_DTMFMODE_VALUES,
81  name='sip_dtmfmode_values')),
82  sa.Column('directmedia', sa.Enum(*SIP_DIRECTMEDIA_VALUES,
83  name='sip_directmedia_values')),
84  sa.Column('nat', sa.String(29)),
85  sa.Column('callgroup', sa.String(40)),
86  sa.Column('pickupgroup', sa.String(40)),
87  sa.Column('language', sa.String(40)),
88  sa.Column('disallow', sa.String(200)),
89  sa.Column('allow', sa.String(200)),
90  sa.Column('insecure', sa.String(40)),
91  sa.Column('trustrpid', sa.Enum(*YESNO_VALUES,
92  name='yes_no_values')),
93  sa.Column('progressinband', sa.Enum(*SIP_PROGRESSINBAND_VALUES,
94  name='sip_progressinband_values')),
95  sa.Column('promiscredir', sa.Enum(*YESNO_VALUES,
96  name='yes_no_values')),
97  sa.Column('useclientcode', sa.Enum(*YESNO_VALUES,
98  name='yes_no_values')),
99  sa.Column('accountcode', sa.String(40)),
100  sa.Column('setvar', sa.String(200)),
101  sa.Column('callerid', sa.String(40)),
102  sa.Column('amaflags', sa.String(40)),
103  sa.Column('callcounter', sa.Enum(*YESNO_VALUES,
104  name='yes_no_values')),
105  sa.Column('busylevel', sa.Integer),
106  sa.Column('allowoverlap', sa.Enum(*YESNO_VALUES,
107  name='yes_no_values')),
108  sa.Column('allowsubscribe', sa.Enum(*YESNO_VALUES,
109  name='yes_no_values')),
110  sa.Column('videosupport', sa.Enum(*YESNO_VALUES,
111  name='yes_no_values')),
112  sa.Column('maxcallbitrate', sa.Integer),
113  sa.Column('rfc2833compensate', sa.Enum(*YESNO_VALUES,
114  name='yes_no_values')),
115  sa.Column('mailbox', sa.String(40)),
116  sa.Column('session-timers', sa.Enum(*SIP_SESSION_TIMERS_VALUES,
117  name='sip_session_timers_values')),
118  sa.Column('session-expires', sa.Integer),
119  sa.Column('session-minse', sa.Integer),
120  sa.Column('session-refresher', sa.Enum(*SIP_SESSION_REFRESHER_VALUES,
121  name='sip_session_refresher_values')),
122  sa.Column('t38pt_usertpsource', sa.String(40)),
123  sa.Column('regexten', sa.String(40)),
124  sa.Column('fromdomain', sa.String(40)),
125  sa.Column('fromuser', sa.String(40)),
126  sa.Column('qualify', sa.String(40)),
127  sa.Column('defaultip', sa.String(45)),
128  sa.Column('rtptimeout', sa.Integer),
129  sa.Column('rtpholdtimeout', sa.Integer),
130  sa.Column('sendrpid', sa.Enum(*YESNO_VALUES,
131  name='yes_no_values')),
132  sa.Column('outboundproxy', sa.String(40)),
133  sa.Column('callbackextension', sa.String(40)),
134  sa.Column('timert1', sa.Integer),
135  sa.Column('timerb', sa.Integer),
136  sa.Column('qualifyfreq', sa.Integer),
137  sa.Column('constantssrc', sa.Enum(*YESNO_VALUES,
138  name='yes_no_values')),
139  sa.Column('contactpermit', sa.String(95)),
140  sa.Column('contactdeny', sa.String(95)),
141  sa.Column('usereqphone', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
142  sa.Column('textsupport', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
143  sa.Column('faxdetect', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
144  sa.Column('buggymwi', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
145  sa.Column('auth', sa.String(40)),
146  sa.Column('fullname', sa.String(40)),
147  sa.Column('trunkname', sa.String(40)),
148  sa.Column('cid_number', sa.String(40)),
149  sa.Column('callingpres', sa.Enum(*SIP_CALLINGPRES_VALUES,
150  name='sip_callingpres_values')),
151  sa.Column('mohinterpret', sa.String(40)),
152  sa.Column('mohsuggest', sa.String(40)),
153  sa.Column('parkinglot', sa.String(40)),
154  sa.Column('hasvoicemail', sa.Enum(*YESNO_VALUES,
155  name='yes_no_values')),
156  sa.Column('subscribemwi', sa.Enum(*YESNO_VALUES,
157  name='yes_no_values')),
158  sa.Column('vmexten', sa.String(40)),
159  sa.Column('autoframing', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
160  sa.Column('rtpkeepalive', sa.Integer),
161  sa.Column('call-limit', sa.Integer),
162  sa.Column('g726nonstandard', sa.Enum(*YESNO_VALUES,
163  name='yes_no_values')),
164  sa.Column('ignoresdpversion', sa.Enum(*YESNO_VALUES,
165  name='yes_no_values')),
166  sa.Column('allowtransfer', sa.Enum(*YESNO_VALUES,
167  name='yes_no_values')),
168  sa.Column('dynamic', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
169  sa.Column('path', sa.String(256)),
170  sa.Column('supportpath', sa.Enum(*YESNO_VALUES, name='yes_no_values'))
171  )
172  op.create_index('sippeers_name', 'sippeers', ['name'])
173  op.create_index('sippeers_name_host', 'sippeers', ['name', 'host'])
174  op.create_index('sippeers_ipaddr_port', 'sippeers', ['ipaddr', 'port'])
175  op.create_index('sippeers_host_port', 'sippeers', ['host', 'port'])
176 
177  op.create_table(
178  'iaxfriends',
179  sa.Column('id', sa.Integer, primary_key=True, nullable=False,
180  autoincrement=True),
181  sa.Column('name', sa.String(40), nullable=False, unique=True),
182  sa.Column('type', sa.Enum(*TYPE_VALUES, name='type_values')),
183  sa.Column('username', sa.String(40)),
184  sa.Column('mailbox', sa.String(40)),
185  sa.Column('secret', sa.String(40)),
186  sa.Column('dbsecret', sa.String(40)),
187  sa.Column('context', sa.String(40)),
188  sa.Column('regcontext', sa.String(40)),
189  sa.Column('host', sa.String(40)),
190  sa.Column('ipaddr', sa.String(40)),
191  sa.Column('port', sa.Integer),
192  sa.Column('defaultip', sa.String(20)),
193  sa.Column('sourceaddress', sa.String(20)),
194  sa.Column('mask', sa.String(20)),
195  sa.Column('regexten', sa.String(40)),
196  sa.Column('regseconds', sa.Integer),
197  sa.Column('accountcode', sa.String(20)),
198  sa.Column('mohinterpret', sa.String(20)),
199  sa.Column('mohsuggest', sa.String(20)),
200  sa.Column('inkeys', sa.String(40)),
201  sa.Column('outkeys', sa.String(40)),
202  sa.Column('language', sa.String(10)),
203  sa.Column('callerid', sa.String(100)),
204  sa.Column('cid_number', sa.String(40)),
205  sa.Column('sendani', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
206  sa.Column('fullname', sa.String(40)),
207  sa.Column('trunk', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
208  sa.Column('auth', sa.String(20)),
209  sa.Column('maxauthreq', sa.Integer),
210  sa.Column('requirecalltoken', sa.Enum(*IAX_REQUIRECALLTOKEN_VALUES,
211  name='iax_requirecalltoken_values')),
212  sa.Column('encryption', sa.Enum(*IAX_ENCRYPTION_VALUES,
213  name='iax_encryption_values')),
214  sa.Column('transfer', sa.Enum(*IAX_TRANSFER_VALUES,
215  name='iax_transfer_values')),
216  sa.Column('jitterbuffer', sa.Enum(*YESNO_VALUES,
217  name='yes_no_values')),
218  sa.Column('forcejitterbuffer', sa.Enum(*YESNO_VALUES,
219  name='yes_no_values')),
220  sa.Column('disallow', sa.String(200)),
221  sa.Column('allow', sa.String(200)),
222  sa.Column('codecpriority', sa.String(40)),
223  sa.Column('qualify', sa.String(10)),
224  sa.Column('qualifysmoothing',
225  sa.Enum(*YESNO_VALUES, name='yes_no_values')),
226  sa.Column('qualifyfreqok', sa.String(10)),
227  sa.Column('qualifyfreqnotok', sa.String(10)),
228  sa.Column('timezone', sa.String(20)),
229  sa.Column('adsi', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
230  sa.Column('amaflags', sa.String(20)),
231  sa.Column('setvar', sa.String(200))
232  )
233  op.create_index('iaxfriends_name', 'iaxfriends', ['name'])
234  op.create_index('iaxfriends_name_host', 'iaxfriends', ['name', 'host'])
235  op.create_index('iaxfriends_name_ipaddr_port', 'iaxfriends',
236  ['name', 'ipaddr', 'port'])
237  op.create_index('iaxfriends_ipaddr_port', 'iaxfriends', ['ipaddr', 'port'])
238  op.create_index('iaxfriends_host_port', 'iaxfriends', ['host', 'port'])
239 
240  op.create_table(
241  'voicemail',
242  sa.Column('uniqueid', sa.Integer, primary_key=True, nullable=False,
243  autoincrement=True),
244  sa.Column('context', sa.String(80), nullable=False),
245  sa.Column('mailbox', sa.String(80), nullable=False),
246  sa.Column('password', sa.String(80), nullable=False),
247  sa.Column('fullname', sa.String(80)),
248  sa.Column('alias', sa.String(80)),
249  sa.Column('email', sa.String(80)),
250  sa.Column('pager', sa.String(80)),
251  sa.Column('attach', sa.Enum(*YESNO_VALUES, name='yes_no_values')),
252  sa.Column('attachfmt', sa.String(10)),
253  sa.Column('serveremail', sa.String(80)),
254  sa.Column('language', sa.String(20)),
255  sa.Column('tz', sa.String(30)),
256  sa.Column('deletevoicemail', sa.Enum(*YESNO_VALUES,
257  name='yes_no_values')),
258  sa.Column('saycid', sa.Enum(*YESNO_VALUES,
259  name='yes_no_values')),
260  sa.Column('sendvoicemail', sa.Enum(*YESNO_VALUES,
261  name='yes_no_values')),
262  sa.Column('review', sa.Enum(*YESNO_VALUES,
263  name='yes_no_values')),
264  sa.Column('tempgreetwarn', sa.Enum(*YESNO_VALUES,
265  name='yes_no_values')),
266  sa.Column('operator', sa.Enum(*YESNO_VALUES,
267  name='yes_no_values')),
268  sa.Column('envelope', sa.Enum(*YESNO_VALUES,
269  name='yes_no_values')),
270  sa.Column('sayduration', sa.Integer),
271  sa.Column('forcename', sa.Enum(*YESNO_VALUES,
272  name='yes_no_values')),
273  sa.Column('forcegreetings', sa.Enum(*YESNO_VALUES,
274  name='yes_no_values')),
275  sa.Column('callback', sa.String(80)),
276  sa.Column('dialout', sa.String(80)),
277  sa.Column('exitcontext', sa.String(80)),
278  sa.Column('maxmsg', sa.Integer),
279  sa.Column('volgain', sa.Numeric(precision=5, scale=2)),
280  sa.Column('imapuser', sa.String(80)),
281  sa.Column('imappassword', sa.String(80)),
282  sa.Column('imapserver', sa.String(80)),
283  sa.Column('imapport', sa.String(8)),
284  sa.Column('imapflags', sa.String(80)),
285  sa.Column('stamp', sa.DateTime())
286  )
287  op.create_index('voicemail_mailbox', 'voicemail', ['mailbox'])
288  op.create_index('voicemail_context', 'voicemail', ['context'])
289  op.create_index('voicemail_mailbox_context', 'voicemail',
290  ['mailbox', 'context'])
291  op.create_index('voicemail_imapuser', 'voicemail', ['imapuser'])
292 
293  op.create_table(
294  'meetme',
295  sa.Column('bookid', sa.Integer, primary_key=True, nullable=False,
296  autoincrement=True),
297  sa.Column('confno', sa.String(80), nullable=False),
298  sa.Column('starttime', sa.DateTime()),
299  sa.Column('endtime', sa.DateTime()),
300  sa.Column('pin', sa.String(20)),
301  sa.Column('adminpin', sa.String(20)),
302  sa.Column('opts', sa.String(20)),
303  sa.Column('adminopts', sa.String(20)),
304  sa.Column('recordingfilename', sa.String(80)),
305  sa.Column('recordingformat', sa.String(10)),
306  sa.Column('maxusers', sa.Integer),
307  sa.Column('members', sa.Integer, nullable=False, default=0)
308  )
309  op.create_index('meetme_confno_start_end', 'meetme',
310  ['confno', 'starttime', 'endtime'])
311 
312  op.create_table(
313  'musiconhold',
314  sa.Column('name', sa.String(80), primary_key=True, nullable=False),
315  sa.Column('mode', sa.Enum(*MOH_MODE_VALUES, name='moh_mode_values')),
316  sa.Column('directory', sa.String(255)),
317  sa.Column('application', sa.String(255)),
318  sa.Column('digit', sa.String(1)),
319  sa.Column('sort', sa.String(10)),
320  sa.Column('format', sa.String(10)),
321  sa.Column('stamp', sa.DateTime())
322  )
323 
324 

Variable Documentation

◆ down_revision

down_revision = None

Definition at line 29 of file 4da0c5f79a9c_create_tables.py.

◆ IAX_ENCRYPTION_VALUES

list IAX_ENCRYPTION_VALUES = ['yes', 'no', 'aes128']

Definition at line 50 of file 4da0c5f79a9c_create_tables.py.

◆ IAX_REQUIRECALLTOKEN_VALUES

list IAX_REQUIRECALLTOKEN_VALUES = ['yes', 'no', 'auto']

Definition at line 49 of file 4da0c5f79a9c_create_tables.py.

◆ IAX_TRANSFER_VALUES

list IAX_TRANSFER_VALUES = ['yes', 'no', 'mediaonly']

Definition at line 51 of file 4da0c5f79a9c_create_tables.py.

◆ MOH_MODE_VALUES

list MOH_MODE_VALUES = ['custom', 'files', 'mp3nb', 'quietmp3nb', 'quietmp3']

Definition at line 53 of file 4da0c5f79a9c_create_tables.py.

◆ revision

string revision = '4da0c5f79a9c'

Definition at line 28 of file 4da0c5f79a9c_create_tables.py.

◆ SIP_CALLINGPRES_VALUES

list SIP_CALLINGPRES_VALUES
Initial value:
1 = ['allowed_not_screened', 'allowed_passed_screen',
2  'allowed_failed_screen', 'allowed',
3  'prohib_not_screened', 'prohib_passed_screen',
4  'prohib_failed_screen', 'prohib']

Definition at line 44 of file 4da0c5f79a9c_create_tables.py.

◆ SIP_DIRECTMEDIA_VALUES

list SIP_DIRECTMEDIA_VALUES = ['yes', 'no', 'nonat', 'update']

Definition at line 40 of file 4da0c5f79a9c_create_tables.py.

◆ SIP_DTMFMODE_VALUES

list SIP_DTMFMODE_VALUES = ['rfc2833', 'info', 'shortinfo', 'inband', 'auto']

Definition at line 39 of file 4da0c5f79a9c_create_tables.py.

◆ SIP_PROGRESSINBAND_VALUES

list SIP_PROGRESSINBAND_VALUES = ['yes', 'no', 'never']

Definition at line 41 of file 4da0c5f79a9c_create_tables.py.

◆ SIP_SESSION_REFRESHER_VALUES

list SIP_SESSION_REFRESHER_VALUES = ['uac', 'uas']

Definition at line 43 of file 4da0c5f79a9c_create_tables.py.

◆ SIP_SESSION_TIMERS_VALUES

list SIP_SESSION_TIMERS_VALUES = ['accept', 'refuse', 'originate']

Definition at line 42 of file 4da0c5f79a9c_create_tables.py.

◆ SIP_TRANSPORT_VALUES

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

Definition at line 38 of file 4da0c5f79a9c_create_tables.py.

◆ TYPE_VALUES

list TYPE_VALUES = ['friend', 'user', 'peer']

Definition at line 36 of file 4da0c5f79a9c_create_tables.py.

◆ YESNO_VALUES

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

Definition at line 35 of file 4da0c5f79a9c_create_tables.py.