forked from asterisk/asterisk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
res_pjsip: Add 100rel option "peer_supported".
This patch adds a new option to the 100rel parameter for pjsip endpoints called "peer_supported". When an endpoint with this option receives an incoming request and the request indicated support for the 100rel extension, then Asterisk will send 1xx responses reliably. If the request did not indicate 100rel support, Asterisk sends 1xx responses normally. ASTERISK-30158 Change-Id: Id6d95ffa8f00dab118e0b386146e99f254f287ad
- Loading branch information
1 parent
2043234
commit 492c938
Showing
6 changed files
with
134 additions
and
7 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
contrib/ast-db-manage/config/versions/539f68bede2c_add_peer_supported_to_100rel.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
"""Add peer_supported to 100rel | ||
Revision ID: 539f68bede2c | ||
Revises: 9f3692b1654b | ||
Create Date: 2022-08-10 09:36:16.576049 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '539f68bede2c' | ||
down_revision = '9f3692b1654b' | ||
|
||
from alembic import op | ||
from sqlalchemy.dialects.postgresql import ENUM | ||
import sqlalchemy as sa | ||
|
||
|
||
OLD_ENUM = ['no', 'required', 'yes'] | ||
NEW_ENUM = ['no', 'required', 'peer_supported', 'yes'] | ||
|
||
old_type = sa.Enum(*OLD_ENUM, name='pjsip_100rel_values') | ||
new_type = sa.Enum(*NEW_ENUM, name='pjsip_100rel_values_v2') | ||
|
||
def upgrade(): | ||
context = op.get_context() | ||
|
||
# Upgrading to this revision WILL clear your directmedia values. | ||
if context.bind.dialect.name != 'postgresql': | ||
op.alter_column('ps_endpoints', '100rel', | ||
type_=new_type, | ||
existing_type=old_type) | ||
else: | ||
enum = ENUM(*NEW_ENUM, name='pjsip_100rel_values_v2') | ||
enum.create(op.get_bind(), checkfirst=False) | ||
|
||
op.execute('ALTER TABLE ps_endpoints ALTER COLUMN 100rel TYPE' | ||
' pjsip_100rel_values_v2 USING' | ||
' 100rel::text::pjsip_100rel_values_v2') | ||
|
||
ENUM(name="pjsip_100rel_values").drop(op.get_bind(), checkfirst=False) | ||
|
||
def downgrade(): | ||
context = op.get_context() | ||
|
||
if context.bind.dialect.name != 'postgresql': | ||
op.alter_column('ps_endpoints', '100rel', | ||
type_=old_type, | ||
existing_type=new_type) | ||
else: | ||
enum = ENUM(*OLD_ENUM, name='pjsip_100rel_values') | ||
enum.create(op.get_bind(), checkfirst=False) | ||
|
||
op.execute('ALTER TABLE ps_endpoints ALTER COLUMN 100rel TYPE' | ||
' pjsip_100rel_values USING' | ||
' 100rel::text::pjsip_100rel_values') | ||
|
||
ENUM(name="pjsip_100rel_values_v2").drop(op.get_bind(), checkfirst=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Subject: res_pjsip | ||
|
||
A new option named "peer_supported" has been added to the endpoint option | ||
100rel. When set to this option, Asterisk sends provisional responses | ||
reliably if the peer supports it. If the peer does not support reliable | ||
provisional responses, Asterisk sends them normally. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters