Asterisk - The Open Source Telephony Project GIT-master-f36a736
Functions | Variables
28887f25a46f_create_queue_tables Namespace Reference

Functions

def downgrade ()
 
def upgrade ()
 

Variables

string down_revision = '21e526ad3040'
 
string QUEUE_AUTOPAUSE_NAME = 'queue_autopause_values'
 
list QUEUE_AUTOPAUSE_VALUES = ['yes', 'no', 'all']
 
string QUEUE_STRATEGY_NAME = 'queue_strategy_values'
 
list QUEUE_STRATEGY_VALUES
 
string revision = '28887f25a46f'
 
string YESNO_NAME = 'yesno_values'
 
list YESNO_VALUES = ['yes', 'no']
 

Function Documentation

◆ downgrade()

def downgrade ( )

Definition at line 131 of file 28887f25a46f_create_queue_tables.py.

131def downgrade():
132 ########################## drop tables ###########################
133
134 op.drop_table('queues')
135 op.drop_table('queue_members')
136
137 ########################## drop enums ############################
138
139 sa.Enum(name=QUEUE_STRATEGY_NAME).drop(op.get_bind(), checkfirst=False)
140 sa.Enum(name=QUEUE_AUTOPAUSE_NAME).drop(op.get_bind(), checkfirst=False)

◆ upgrade()

def upgrade ( )

Definition at line 48 of file 28887f25a46f_create_queue_tables.py.

48def upgrade():
49 ############################# Enums ##############################
50
51 # yesno_values have already been created, so use postgres enum object
52 # type to get around "already created" issue - works okay with mysql
53 yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
54
55 queue_strategy_values = sa.Enum(*QUEUE_STRATEGY_VALUES, name=QUEUE_STRATEGY_NAME)
56 queue_autopause_values = sa.Enum(*QUEUE_AUTOPAUSE_VALUES, name=QUEUE_AUTOPAUSE_NAME)
57
58 ######################### create tables ##########################
59
60 op.create_table(
61 'queues',
62 sa.Column('name', sa.String(128), primary_key=True, nullable=False),
63 sa.Column('musiconhold', sa.String(128)),
64 sa.Column('announce', sa.String(128)),
65 sa.Column('context', sa.String(128)),
66 sa.Column('timeout', sa.Integer),
67 sa.Column('ringinuse', yesno_values),
68 sa.Column('setinterfacevar', yesno_values),
69 sa.Column('setqueuevar', yesno_values),
70 sa.Column('setqueueentryvar', yesno_values),
71 sa.Column('monitor_format', sa.String(8)),
72 sa.Column('membermacro', sa.String(512)),
73 sa.Column('membergosub', sa.String(512)),
74 sa.Column('queue_youarenext', sa.String(128)),
75 sa.Column('queue_thereare', sa.String(128)),
76 sa.Column('queue_callswaiting', sa.String(128)),
77 sa.Column('queue_quantity1', sa.String(128)),
78 sa.Column('queue_quantity2', sa.String(128)),
79 sa.Column('queue_holdtime', sa.String(128)),
80 sa.Column('queue_minutes', sa.String(128)),
81 sa.Column('queue_minute', sa.String(128)),
82 sa.Column('queue_seconds', sa.String(128)),
83 sa.Column('queue_thankyou', sa.String(128)),
84 sa.Column('queue_callerannounce', sa.String(128)),
85 sa.Column('queue_reporthold', sa.String(128)),
86 sa.Column('announce_frequency', sa.Integer),
87 sa.Column('announce_to_first_user', yesno_values),
88 sa.Column('min_announce_frequency', sa.Integer),
89 sa.Column('announce_round_seconds', sa.Integer),
90 sa.Column('announce_holdtime', sa.String(128)),
91 sa.Column('announce_position', sa.String(128)),
92 sa.Column('announce_position_limit', sa.Integer),
93 sa.Column('periodic_announce', sa.String(50)),
94 sa.Column('periodic_announce_frequency', sa.Integer),
95 sa.Column('relative_periodic_announce', yesno_values),
96 sa.Column('random_periodic_announce', yesno_values),
97 sa.Column('retry', sa.Integer),
98 sa.Column('wrapuptime', sa.Integer),
99 sa.Column('penaltymemberslimit', sa.Integer),
100 sa.Column('autofill', yesno_values),
101 sa.Column('monitor_type', sa.String(128)),
102 sa.Column('autopause', queue_autopause_values),
103 sa.Column('autopausedelay', sa.Integer),
104 sa.Column('autopausebusy', yesno_values),
105 sa.Column('autopauseunavail', yesno_values),
106 sa.Column('maxlen', sa.Integer),
107 sa.Column('servicelevel', sa.Integer),
108 sa.Column('strategy', queue_strategy_values),
109 sa.Column('joinempty', sa.String(128)),
110 sa.Column('leavewhenempty', sa.String(128)),
111 sa.Column('reportholdtime', yesno_values),
112 sa.Column('memberdelay', sa.Integer),
113 sa.Column('weight', sa.Integer),
114 sa.Column('timeoutrestart', yesno_values),
115 sa.Column('defaultrule', sa.String(128)),
116 sa.Column('timeoutpriority', sa.String(128))
117 )
118
119 op.create_table(
120 'queue_members',
121 sa.Column('queue_name', sa.String(80), primary_key=True, nullable=False),
122 sa.Column('interface', sa.String(80), primary_key=True, nullable=False),
123 sa.Column('uniqueid', sa.String(80), nullable=False),
124 sa.Column('membername', sa.String(80)),
125 sa.Column('state_interface', sa.String(80)),
126 sa.Column('penalty', sa.Integer),
127 sa.Column('paused', sa.Integer)
128 )
129
130

Variable Documentation

◆ down_revision

string down_revision = '21e526ad3040'

Definition at line 29 of file 28887f25a46f_create_queue_tables.py.

◆ QUEUE_AUTOPAUSE_NAME

string QUEUE_AUTOPAUSE_NAME = 'queue_autopause_values'

Definition at line 44 of file 28887f25a46f_create_queue_tables.py.

◆ QUEUE_AUTOPAUSE_VALUES

list QUEUE_AUTOPAUSE_VALUES = ['yes', 'no', 'all']

Definition at line 45 of file 28887f25a46f_create_queue_tables.py.

◆ QUEUE_STRATEGY_NAME

string QUEUE_STRATEGY_NAME = 'queue_strategy_values'

Definition at line 40 of file 28887f25a46f_create_queue_tables.py.

◆ QUEUE_STRATEGY_VALUES

list QUEUE_STRATEGY_VALUES
Initial value:
1= [ 'ringall', 'leastrecent', 'fewestcalls', 'random', 'rrmemory',
2 'linear', 'wrandom', 'rrordered', ]

Definition at line 41 of file 28887f25a46f_create_queue_tables.py.

◆ revision

string revision = '28887f25a46f'

Definition at line 28 of file 28887f25a46f_create_queue_tables.py.

◆ YESNO_NAME

string YESNO_NAME = 'yesno_values'

Definition at line 37 of file 28887f25a46f_create_queue_tables.py.

◆ YESNO_VALUES

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

Definition at line 38 of file 28887f25a46f_create_queue_tables.py.