From: Michael Jerris Date: Thu, 7 Sep 2006 22:39:40 +0000 (+0000) Subject: Changed SWITCH_EVENT_CHANNEL_STATE to SWITCH_EVENT_CHANNEL_HANGUP on the hangup state... X-Git-Tag: v1.0-beta1~2206 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2767a7d002d2767e2c70416d0b40bc83ba3db4ea;p=thirdparty%2Ffreeswitch.git Changed SWITCH_EVENT_CHANNEL_STATE to SWITCH_EVENT_CHANNEL_HANGUP on the hangup state change, add Hangup-Cause event header. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2563 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/switch_channel.c b/src/switch_channel.c index adf2ce1343..dbf6c97374 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -859,7 +859,8 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_chan switch_log_printf(SWITCH_CHANNEL_ID_LOG, (char *) file, func, line, SWITCH_LOG_NOTICE, "Hangup %s [%s] [%s]\n", channel->name, state_names[last_state], switch_channel_cause2str(channel->hangup_cause)); - if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_STATE) == SWITCH_STATUS_SUCCESS) { + if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_HANGUP) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Hangup-Cause", switch_channel_cause2str(channel->hangup_cause)); switch_channel_event_set_data(channel, event); switch_event_fire(&event); }