--- app_dial.c.orig 2006-04-18 18:26:55.981040757 -0500 +++ app_dial.c 2006-04-18 18:39:25.259894158 -0500 @@ -368,6 +368,14 @@ dst->uniqueid); } +static void senddialendevent(const struct ast_channel *src, const char *dialstatus) +{ + manager_event(EVENT_FLAG_CALL, "EndDial", + "Channel: %s\r\n" + "DialStatus: %s\r\n", + src->name, dialstatus); +} + static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_localuser *outgoing, int *to, struct ast_flags *peerflags, int *sentringing, char *status, size_t statussize, int busystart, int nochanstart, int congestionstart, int priority_jump, int *result) { struct dial_localuser *o; @@ -1605,6 +1613,7 @@ } hanguptree(outgoing, NULL); pbx_builtin_setvar_helper(chan, "DIALSTATUS", status); + senddialendevent(chan, status); if (option_debug) ast_log(LOG_DEBUG, "Exiting with DIALSTATUS=%s.\n", status);