mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-25 14:06:27 +00:00
Implement Configurable TCP Keepalive Settings in PJSIP Transports
This commit introduces configurable TCP keepalive settings for both TCP and TLS transports. The changes allow for finer control over TCP connection keepalives, enhancing stability and reliability in environments prone to connection timeouts or where intermediate devices may prematurely close idle connections. This has proven necessary and has already been tested in production in several specialized environments where access to the underlying transport is unreliable in ways invisible to the operating system directly, so these keepalive and timeout mechanisms are necessary.
Fixes #657
(cherry picked from commit f61e1d902b)
This commit is contained in:
committed by
Asterisk Development Team
parent
5ccedf22d2
commit
b85c9d80ca
@@ -0,0 +1,28 @@
|
||||
"""Add TCP keepalive settings to ps_transports
|
||||
|
||||
Revision ID: 8fce8496f03e
|
||||
Revises: 74dc751dfe8e
|
||||
Create Date: 2024-03-18 17:00:17.148018
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '8fce8496f03e'
|
||||
down_revision = '74dc751dfe8e'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
def upgrade():
|
||||
with op.batch_alter_table('ps_transports') as batch_op:
|
||||
batch_op.add_column(sa.Column('tcp_keepalive_enable', sa.Boolean(), nullable=True))
|
||||
batch_op.add_column(sa.Column('tcp_keepalive_idle_time', sa.Integer(), nullable=True))
|
||||
batch_op.add_column(sa.Column('tcp_keepalive_interval_time', sa.Integer(), nullable=True))
|
||||
batch_op.add_column(sa.Column('tcp_keepalive_probe_count', sa.Integer(), nullable=True))
|
||||
|
||||
def downgrade():
|
||||
with op.batch_alter_table('ps_transports') as batch_op:
|
||||
batch_op.drop_column('tcp_keepalive_enable')
|
||||
batch_op.drop_column('tcp_keepalive_idle_time')
|
||||
batch_op.drop_column('tcp_keepalive_interval_time')
|
||||
batch_op.drop_column('tcp_keepalive_probe_count')
|
||||
Reference in New Issue
Block a user