[asterisk-commits] oej: branch group/pinana-publish-1.4 r297585 - /team/group/pinana-publish-1.4...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Dec 5 13:19:36 CST 2010


Author: oej
Date: Sun Dec  5 13:19:30 2010
New Revision: 297585

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=297585
Log:
Adding mechanics or scheduler in the presence thread

Modified:
    team/group/pinana-publish-1.4/channels/chan_sip.c

Modified: team/group/pinana-publish-1.4/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pinana-publish-1.4/channels/chan_sip.c?view=diff&rev=297585&r1=297584&r2=297585
==============================================================================
--- team/group/pinana-publish-1.4/channels/chan_sip.c (original)
+++ team/group/pinana-publish-1.4/channels/chan_sip.c Sun Dec  5 13:19:30 2010
@@ -10149,11 +10149,12 @@
 static void *device_state_thread(void *data)
 {
 	struct statechange *sc = NULL;
+	int waiting;
 
 	/* Initializing this thread */
 	if (!(pres_sched = sched_context_create())) {
-		ast_log(LOG_ERROR, "Unable to create scheduler context\n");
-		return AST_MODULE_LOAD_FAILURE;
+		ast_log(LOG_ERROR, "Unable to create presence scheduler context. SIP Subscribe/Publish thread FAILED.\n");
+		return NULL;
 	}
 
 
@@ -10176,6 +10177,14 @@
 		}
 
 		handle_statechange(sc);
+
+		waiting = ast_sched_wait(pres_sched);
+		if (waiting > 0) {
+			int res = ast_sched_runq(pres_sched);
+			if (option_debug > 2) {
+				ast_log(LOG_DEBUG, "Presence scheduler ran %d items\n", res);
+			}
+		}
 
 		free(sc);
 		sc = NULL;




More information about the asterisk-commits mailing list