[asterisk-commits] mmichelson: branch certified-13.1 r430782 - in /certified/branches/13.1: ./ m...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 19 12:18:25 CST 2015


Author: mmichelson
Date: Mon Jan 19 12:18:23 2015
New Revision: 430782

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=430782
Log:
Call extension state callbacks at hint creation.

When a hint gets created, any subsequent device or presence
state changes result in extension status events getting sent
out to interested parties. However, at the time of hint creation,
no such event gets sent out, so watchers of extension state are
potentially left in the dark until the first state change after
hint creation.

Patch contributed by John Hardin (License #6512)
........

Merged revisions 430776 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    certified/branches/13.1/   (props changed)
    certified/branches/13.1/main/pbx.c

Propchange: certified/branches/13.1/
------------------------------------------------------------------------------
--- branch-13-merged (original)
+++ branch-13-merged Mon Jan 19 12:18:23 2015
@@ -1,1 +1,1 @@
-/branches/13:429128-429222,429224-429246,429352,429407,429409,429433,429477,429497,429519,429540,429571,429739,429741,429761,429829,430010,430034,430083-430084,430092,430200,430252,430664
+/branches/13:429128-429222,429224-429246,429352,429407,429409,429433,429477,429497,429519,429540,429571,429739,429741,429761,429829,430010,430034,430083-430084,430092,430200,430252,430664,430776

Modified: certified/branches/13.1/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/certified/branches/13.1/main/pbx.c?view=diff&rev=430782&r1=430781&r2=430782
==============================================================================
--- certified/branches/13.1/main/pbx.c (original)
+++ certified/branches/13.1/main/pbx.c Mon Jan 19 12:18:23 2015
@@ -5829,6 +5829,24 @@
 			ast_get_context_name(ast_get_extension_context(e)));
 	}
 
+	/* if not dynamic */
+	if (!(strstr(e->app, "${") && e->exten[0] == '_')) {
+		struct ast_state_cb *state_cb;
+		struct ao2_iterator cb_iter;
+
+		/* For general callbacks */
+		cb_iter = ao2_iterator_init(statecbs, 0);
+		for (; (state_cb = ao2_iterator_next(&cb_iter)); ao2_ref(state_cb, -1)) {
+			execute_state_callback(state_cb->change_cb,
+					ast_get_context_name(ast_get_extension_context(e)),
+					ast_get_extension_name(e),
+					state_cb->data,
+					AST_HINT_UPDATE_DEVICE,
+					hint_new,
+					NULL);
+		}
+		ao2_iterator_destroy(&cb_iter);
+	}
 	ao2_unlock(hints);
 	ao2_ref(hint_new, -1);
 




More information about the asterisk-commits mailing list