From 674b18bdf0923776fae692575869640f6c00e0b1 Mon Sep 17 00:00:00 2001 From: George Joseph Date: Sat, 11 Apr 2015 15:56:52 -0600 Subject: pjsip_options: Add qualify_timeout processing and eventing This is the second follow-on to https://reviewboard.asterisk.org/r/4572/ and the discussion at http://lists.digium.com/pipermail/asterisk-dev/2015-March/073921.html The basic issues are that changes in contact status don't cause events to be emitted for the associated endpoint. Only dynamic contact add/delete actions update the endpoint. Also, the qualify timeout is fixed by pjsip at 32 seconds which is a long time. This patch makes use of the new transaction timeout feature in r4585 and provides the following capabilities... 1. A new aor/contact variable 'qualify_timeout' has been added that allows the user to specify the maximum time in milliseconds to wait for a response to an OPTIONS message. The default is 3000ms. When the timer expires, the contact is marked unavailable. 2. Contact status changes are now propagated up to the endpoint as follows... When any contact is 'Available', the endpoint is marked as 'Reachable'. When all contacts are 'Unavailable', the endpoint is marked as 'Unreachable'. The existing endpoint events are generated appropriately. ASTERISK-24863 #close Change-Id: Id0ce0528e58014da1324856ea537e7765466044a Tested-by: Dmitriy Serov Tested-by: George Joseph --- .../461d7d691209_add_pjsip_qualify_timeout.py | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 contrib/ast-db-manage/config/versions/461d7d691209_add_pjsip_qualify_timeout.py (limited to 'contrib') diff --git a/contrib/ast-db-manage/config/versions/461d7d691209_add_pjsip_qualify_timeout.py b/contrib/ast-db-manage/config/versions/461d7d691209_add_pjsip_qualify_timeout.py new file mode 100644 index 000000000..9600c0461 --- /dev/null +++ b/contrib/ast-db-manage/config/versions/461d7d691209_add_pjsip_qualify_timeout.py @@ -0,0 +1,25 @@ +"""add pjsip qualify_timeout + +Revision ID: 461d7d691209 +Revises: 31cd4f4891ec +Create Date: 2015-04-15 13:54:08.047851 + +""" + +# revision identifiers, used by Alembic. +revision = '461d7d691209' +down_revision = '31cd4f4891ec' + +from alembic import op +import sqlalchemy as sa + +def upgrade(): + op.add_column('ps_aors', sa.Column('qualify_timeout', sa.Integer)) + op.add_column('ps_contacts', sa.Column('qualify_timeout', sa.Integer)) + pass + + +def downgrade(): + op.drop_column('ps_aors', 'qualify_timeout') + op.drop_column('ps_contacts', 'qualify_timeout') + pass -- cgit v1.2.3