Revision
17299
Author
mike
Date
2010-04-15 02:20:06 -0500 (Thu, 15 Apr 2010)

Log Message

add event for Valet Parking action exit

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/applications/mod_valet_parking/mod_valet_parking.c (17298 => 17299)


--- freeswitch/trunk/src/mod/applications/mod_valet_parking/mod_valet_parking.c	2010-04-15 02:54:59 UTC (rev 17298)
+++ freeswitch/trunk/src/mod/applications/mod_valet_parking/mod_valet_parking.c	2010-04-15 07:20:06 UTC (rev 17299)
@@ -287,6 +287,14 @@
 		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);
 	}