res_pjsip: Add new endpoint option "suppress_moh_on_sendonly"

Normally, when one party in a call sends Asterisk an SDP with
a "sendonly" or "inactive" attribute it means "hold" and causes
Asterisk to start playing MOH back to the other party. This can be
problematic if it happens at certain times, such as in a 183
Progress message, because the MOH will replace any early media you
may be playing to the calling party. If you set this option
to "yes" on an endpoint and the endpoint receives an SDP
with "sendonly" or "inactive", Asterisk will NOT play MOH back to
the other party.

Resolves: #979

UserNote: The new "suppress_moh_on_sendonly" endpoint option
can be used to prevent playing MOH back to a caller if the remote
end sends "sendonly" or "inactive" (hold) to Asterisk in an SDP.
This commit is contained in:
George Joseph
2024-11-05 11:30:55 -07:00
committed by asterisk-org-access-app[bot]
parent db79bcb82f
commit 02e2000653
6 changed files with 79 additions and 6 deletions

View File

@@ -0,0 +1,30 @@
"""Add suppress_moh_on_sendonly
Revision ID: 4f91fc18c979
Revises: 801b9fced8b7
Create Date: 2024-11-05 11:37:33.604448
"""
# revision identifiers, used by Alembic.
revision = '4f91fc18c979'
down_revision = '801b9fced8b7'
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('ps_endpoints', sa.Column('suppress_moh_on_sendonly', yesno_values))
def downgrade():
if op.get_context().bind.dialect.name == 'mssql':
op.drop_constraint('ck_ps_endpoints_suppress_moh_on_sendonly_yesno_values', 'ps_endpoints')
op.drop_column('ps_endpoints', 'suppress_moh_on_sendonly')