Index: asterisk/apps/app_dial.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_dial.c,v retrieving revision 1.94.2.4 diff -u -r1.94.2.4 app_dial.c --- asterisk/apps/app_dial.c 29 Jan 2005 06:46:05 -0000 1.94.2.4 +++ asterisk/apps/app_dial.c 9 Feb 2005 22:28:06 -0000 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -134,6 +135,18 @@ #define AST_MAX_WATCHERS 256 +static void senddialevent(struct ast_channel *src, struct ast_channel *dst) +{ + manager_event(EVENT_FLAG_CALL, "Dial", + "Source: %s\r\n" + "Destination: %s\r\n" + "CallerID: %s\r\n" + "SrcUniqueID: %s\r\n" + "DestUniqueID: %s\r\n", + src->name, dst->name, src->callerid ? src->callerid : "", + src->uniqueid, dst->uniqueid); +} + static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localuser *outgoing, int *to, int *allowredir_in, int *allowredir_out, int *allowdisconnect_in, int *allowdisconnect_out, int *sentringing, char *status, size_t statussize) { struct localuser *o; @@ -282,6 +295,7 @@ o->chan = NULL; numnochan++; } else { + senddialevent(in, o->chan); /* After calling, set callerid to extension */ ast_set_callerid(o->chan, ast_strlen_zero(in->macroexten) ? in->exten : in->macroexten, 0); } @@ -333,6 +347,7 @@ ast_verbose( VERBOSE_PREFIX_3 "%s is ringing\n", o->chan->name); if (!(*sentringing) && !outgoing->musiconhold) { ast_indicate(in, AST_CONTROL_RINGING); + senddialevent(in, o->chan); (*sentringing)++; } break;