49
50
51
52
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
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