mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-18 10:44:28 +00:00
res_musiconhold: Add option to loop last file.
Adds the loop_last option to res_musiconhold,
which allows the last audio file in the directory
to be looped perpetually once reached, rather than
circling back to the beginning again.
Resolves: #122
ASTERISK-30462
UserNote: The loop_last option in musiconhold.conf now
allows the last file in the directory to be looped once reached.
(cherry picked from commit edf488c76e
)
This commit is contained in:
committed by
Asterisk Development Team
parent
457a72304d
commit
8cdf711531
@@ -0,0 +1,27 @@
|
||||
"""Add loop_last to res_musiconhold
|
||||
|
||||
Revision ID: f5b0e7427449
|
||||
Revises: f261363a857f
|
||||
Create Date: 2023-03-13 23:59:00.835055
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'f5b0e7427449'
|
||||
down_revision = 'f261363a857f'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects.postgresql import ENUM
|
||||
|
||||
YESNO_NAME = 'yesno_values'
|
||||
YESNO_VALUES = ['yes', 'no']
|
||||
|
||||
def upgrade():
|
||||
yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
|
||||
op.add_column('musiconhold', sa.Column('loop_last', yesno_values))
|
||||
|
||||
def downgrade():
|
||||
if op.get_context().bind.dialect.name == 'mssql':
|
||||
op.drop_constraint('musiconhold','loop_last')
|
||||
op.drop_column('musiconhold', 'loop_last')
|
Reference in New Issue
Block a user