]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add record_start and record_stop events
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 21 Aug 2009 22:29:44 +0000 (22:29 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 21 Aug 2009 22:29:44 +0000 (22:29 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14591 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/esl/php/esl_wrap.cpp
libs/esl/ruby/esl_wrap.cpp
libs/esl/src/esl_event.c
libs/esl/src/include/esl_event.h
src/include/switch_types.h
src/switch_channel.c
src/switch_event.c
src/switch_ivr_async.c
src/switch_ivr_play_say.c

index 2f35129ca36b7a4fe647d499c6a0cb7d95257b83..bb7aa57edf8fc7351c947c4c3a83c050445f2604 100644 (file)
@@ -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@*/;
index 97145c035f1874623fd7f0f52be80f60ede15c68..4daa978f9366b95b87278d09eda8cb2e9b0b4824 100644 (file)
@@ -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];
index b5c71edfb86902ce892f4a5d4a32555483433ced..0d19bb704b834fa39306d1607f95d91e94cd0651 100644 (file)
@@ -126,6 +126,8 @@ static const char *EVENT_NAMES[] = {
        "RECV_INFO",
        "CALL_SECURE",
        "NAT",
+       "RECORD_START",
+       "RECORD_STOP",
        "ALL"
 };
 
index fef009843cedb48062f0599d2614f0451a5290fc..d640b6a73e77f503c8899cc9f37ea1f592c36772 100644 (file)
@@ -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;
 
index f71035d3418029f33a31b20357e6a2abee559c62..69d1072d8f5e041fb2fc29c0670059717204f81e 100644 (file)
@@ -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;
 
index 377dff7b86b99fc0efb207e69b96dfd675663974..99759e6c26ae9ce2ddc436d93d44d9360d1cea01 100644 (file)
@@ -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
                ) {
 
index f327af7a74a478e1e6e46f495622e0a5d5e43d2d..ef5c02845a8868e914988d674f5455202c7d2fc1 100644 (file)
@@ -180,6 +180,8 @@ static char *EVENT_NAMES[] = {
        "RECV_INFO",
        "CALL_SECURE",
        "NAT",
+       "RECORD_START",
+       "RECORD_STOP",
        "ALL"
 };
 
index 327d804a131bec1ede202a4da1bf07b6dfa2a790..5d33049f62c05edd5563f2006f836b2422ac6cf1 100644 (file)
@@ -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;
index fb365bce14df465cfbdba6c4225faa9925af010b..380049bf26c511ebaddee56a0c195c0475bbfbe9 100644 (file)
@@ -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);
        }