From ceffd56266f42fc83a2c4a6d6606fa702f9bbd6f Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Tue, 17 Feb 2009 17:38:47 +0000 Subject: [PATCH] Merged revisions 176557 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r176557 | russell | 2009-02-17 11:33:38 -0600 (Tue, 17 Feb 2009) | 12 lines Fix a race condition that caused device states to become incorrect for hints. The problem here is that the hint processing code was subscribed to the wrong event type. So, it started processing state for a hint too soon, before the device state cache had been updated. Also, fix a similar bug in app_queue, as it was also subscribed to the wrong event type. (closes issue #14461) Reported by: alecdavis ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@176559 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_queue.c | 2 +- main/pbx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/app_queue.c b/apps/app_queue.c index b6a5e2e088..6dfe45702e 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -6689,7 +6689,7 @@ static int load_module(void) ast_log(LOG_WARNING, "devicestate taskprocessor reference failed - devicestate notifications will not occur\n"); } - if (!(device_state_sub = ast_event_subscribe(AST_EVENT_DEVICE_STATE_CHANGE, device_state_cb, NULL, AST_EVENT_IE_END))) { + if (!(device_state_sub = ast_event_subscribe(AST_EVENT_DEVICE_STATE, device_state_cb, NULL, AST_EVENT_IE_END))) { res = -1; } diff --git a/main/pbx.c b/main/pbx.c index 46d7f152f2..6a62bb24d4 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -8546,7 +8546,7 @@ int load_pbx(void) /* Register manager application */ ast_manager_register2("ShowDialPlan", EVENT_FLAG_CONFIG | EVENT_FLAG_REPORTING, manager_show_dialplan, "List dialplan", mandescr_show_dialplan); - if (!(device_state_sub = ast_event_subscribe(AST_EVENT_DEVICE_STATE_CHANGE, device_state_cb, NULL, + if (!(device_state_sub = ast_event_subscribe(AST_EVENT_DEVICE_STATE, device_state_cb, NULL, AST_EVENT_IE_END))) { return -1; }