Index: main/devicestate.c =================================================================== --- main/devicestate.c (revision 81644) +++ main/devicestate.c (working copy) @@ -304,11 +304,7 @@ ast_log(LOG_DEBUG, "Notification of state change to be queued on device/channel %s\n", buf); device = buf; - - tmp = strrchr(device, '-'); - if (tmp) - *tmp = '\0'; - + if (change_thread == AST_PTHREADT_NULL || !(change = ast_calloc(1, sizeof(*change) + strlen(device)))) { /* we could not allocate a change struct, or */ /* there is no background thread, so process the change now */ @@ -324,6 +320,11 @@ AST_LIST_UNLOCK(&state_changes); } + if ((tmp = strrchr(device, '-'))) { + *tmp = '\0'; + __ast_device_state_changed_literal(device); + } + return 1; }