Revision
16483
Author
brian
Date
2010-01-23 12:43:38 -0600 (Sat, 23 Jan 2010)

Log Message

 MODENDP-284 

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (16482 => 16483)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	2010-01-23 18:37:11 UTC (rev 16482)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	2010-01-23 18:43:38 UTC (rev 16483)
@@ -2512,6 +2512,7 @@
 	char *profile_name = argv[0];
 	const char *err;
 	switch_xml_t xml_root;
+	switch_event_t *event;
 
 	if (argc < 2) {
 		stream->write_function(stream, "Invalid Args!\n");
@@ -2554,6 +2555,10 @@
 			sofia_glue_del_gateway(gateway_ptr);
 			sofia_reg_release_gateway(gateway_ptr);
 			stream->write_function(stream, "+OK gateway marked for deletion.\n");
+			if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_GATEWAY_DEL) == SWITCH_STATUS_SUCCESS) {
+				switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Gateway", argv[2]);
+				switch_event_fire(&event);
+			}
 		} else {
 			stream->write_function(stream, "-ERR no such gateway.\n");
 		}

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (16482 => 16483)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	2010-01-23 18:37:11 UTC (rev 16482)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	2010-01-23 18:43:38 UTC (rev 16483)
@@ -81,6 +81,8 @@
 #define MY_EVENT_GATEWAY_STATE "sofia::gateway_state"
 #define MY_EVENT_NOTIFY_REFER "sofia::notify_refer"
 #define MY_EVENT_REINVITE "sofia::reinvite"
+#define MY_EVENT_GATEWAY_ADD "sofia::gateway_add"
+#define MY_EVENT_GATEWAY_DEL "sofia::gateway_delete"
 
 #define MULTICAST_EVENT "multicast::event"
 #define SOFIA_REPLACES_HEADER "_sofia_replaces_"

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c (16482 => 16483)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	2010-01-23 18:37:11 UTC (rev 16482)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	2010-01-23 18:43:38 UTC (rev 16483)
@@ -2355,7 +2355,12 @@
 	switch_mutex_unlock(mod_sofia_globals.hash_mutex);
 
 	if (status == SWITCH_STATUS_SUCCESS) {
+		switch_event_t *s_event;
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Added gateway '%s' to profile '%s'\n", gateway->name, gateway->profile->name);
+		if (switch_event_create_subclass(&s_event, SWITCH_EVENT_CUSTOM, MY_EVENT_GATEWAY_ADD) == SWITCH_STATUS_SUCCESS) {
+			switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "Gateway", gateway->name);
+			switch_event_fire(&s_event);
+		}
 	}
 
 	return status;