[asterisk-commits] irroot: branch irroot/distrotech-customers-1.8 r323821 - /team/irroot/distrot...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 15 13:37:19 CDT 2011


Author: irroot
Date: Wed Jun 15 13:37:11 2011
New Revision: 323821

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=323821
Log:
Reworked Patch for ASTERISK-17866
Ensure MWI is sent only as a event/on subscription when subscribemwi = yes

Modified:
    team/irroot/distrotech-customers-1.8/channels/chan_sip.c

Modified: team/irroot/distrotech-customers-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-1.8/channels/chan_sip.c?view=diff&rev=323821&r1=323820&r2=323821
==============================================================================
--- team/irroot/distrotech-customers-1.8/channels/chan_sip.c (original)
+++ team/irroot/distrotech-customers-1.8/channels/chan_sip.c Wed Jun 15 13:37:11 2011
@@ -4886,7 +4886,9 @@
 					unref_peer(p, "Wrong type of realtime SIP endpoint");
 					return NULL;
 				}
-				sip_send_mwi_to_peer(p, NULL, 0);
+				if (!ast_test_flag(&p->flags[1], SIP_PAGE2_SUBSCRIBEMWIONLY)) {
+					sip_send_mwi_to_peer(p, NULL, 0);
+				}
 				break;
 			case FINDALLDEVICES:
 				break;
@@ -14377,7 +14379,9 @@
 	}
 	if (!res) {
 		ast_devstate_changed(AST_DEVICE_UNKNOWN, "SIP/%s", peer->name);
-		sip_send_mwi_to_peer(peer, NULL, 0);
+		if (!ast_test_flag(&peer->flags[1], SIP_PAGE2_SUBSCRIBEMWIONLY)) {
+			sip_send_mwi_to_peer(peer, NULL, 0);
+		}
 	}
 	if (res < 0) {
 		switch (res) {
@@ -23963,7 +23967,7 @@
 		}
 
 		p->subscribed = MWI_NOTIFICATION;
-		if (!ast_test_flag(&authpeer->flags[1], SIP_PAGE2_SUBSCRIBEMWIONLY)) {
+		if (ast_test_flag(&authpeer->flags[1], SIP_PAGE2_SUBSCRIBEMWIONLY)) {
 			add_peer_mwi_subs(authpeer);
 		}
 		if (authpeer->mwipvt && authpeer->mwipvt != p) {	/* Destroy old PVT if this is a new one */
@@ -24758,9 +24762,6 @@
 	/* Called with peerl lock, but releases it */
 	struct sip_pvt *p;
 	int newmsgs = 0, oldmsgs = 0;
-
-	if (ast_test_flag((&peer->flags[1]), SIP_PAGE2_SUBSCRIBEMWIONLY) && !peer->mwipvt)
-		return 0;
 
 	/* Do we have an IP address? If not, skip this peer */
 	if (ast_sockaddr_isnull(&peer->addr) && ast_sockaddr_isnull(&peer->defaddr))




More information about the asterisk-commits mailing list