[asterisk-commits] kmoore: branch kmoore/stasis-mwi r382383 - in /team/kmoore/stasis-mwi: apps/ ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 4 13:01:07 CST 2013


Author: kmoore
Date: Mon Mar  4 13:01:03 2013
New Revision: 382383

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=382383
Log:
Be rid of old-style MWI event generation

Modified:
    team/kmoore/stasis-mwi/apps/app_minivm.c
    team/kmoore/stasis-mwi/apps/app_voicemail.c
    team/kmoore/stasis-mwi/channels/chan_dahdi.c
    team/kmoore/stasis-mwi/channels/chan_sip.c
    team/kmoore/stasis-mwi/res/res_jabber.c
    team/kmoore/stasis-mwi/res/res_xmpp.c

Modified: team/kmoore/stasis-mwi/apps/app_minivm.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/apps/app_minivm.c?view=diff&rev=382383&r1=382382&r2=382383
==============================================================================
--- team/kmoore/stasis-mwi/apps/app_minivm.c (original)
+++ team/kmoore/stasis-mwi/apps/app_minivm.c Mon Mar  4 13:01:03 2013
@@ -2013,7 +2013,6 @@
  * \brief Queue a message waiting event */
 static void queue_mwi_event(const char *mbx, const char *ctx, int urgent, int new, int old)
 {
-	struct ast_event *event;
 	char *mailbox, *context;
 	struct ast_str *uniqueid = ast_str_alloca(128);
 
@@ -2024,16 +2023,6 @@
 	}
 	ast_str_set(&uniqueid, 0, "%s@%s", mbx, ctx);
 
-	if (!(event = ast_event_new(AST_EVENT_MWI,
-			AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox,
-			AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, context,
-			AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_UINT, (new+urgent),
-			AST_EVENT_IE_OLDMSGS, AST_EVENT_IE_PLTYPE_UINT, old,
-			AST_EVENT_IE_END))) {
-		return;
-	}
-
-	ast_event_queue_and_cache(event);
 	stasis_publish_mwi_state(ast_str_buffer(uniqueid), mailbox, context, new + urgent, old);
 }
 

Modified: team/kmoore/stasis-mwi/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/apps/app_voicemail.c?view=diff&rev=382383&r1=382382&r2=382383
==============================================================================
--- team/kmoore/stasis-mwi/apps/app_voicemail.c (original)
+++ team/kmoore/stasis-mwi/apps/app_voicemail.c Mon Mar  4 13:01:03 2013
@@ -7719,25 +7719,15 @@
 
 static void queue_mwi_event(const char *box, int urgent, int new, int old)
 {
-	struct ast_event *event;
 	char *mailbox, *context;
 
 	/* Strip off @default */
 	context = mailbox = ast_strdupa(box);
 	strsep(&context, "@");
-	if (ast_strlen_zero(context))
+	if (ast_strlen_zero(context)) {
 		context = "default";
-
-	if (!(event = ast_event_new(AST_EVENT_MWI,
-			AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox,
-			AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, context,
-			AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_UINT, (new+urgent),
-			AST_EVENT_IE_OLDMSGS, AST_EVENT_IE_PLTYPE_UINT, old,
-			AST_EVENT_IE_END))) {
-		return;
-	}
-
-	ast_event_queue_and_cache(event);
+	}
+
 	stasis_publish_mwi_state(box, mailbox, context, new + urgent, old);
 }
 

Modified: team/kmoore/stasis-mwi/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/channels/chan_dahdi.c?view=diff&rev=382383&r1=382382&r2=382383
==============================================================================
--- team/kmoore/stasis-mwi/channels/chan_dahdi.c (original)
+++ team/kmoore/stasis-mwi/channels/chan_dahdi.c Mon Mar  4 13:01:03 2013
@@ -3753,7 +3753,6 @@
 static void notify_message(char *mailbox_full, int thereornot)
 {
 	char s[sizeof(mwimonitornotify) + 80];
-	struct ast_event *event;
 	char *mailbox, *context;
 
 	/* Strip off @default */
@@ -3762,16 +3761,6 @@
 	if (ast_strlen_zero(context))
 		context = "default";
 
-	if (!(event = ast_event_new(AST_EVENT_MWI,
-			AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox,
-			AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, context,
-			AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_UINT, thereornot,
-			AST_EVENT_IE_OLDMSGS, AST_EVENT_IE_PLTYPE_UINT, thereornot,
-			AST_EVENT_IE_END))) {
-		return;
-	}
-
-	ast_event_queue_and_cache(event);
 	stasis_publish_mwi_state(mailbox_full, mailbox, context, thereornot, thereornot);
 
 	if (!ast_strlen_zero(mailbox) && !ast_strlen_zero(mwimonitornotify)) {

Modified: team/kmoore/stasis-mwi/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/channels/chan_sip.c?view=diff&rev=382383&r1=382382&r2=382383
==============================================================================
--- team/kmoore/stasis-mwi/channels/chan_sip.c (original)
+++ team/kmoore/stasis-mwi/channels/chan_sip.c Mon Mar  4 13:01:03 2013
@@ -24620,20 +24620,11 @@
 			int new_msgs = atoi(new);
 			int old_msgs = atoi(old);
 			char *context = "SIP_Remote";
-			struct ast_event *event;
 			struct ast_str *uniqueid = ast_str_alloca(128);
 
 			ast_str_set(&uniqueid, 0, "%s@%s", mailbox, context);
 			stasis_publish_mwi_state(ast_str_buffer(uniqueid), mailbox, context, new_msgs, old_msgs);
 
-			if ((event = ast_event_new(AST_EVENT_MWI,
-						   AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox,
-						   AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, context,
-						   AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_UINT, new_msgs,
-						   AST_EVENT_IE_OLDMSGS, AST_EVENT_IE_PLTYPE_UINT, old_msgs,
-						   AST_EVENT_IE_END))) {
-				ast_event_queue_and_cache(event);
-			}
 			transmit_response(p, "200 OK", req);
 		} else {
 			transmit_response(p, "489 Bad event", req);

Modified: team/kmoore/stasis-mwi/res/res_jabber.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/res/res_jabber.c?view=diff&rev=382383&r1=382382&r2=382383
==============================================================================
--- team/kmoore/stasis-mwi/res/res_jabber.c (original)
+++ team/kmoore/stasis-mwi/res/res_jabber.c Mon Mar  4 13:01:03 2013
@@ -3375,14 +3375,7 @@
 
 		stasis_publish_mwi_state_full(uniqueid, item_id, context, newmsgs, oldmsgs, &pubsub_eid);
 
-		if (!(event = ast_event_new(AST_EVENT_MWI, AST_EVENT_IE_MAILBOX,
-			AST_EVENT_IE_PLTYPE_STR, item_id, AST_EVENT_IE_CONTEXT,
-			AST_EVENT_IE_PLTYPE_STR, context, AST_EVENT_IE_OLDMSGS,
-			AST_EVENT_IE_PLTYPE_UINT, oldmsgs, AST_EVENT_IE_NEWMSGS,
-			AST_EVENT_IE_PLTYPE_UINT, newmsgs, AST_EVENT_IE_EID, AST_EVENT_IE_PLTYPE_RAW,
-			&pubsub_eid, sizeof(pubsub_eid), AST_EVENT_IE_END))) {
-			return IKS_FILTER_EAT;
-		}
+		return IKS_FILTER_EAT;
 	} else {
 		ast_debug(1, "Don't know how to handle PubSub event of type %s\n",
 			iks_name(item_content));

Modified: team/kmoore/stasis-mwi/res/res_xmpp.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/res/res_xmpp.c?view=diff&rev=382383&r1=382382&r2=382383
==============================================================================
--- team/kmoore/stasis-mwi/res/res_xmpp.c (original)
+++ team/kmoore/stasis-mwi/res/res_xmpp.c Mon Mar  4 13:01:03 2013
@@ -1490,14 +1490,7 @@
 
 		stasis_publish_mwi_state_full(uniqueid, item_id, context, newmsgs, oldmsgs, &pubsub_eid);
 
-		if (!(event = ast_event_new(AST_EVENT_MWI, AST_EVENT_IE_MAILBOX,
-					    AST_EVENT_IE_PLTYPE_STR, item_id, AST_EVENT_IE_CONTEXT,
-					    AST_EVENT_IE_PLTYPE_STR, context, AST_EVENT_IE_OLDMSGS,
-					    AST_EVENT_IE_PLTYPE_UINT, oldmsgs, AST_EVENT_IE_NEWMSGS,
-					    AST_EVENT_IE_PLTYPE_UINT, newmsgs, AST_EVENT_IE_EID, AST_EVENT_IE_PLTYPE_RAW,
-					    &pubsub_eid, sizeof(pubsub_eid), AST_EVENT_IE_END))) {
-			return IKS_FILTER_EAT;
-		}
+		return IKS_FILTER_EAT;
 	} else {
 		ast_debug(1, "Don't know how to handle PubSub event of type %s\n",
 			  iks_name(item_content));




More information about the asterisk-commits mailing list