]> 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 21:24:50 +0000 (16:24 -0500)
committerKevin Harwell <kharwell@digium.com>
Wed, 28 Aug 2019 23:21:44 +0000 (18:21 -0500)
commitaf12d36f7ead1d283974d874765e46965d718c4e
tree84075c57f58c19aeea26d81484bcba067cbdb937
parent0e747da168f131524107757c39baf7a4ab9106b4
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