]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add event for Valet Parking action exit
authorMichael Jerris <mike@jerris.com>
Thu, 15 Apr 2010 07:20:06 +0000 (03:20 -0400)
committerMichael Jerris <mike@jerris.com>
Thu, 15 Apr 2010 07:20:06 +0000 (03:20 -0400)
src/mod/applications/mod_valet_parking/mod_valet_parking.c

index 9aacdbd33f21777c47be4c5dee60a69378766473..430cd2f73e1b283261e3b6ae00bf29d7cde315c6 100644 (file)
@@ -287,6 +287,14 @@ SWITCH_STANDARD_APP(valet_parking_function)
                switch_mutex_lock(lot->mutex);
                switch_core_hash_delete(lot->hash, ext);
                switch_mutex_unlock(lot->mutex);
+
+               if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, VALET_EVENT) == SWITCH_STATUS_SUCCESS) {
+                       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Valet-Lot-Name", lot_name);
+                       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Valet-Extension", ext);
+                       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "exit");
+                       switch_channel_event_set_data(channel, event);
+                       switch_event_fire(&event);
+               }
        } else {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", VALET_APP_SYNTAX);
        }