[Asterisk-code-review] res_pjsip_mwi.c: Fix multiple NOTIFYs when mwi_subscribe_replaces_uns... (...asterisk[16])

Christian Savinovich asteriskteam at digium.com
Fri Jul 26 16:44:42 CDT 2019


Hello Friendly Automation, George Joseph, Joshua Colp, 

I'd like you to reexamine a change. Please visit

    https://gerrit.asterisk.org/c/asterisk/+/11627

to look at the new patch set (#5).

Change subject: res_pjsip_mwi.c: Fix multiple NOTIFYs when mwi_subscribe_replaces_unsolicited
......................................................................

res_pjsip_mwi.c: Fix multiple NOTIFYs when mwi_subscribe_replaces_unsolicited

Fixes an bug whereby multiple NOTIFYs were replied back to endpoint when a
REGISTER was received.  This occurred when parameter
mwi_subscribe_replaces_unsolicited is set to yes in pjsip.conf.

The underlying problem here is that the
endpoint_receives_unsolicited_mwi_for_mailbox() function in res/res_pjsip_mwi.c
is sort of an overloaded function. When invoked from mwi_validate_for_aor() you
DO want to have the subscribe_replaces_unsolicited() logic occur whereby it
unsubscribes from stasis. When invoked from
create_mwi_subscriptions_for_endpoint you DO NOT want to have the
subscribe_replaces_unsolicited logic occur.The function should have a parameter
added to it which determines whether the logic is invoked or not.

The bug itself occurs because there are multiple mwi_subscription structures
for the mailbox, the logic which sends the NOTIFY when a REGISTER occurs goes
through all looking for mwi_subscription structures with the AOR. It finds
these multiple structures, calculates message count on them (despite having
no stasis subscriptions), and sends a NOTIFY.

Note: This fix does not restore back unsolicted NOTIFYs in the event
all subscriptions on a given AOR go away.  It was decided to create
a new issue for that.

ASTERISK-28488

Change-Id: I8f77c33b9b4d374d510aa5ecd4f700a77107d8d4
---
M res/res_pjsip_mwi.c
1 file changed, 19 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/27/11627/5
-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11627
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I8f77c33b9b4d374d510aa5ecd4f700a77107d8d4
Gerrit-Change-Number: 11627
Gerrit-PatchSet: 5
Gerrit-Owner: Christian Savinovich <csavinovich at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-MessageType: newpatchset
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190726/b625474d/attachment.html>


More information about the asterisk-code-review mailing list