aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-30 23:11:55 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-30 23:11:55 +0000
commit2fad9467dc89be9d6bbe0dccb94149e15633f4bd (patch)
treea7953888b5fc27a0b4bfaf461ecace0e3f27eaf0
parent72b0ad773c78b743cdb19b39627bc7315e33ac0a (diff)
These changes submitted by moy via bug 6992, to add a Dial 'End' event to asterisk. I include some changes to astman to cover other events that have been added.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@46541 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_dial.c11
-rw-r--r--utils/astman.c2
2 files changed, 13 insertions, 0 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 95bbc4dc0..a09d8485b 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -374,6 +374,7 @@ static const char *get_cid_name(char *name, int namelen, struct ast_channel *cha
static void senddialevent(struct ast_channel *src, struct ast_channel *dst)
{
manager_event(EVENT_FLAG_CALL, "Dial",
+ "SubEvent: Begin\r\n"
"Source: %s\r\n"
"Destination: %s\r\n"
"CallerIDNum: %s\r\n"
@@ -385,6 +386,15 @@ static void senddialevent(struct ast_channel *src, struct ast_channel *dst)
dst->uniqueid);
}
+static void senddialendevent(const struct ast_channel *src, const char *dialstatus)
+{
+ manager_event(EVENT_FLAG_CALL, "Dial",
+ "SubEvent: End\r\n"
+ "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)
{
int numbusy = busystart;
@@ -1635,6 +1645,7 @@ out:
ast_channel_early_bridge(chan, NULL);
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);
diff --git a/utils/astman.c b/utils/astman.c
index 5ce0d15ef..d3bbef818 100644
--- a/utils/astman.c
+++ b/utils/astman.c
@@ -226,6 +226,8 @@ static struct event {
{ "Unlink", event_ignore },
{ "StatusComplete", event_ignore },
{ "Dial", event_ignore },
+ { "PeerStatus", event_ignore },
+ { "MessageWaiting", event_ignore },
{ "Newcallerid", event_ignore }
};