]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_mwi: add better handling of solicited vs unsolicited subscriptions
authorKevin Harwell <kharwell@digium.com>
Fri, 23 Aug 2019 22:03:07 +0000 (17:03 -0500)
committerKevin Harwell <kharwell@digium.com>
Wed, 28 Aug 2019 23:22:19 +0000 (18:22 -0500)
commit172e183b9d1f02ac20ba571de1c6a49a3ad64d32
tree2b7309de1b57c2d6f06d0eb81f7e618537f23b0d
parent649003821eefd4f89f3b8b55f3576ab8c7823180
res_pjsip_mwi: add better handling of solicited vs unsolicited subscriptions

res_pjsip_mwi allows both solicited and unsolicited MWI subscription types.
While both can be set in the configuration for a given endpoint/aor, only
one is allowed. Precedence is given to unsolicited. Meaning if an endpoint/aor
is configured to allow both types then the solicited subscription is rejected
when it comes in. However, there is a configuration option to override that
behavior:

mwi_subscribe_replaces_unsolicited

When set to "yes" then when a solicited subscription comes in instead of
rejecting it Asterisk is suppose to replace the unsolicited one if it exists.
Prior to this patch there was a bug in Asterisk that allowed the solicted one
to be added, but did not remove the unsolicited. As a matter of fact a new
unsolicited subscription got added everytime a SIP register was received.
Over time this eventually could "flood" a phone with SIP notifies.

This patch fixes that behavior to now make it work as expected. If configured
to do so a solicited subscription now properly replaces the unsolicited one.
As well when an unsubscribe is received the unsolicited subscription is
restored. Logic was also put in to handle reloads, and any configuration changes
that might result from that. For instance, if a solicited subscription had
previously replaced an unsolicited one, but after reload it was configured to
not allow that then the solicited one needs to be shutdown, and the unsolicited
one added.

ASTERISK-28488

Change-Id: Iec2ec12d9431097e97ed5f37119963aee41af7b1
res/res_pjsip_mwi.c