From 2c0eaac33246569f4f9b55e55a47e6e8be47146f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 21 Aug 2009 22:29:44 +0000 Subject: [PATCH] add record_start and record_stop events git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14591 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/esl/php/esl_wrap.cpp | 70 ++++++++++++++++---------------- libs/esl/ruby/esl_wrap.cpp | 2 +- libs/esl/src/esl_event.c | 2 + libs/esl/src/include/esl_event.h | 2 + src/include/switch_types.h | 2 + src/switch_channel.c | 2 + src/switch_event.c | 2 + src/switch_ivr_async.c | 12 ++++++ src/switch_ivr_play_say.c | 13 +++++- 9 files changed, 70 insertions(+), 37 deletions(-) diff --git a/libs/esl/php/esl_wrap.cpp b/libs/esl/php/esl_wrap.cpp index 2f35129ca3..bb7aa57edf 100644 --- a/libs/esl/php/esl_wrap.cpp +++ b/libs/esl/php/esl_wrap.cpp @@ -1091,7 +1091,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialized_string_set) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; @@ -1159,7 +1159,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_mine_set) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/ convert_to_long_ex(args[1]); arg2 = (int) Z_LVAL_PP(args[1]); /*@SWIG@*/; @@ -1213,13 +1213,13 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_0) { WRONG_PARAM_COUNT; - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[0]); arg1 = (char *) Z_STRVAL_PP(args[0]); /*@SWIG@*/; if(arg_count > 1) { - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; @@ -1254,7 +1254,7 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLevent__SWIG_1) { } } if(arg_count > 1) { - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/ convert_to_long_ex(args[1]); arg2 = (int) Z_LVAL_PP(args[1]); /*@SWIG@*/; @@ -1384,7 +1384,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_serialize) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); if(arg_count > 1) { - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; @@ -1460,7 +1460,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_getHeader) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; @@ -1557,7 +1557,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_addBody) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; @@ -1591,13 +1591,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_addHeader) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[2]); arg3 = (char *) Z_STRVAL_PP(args[2]); /*@SWIG@*/; @@ -1630,7 +1630,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLevent_delHeader) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; @@ -1718,19 +1718,19 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_0) { } - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[0]); arg1 = (char *) Z_STRVAL_PP(args[0]); /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[2]); arg3 = (char *) Z_STRVAL_PP(args[2]); /*@SWIG@*/; @@ -1756,7 +1756,7 @@ ZEND_NAMED_FUNCTION(_wrap_new_ESLconnection__SWIG_1) { } - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/ convert_to_long_ex(args[0]); arg1 = (int) Z_LVAL_PP(args[0]); /*@SWIG@*/; @@ -1917,7 +1917,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_send) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; @@ -1950,7 +1950,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_sendRecv) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; @@ -1986,13 +1986,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_api) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; if(arg_count > 2) { - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[2]); arg3 = (char *) Z_STRVAL_PP(args[2]); /*@SWIG@*/; @@ -2029,13 +2029,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_bgapi) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; if(arg_count > 2) { - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[2]); arg3 = (char *) Z_STRVAL_PP(args[2]); /*@SWIG@*/; @@ -2127,7 +2127,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_recvEventTimed) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/ convert_to_long_ex(args[1]); arg2 = (int) Z_LVAL_PP(args[1]); /*@SWIG@*/; @@ -2161,13 +2161,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_filter) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[2]); arg3 = (char *) Z_STRVAL_PP(args[2]); /*@SWIG@*/; @@ -2201,13 +2201,13 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_events) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[2]); arg3 = (char *) Z_STRVAL_PP(args[2]); /*@SWIG@*/; @@ -2244,20 +2244,20 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_execute) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; if(arg_count > 2) { - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[2]); arg3 = (char *) Z_STRVAL_PP(args[2]); /*@SWIG@*/; } if(arg_count > 3) { - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[3]); arg4 = (char *) Z_STRVAL_PP(args[3]); /*@SWIG@*/; @@ -2295,20 +2295,20 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_executeAsync) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; if(arg_count > 2) { - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[2]); arg3 = (char *) Z_STRVAL_PP(args[2]); /*@SWIG@*/; } if(arg_count > 3) { - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[3]); arg4 = (char *) Z_STRVAL_PP(args[3]); /*@SWIG@*/; @@ -2342,7 +2342,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setAsyncExecute) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; @@ -2375,7 +2375,7 @@ ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setEventLock) { } if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL"); - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,26,CONVERT_STRING_IN@*/ convert_to_string_ex(args[1]); arg2 = (char *) Z_STRVAL_PP(args[1]); /*@SWIG@*/; @@ -2426,7 +2426,7 @@ ZEND_NAMED_FUNCTION(_wrap_eslSetLogLevel) { } - /*@SWIG:/usr/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/ + /*@SWIG:/usr/local/share/swig/1.3.35/php4/utils.i,7,CONVERT_INT_IN@*/ convert_to_long_ex(args[0]); arg1 = (int) Z_LVAL_PP(args[0]); /*@SWIG@*/; diff --git a/libs/esl/ruby/esl_wrap.cpp b/libs/esl/ruby/esl_wrap.cpp index 97145c035f..4daa978f93 100644 --- a/libs/esl/ruby/esl_wrap.cpp +++ b/libs/esl/ruby/esl_wrap.cpp @@ -1902,7 +1902,7 @@ SWIG_ruby_failed(void) } -/*@SWIG:/usr/share/swig/1.3.35/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/ +/*@SWIG:/usr/local/share/swig/1.3.35/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args) { VALUE obj = args[0]; diff --git a/libs/esl/src/esl_event.c b/libs/esl/src/esl_event.c index b5c71edfb8..0d19bb704b 100644 --- a/libs/esl/src/esl_event.c +++ b/libs/esl/src/esl_event.c @@ -126,6 +126,8 @@ static const char *EVENT_NAMES[] = { "RECV_INFO", "CALL_SECURE", "NAT", + "RECORD_START", + "RECORD_STOP", "ALL" }; diff --git a/libs/esl/src/include/esl_event.h b/libs/esl/src/include/esl_event.h index fef009843c..d640b6a73e 100644 --- a/libs/esl/src/include/esl_event.h +++ b/libs/esl/src/include/esl_event.h @@ -114,6 +114,8 @@ typedef enum { ESL_EVENT_RECV_INFO, ESL_EVENT_CALL_SECURE, ESL_EVENT_NAT, + ESL_EVENT_RECORD_START, + ESL_EVENT_RECORD_STOP, ESL_EVENT_ALL } esl_event_types_t; diff --git a/src/include/switch_types.h b/src/include/switch_types.h index f71035d341..69d1072d8f 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -1280,6 +1280,8 @@ typedef enum { SWITCH_EVENT_RECV_INFO, SWITCH_EVENT_CALL_SECURE, SWITCH_EVENT_NAT, + SWITCH_EVENT_RECORD_START, + SWITCH_EVENT_RECORD_STOP, SWITCH_EVENT_ALL } switch_event_types_t; diff --git a/src/switch_channel.c b/src/switch_channel.c index 377dff7b86..99759e6c26 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -1365,6 +1365,8 @@ SWITCH_DECLARE(void) switch_channel_event_set_extended_data(switch_channel_t *ch event->event_id == SWITCH_EVENT_CHANNEL_EXECUTE_COMPLETE || event->event_id == SWITCH_EVENT_SESSION_HEARTBEAT || event->event_id == SWITCH_EVENT_API || + event->event_id == SWITCH_EVENT_RECORD_START || + event->event_id == SWITCH_EVENT_RECORD_STOP || event->event_id == SWITCH_EVENT_CUSTOM ) { diff --git a/src/switch_event.c b/src/switch_event.c index f327af7a74..ef5c02845a 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -180,6 +180,8 @@ static char *EVENT_NAMES[] = { "RECV_INFO", "CALL_SECURE", "NAT", + "RECORD_START", + "RECORD_STOP", "ALL" }; diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index 327d804a13..5d33049f62 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -432,9 +432,16 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s switch_core_session_t *session = switch_core_media_bug_get_session(bug); switch_channel_t *channel = switch_core_session_get_channel(session); struct record_helper *rh = (struct record_helper *) user_data; + switch_event_t *event; + switch (type) { case SWITCH_ABC_TYPE_INIT: + if (switch_event_create(&event, SWITCH_EVENT_RECORD_START) == SWITCH_STATUS_SUCCESS) { + switch_channel_event_set_data(channel, event); + switch_event_fire(&event); + } + break; case SWITCH_ABC_TYPE_CLOSE: { @@ -444,6 +451,11 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Stop recording file %s\n", rh->file); switch_channel_set_private(channel, rh->file, NULL); + if (switch_event_create(&event, SWITCH_EVENT_RECORD_STOP) == SWITCH_STATUS_SUCCESS) { + switch_channel_event_set_data(channel, event); + switch_event_fire(&event); + } + if (rh->fh) { if (switch_channel_test_flag(channel, CF_ANSWERED) || !switch_core_media_bug_test_flag(bug, SMBF_RECORD_ANSWER_REQ)) { switch_size_t len; diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index fb365bce14..380049bf26 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -393,7 +393,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se switch_codec_implementation_t read_impl = {0}; switch_frame_t write_frame = { 0 }; unsigned char write_buf[SWITCH_RECOMMENDED_BUFFER_SIZE] = { 0 }; - + switch_event_t *event; switch_core_session_get_read_impl(session, &read_impl); @@ -575,6 +575,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se } } + + if (switch_event_create(&event, SWITCH_EVENT_RECORD_START) == SWITCH_STATUS_SUCCESS) { + switch_channel_event_set_data(channel, event); + switch_event_fire(&event); + } + for (;;) { switch_size_t len; @@ -685,6 +691,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se } + if (switch_event_create(&event, SWITCH_EVENT_RECORD_STOP) == SWITCH_STATUS_SUCCESS) { + switch_channel_event_set_data(channel, event); + switch_event_fire(&event); + } + if (waste_resources) { switch_core_codec_destroy(&write_codec); }