Revision
16439
Author
gmaruzz
Date
2010-01-21 13:40:02 -0600 (Thu, 21 Jan 2010)

Log Message

gsmopen: beefing up gsmopen_dump API command and CUSTOM gsmopen::dump_event EVENT

Modified Paths

Diff

Modified: freeswitch/branches/gmaruzz/mod_gsmopen/gsmopen.h (16438 => 16439)


--- freeswitch/branches/gmaruzz/mod_gsmopen/gsmopen.h	2010-01-21 19:08:51 UTC (rev 16438)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/gsmopen.h	2010-01-21 19:40:02 UTC (rev 16439)
@@ -484,6 +484,10 @@
 #endif// WANT_SPEEX
 #endif// GSMOPEN_PORTAUDIO
 		 dtmf_rx_state_t dtmf_state;
+		 int active;
+		 int registered;
+		 int got_signal;
+		 char imei[128];
 
 };
 

Modified: freeswitch/branches/gmaruzz/mod_gsmopen/mod_gsmopen.cpp (16438 => 16439)


--- freeswitch/branches/gmaruzz/mod_gsmopen/mod_gsmopen.cpp	2010-01-21 19:08:51 UTC (rev 16438)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/mod_gsmopen.cpp	2010-01-21 19:40:02 UTC (rev 16439)
@@ -2951,7 +2951,20 @@
 	if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, MY_EVENT_DUMP) == SWITCH_STATUS_SUCCESS) {
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_name", tech_pvt->name);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_id", tech_pvt->id);
+		snprintf(value, sizeof(value)-1, "%d", tech_pvt->active);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "active", value);
+		snprintf(value, sizeof(value)-1, "%d", tech_pvt->registered);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "registered", value);
+		snprintf(value, sizeof(value)-1, "%d", tech_pvt->got_signal);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "got_signal", value);
+		snprintf(value, sizeof(value)-1, "%d", tech_pvt->running);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "running", value);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "imei", tech_pvt->imei);
+		snprintf(value, sizeof(value)-1, "%d", tech_pvt->controldev_dead);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "controldev_dead", value);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "controldevice_name", tech_pvt->controldevice_name);
+		snprintf(value, sizeof(value)-1, "%d", tech_pvt->no_sound);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "no_sound", value);
 #ifdef GSMOPEN_ALSA
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alsacname", tech_pvt->alsacname);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alsapname", tech_pvt->alsapname);
@@ -2961,6 +2974,10 @@
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "portaudiocindex", value);
 		snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiopindex);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "portaudiopindex", value);
+		snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexecho);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "speexecho", value);
+		snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexpreprocess);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "speexpreprocess", value);
 #endif// GSMOPEN_PORTAUDIO
 		snprintf(value, sizeof(value)-1, "%f", tech_pvt->playback_boost);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "playback_boost", value);
@@ -2969,6 +2986,19 @@
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialplan", tech_pvt->dialplan);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "context", tech_pvt->context);
 		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "destination", tech_pvt->destination);
+		snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_calls);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ib_calls", value);
+		snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_calls);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ob_calls", value);
+		snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_failed_calls);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ib_failed_calls", value);
+		snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_failed_calls);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ob_failed_calls", value);
+		snprintf(value, sizeof(value)-1, "%d", tech_pvt->interface_state);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_state", value);
+		snprintf(value, sizeof(value)-1, "%d", tech_pvt->phone_callflow);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "phone_callflow", value);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "session_uuid_str", tech_pvt->session_uuid_str);
 		if (session) {
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "true");
 			if (switch_core_session_queue_event(session, &event) != SWITCH_STATUS_SUCCESS) {
@@ -2990,7 +3020,20 @@
 		if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_name", tech_pvt->name);
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_id", tech_pvt->id);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->active);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "active", value);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->registered);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "registered", value);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->got_signal);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "got_signal", value);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->running);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "running", value);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "imei", tech_pvt->imei);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->controldev_dead);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "controldev_dead", value);
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "controldevice_name", tech_pvt->controldevice_name);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->no_sound);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "no_sound", value);
 #ifdef GSMOPEN_ALSA
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alsacname", tech_pvt->alsacname);
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alsapname", tech_pvt->alsapname);
@@ -3000,6 +3043,10 @@
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "portaudiocindex", value);
 			snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiopindex);
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "portaudiopindex", value);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexecho);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "speexecho", value);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexpreprocess);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "speexpreprocess", value);
 #endif// GSMOPEN_PORTAUDIO
 			snprintf(value, sizeof(value)-1, "%f", tech_pvt->playback_boost);
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "playback_boost", value);
@@ -3008,7 +3055,19 @@
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialplan", tech_pvt->dialplan);
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "context", tech_pvt->context);
 			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "destination", tech_pvt->destination);
-
+			snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_calls);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ib_calls", value);
+			snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_calls);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ob_calls", value);
+			snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_failed_calls);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ib_failed_calls", value);
+			snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_failed_calls);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "ob_failed_calls", value);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->interface_state);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface_state", value);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->phone_callflow);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "phone_callflow", value);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "session_uuid_str", tech_pvt->session_uuid_str);
 			if (session) {
 				switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "true");
 			} else {			//no session