res_pjsip: add "via_addr", "via_port", "call_id" to contact

As res_pjsip_nat rewrites contact's address, only the last Via header
can contain the source address of registered endpoint.
Also Call-Id header may contain the source address of registered
endpoint.

Added "via_addr", "via_port", "call_id" to contact.
Added new fields ViaAddress, CallID to AMI event ContactStatus.

ASTERISK-26011

Change-Id: I36bcc0bf422b3e0623680152d80486aeafe4c576
This commit is contained in:
Alexei Gradinari
2016-05-19 15:56:26 -04:00
parent a6b16d7029
commit 31f17abe44
8 changed files with 130 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
"""res_pjsip: add contact via_addr and callid
Revision ID: a845e4d8ade8
Revises: bca7113d796f
Create Date: 2016-05-19 15:51:33.410852
"""
# revision identifiers, used by Alembic.
revision = 'a845e4d8ade8'
down_revision = 'bca7113d796f'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('ps_contacts', sa.Column('via_addr', sa.String(40)))
op.add_column('ps_contacts', sa.Column('via_port', sa.Integer))
op.add_column('ps_contacts', sa.Column('call_id', sa.String(255)))
def downgrade():
op.drop_column('ps_contacts', 'via_addr')
op.drop_column('ps_contacts', 'via_port')
op.drop_column('ps_contacts', 'call_id')