[Asterisk-code-review] res pjsip mwi: unsubscribe unsolicited MWI on deleting endpo... (asterisk[13])

George Joseph asteriskteam at digium.com
Tue Jun 13 07:11:08 CDT 2017


George Joseph has posted comments on this change. ( https://gerrit.asterisk.org/5802 )

Change subject: res_pjsip_mwi: unsubscribe unsolicited MWI on deleting endpoint last contact
......................................................................


Patch Set 1: Code-Review-1

(3 comments)

Cherry pick to 14 and master?

https://gerrit.asterisk.org/#/c/5802/1/res/res_pjsip_mwi.c
File res/res_pjsip_mwi.c:

https://gerrit.asterisk.org/#/c/5802/1/res/res_pjsip_mwi.c@1245
PS1, Line 1245: 	endpoint = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "endpoint", contact->endpoint_name);
Shouldn't contact->endpoint already be a pointer to the endpoint object?


https://gerrit.asterisk.org/#/c/5802/1/res/res_pjsip_mwi.c@1251
PS1, Line 1251: 	ao2_lock(unsolicited_mwi);
              : 	mwi_subs = ao2_find(unsolicited_mwi, contact->endpoint_name,
              : 		OBJ_SEARCH_KEY | OBJ_MULTIPLE | OBJ_NOLOCK | OBJ_UNLINK);
              : 	if (mwi_subs) {
              : 		for (; (mwi_sub = ao2_iterator_next(mwi_subs)); ao2_cleanup(mwi_sub)) {
              : 			unsubscribe(mwi_sub, NULL, 0);
              : 		}
              : 		ao2_iterator_destroy(mwi_subs);
              : 	}
              : 	ao2_unlock(unsolicited_mwi);
The same logic is in mwi_contact_added.  Can you re-use it?


https://gerrit.asterisk.org/#/c/5802/1/res/res_pjsip_mwi.c@1267
PS1, Line 1267: 	ao2_lock(unsolicited_mwi);
              : 	create_mwi_subscriptions_for_endpoint(endpoint, NULL, 0);
              : 	ao2_unlock(unsolicited_mwi);
              : }
I don't understand why you are re-creating the subscriptions again.



-- 
To view, visit https://gerrit.asterisk.org/5802
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I33e174e0b9dba0998927d16d6d100fda5c7254e0
Gerrit-Change-Number: 5802
Gerrit-PatchSet: 1
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Comment-Date: Tue, 13 Jun 2017 12:11:08 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170613/5f3d7a1d/attachment.html>


More information about the asterisk-code-review mailing list