--- asterisk-1.2.17/channel.c 2007-02-25 07:38:03.000000000 -0700 +++ mod-asterisk-1.2.17/channel.c 2007-06-13 09:30:26.000000000 -0600 @@ -527,12 +527,20 @@ /* If shutting down, don't allocate any new channels */ if (shutting_down) { ast_log(LOG_WARNING, "Channel allocation failed: Refusing due to active shutdown\n"); + manager_event(EVENT_FLAG_SYSTEM, "CHAN_FAIL", + "Cause: SHUTDOWN\r\n" + "Cause-txt: Channel allocation failed: Refusing due to active shutdown\r\n" + ); return NULL; } tmp = malloc(sizeof(struct ast_channel)); if (!tmp) { ast_log(LOG_WARNING, "Channel allocation failed: Out of memory\n"); + manager_event(EVENT_FLAG_SYSTEM, "CHAN_FAIL", + "Cause: OOM\r\n" + "Cause-txt: Channel allocation failed: Out of memory.\r\n" + ); return NULL; } @@ -540,6 +548,10 @@ tmp->sched = sched_context_create(); if (!tmp->sched) { ast_log(LOG_WARNING, "Channel allocation failed: Unable to create schedule context\n"); + manager_event(EVENT_FLAG_SYSTEM, "CHAN_FAIL", + "Cause: SCC_FAIL\r\n" + "Cause-txt: Channel allocation failed: Unable to create schedule context\r\n" + ); free(tmp); return NULL; }