From d8f0bc35729466c44181dab6f25da5891e8ce694 Mon Sep 17 00:00:00 2001 From: George Joseph Date: Thu, 24 Mar 2016 21:55:03 -0600 Subject: res_pjsip_mwi: Add voicemail extension and mwi_subscribe_replaces_unsolicited res_pjsip_mwi was missing the chan_sip "vmexten" functionality which adds the Message-Account header to the MWI NOTIFY. Also, specifying mailboxes on endpoints for unsolicited mwi and on aors for subscriptions required that the admin know in advance which the client wanted. If you specified mailboxes on the endpoint, subscriptions were rejected even if you also specified mailboxes on the aor. Voicemail extension: * Added a global default_voicemail_extension which defaults to "". * Added voicemail_extension to both endpoint and aor. * Added ast_sip_subscription_get_dialog for support. * Added ast_sip_subscription_get_sip_uri for support. When an unsolicited NOTIFY is constructed, the From header is parsed, the voicemail extension from the endpoint is substituted for the user, and the result placed in the Message-Account field in the body. When a subscribed NOTIFY is constructed, the subscription dialog local uri is parsed, the voicemail_extension from the aor (looked up from the subscription resource name) is substituted for the user, and the result placed in the Message-Account field in the body. If no voicemail extension was defined, the Message-Account field is not added to the NOTIFY body. mwi_subscribe_replaces_unsolicited: * Added mwi_subscribe_replaces_unsolicited to endpoint. The previous behavior was to reject a subscribe if a previous internal subscription for unsolicited MWI was found for the mailbox. That remains the default. However, if there are mailboxes also set on the aor and the client subscribes and mwi_subscribe_replaces_unsolicited is set, the existing internal subscription is removed and replaced with the external subscription. This allows an admin to configure mailboxes on both the endpoint and aor and allows the client to select which to use. ASTERISK-25865 #close Reported-by: Ross Beer Change-Id: Ic15a9415091760539c7134a5ba3dc4a6a1217cea --- .../1c688d9a003c_pjsip_voicemail_extension.py | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 contrib/ast-db-manage/config/versions/1c688d9a003c_pjsip_voicemail_extension.py (limited to 'contrib/ast-db-manage') diff --git a/contrib/ast-db-manage/config/versions/1c688d9a003c_pjsip_voicemail_extension.py b/contrib/ast-db-manage/config/versions/1c688d9a003c_pjsip_voicemail_extension.py new file mode 100644 index 000000000..781dca703 --- /dev/null +++ b/contrib/ast-db-manage/config/versions/1c688d9a003c_pjsip_voicemail_extension.py @@ -0,0 +1,31 @@ +"""pjsip voicemail extension + +Revision ID: 1c688d9a003c +Revises: 5813202e92be +Create Date: 2016-03-24 22:31:45.537895 + +""" + +# revision identifiers, used by Alembic. +revision = '1c688d9a003c' +down_revision = '5813202e92be' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + op.add_column('ps_globals', sa.Column('default_voicemail_extension', sa.String(40))) + op.add_column('ps_aors', sa.Column('voicemail_extension', sa.String(40))) + op.add_column('ps_endpoints', sa.Column('voicemail_extension', sa.String(40))) + op.add_column('ps_endpoints', sa.Column('mwi_subscribe_replaces_unsolicited', sa.Integer)) + + +def downgrade(): + with op.batch_alter_table('ps_globals') as batch_op: + batch_op.drop_column('default_voicemail_extension') + with op.batch_alter_table('ps_aors') as batch_op: + batch_op.drop_column('voicemail_extension') + with op.batch_alter_table('ps_endpoints') as batch_op: + batch_op.drop_column('voicemail_extension') + batch_op.drop_column('mwi_subscribe_replaces_unsolicited') -- cgit v1.2.3