Revision
16509
Author
gmaruzz
Date
2010-01-25 04:03:46 -0600 (Mon, 25 Jan 2010)

Log Message

gsmopen: added command line feedback to gsmopen_dump

Modified Paths

Diff

Modified: freeswitch/branches/gmaruzz/mod_gsmopen/mod_gsmopen.cpp (16508 => 16509)


--- freeswitch/branches/gmaruzz/mod_gsmopen/mod_gsmopen.cpp	2010-01-25 09:52:57 UTC (rev 16508)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/mod_gsmopen.cpp	2010-01-25 10:03:46 UTC (rev 16509)
@@ -2630,6 +2630,7 @@
 	char *mycmd = NULL, *argv[10] = { 0 };
 	int argc = 0;
 	private_t *tech_pvt = NULL;
+	char value[512];
 
 	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
 		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
@@ -2648,7 +2649,7 @@
 			if (strlen(globals.GSMOPEN_INTERFACES[i].name)
 					&& (strncmp(globals.GSMOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) {
 				tech_pvt = &globals.GSMOPEN_INTERFACES[i];
-				stream->write_function(stream, "Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", i, globals.GSMOPEN_INTERFACES[i].name);
+				//stream->write_function(stream, "Using interface: globals.GSMOPEN_INTERFACES[%d].name=|||%s|||\n", i, globals.GSMOPEN_INTERFACES[i].name);
 				found = 1;
 				break;
 			}
@@ -2656,11 +2657,10 @@
 		}
 		if (!found && (strcmp("list", argv[0]) == 0)) {
 			int i;
-			char value[512];
-			stream->write_function(stream, "gsmopen_dump LIST\n");
+			stream->write_function(stream, "gsmopen_dump LIST\n\n");
 			for (i = 0; i < GSMOPEN_MAX_INTERFACES; i++) {
 				if (strlen(globals.GSMOPEN_INTERFACES[i].name)) {
-					stream->write_function(stream, "dumping interface '%s'\n", globals.GSMOPEN_INTERFACES[i].name);
+					stream->write_function(stream, "dumping interface '%s'\n\n", globals.GSMOPEN_INTERFACES[i].name);
 					tech_pvt = &globals.GSMOPEN_INTERFACES[i];
 
 
@@ -2725,6 +2725,7 @@
 					snprintf(value, sizeof(value)-1, "%d", tech_pvt->phone_callflow);
 					stream->write_function(stream, "phone_callflow = %s\n", value);
 					stream->write_function(stream, "session_uuid_str = %s\n", tech_pvt->session_uuid_str);
+					stream->write_function(stream, "\n");
 
 					dump_event(tech_pvt);
 				}
@@ -2732,7 +2733,73 @@
 			}
 
 		} else if(found){
-			stream->write_function(stream, "dumping interface '%s'\n", argv[0]);
+			stream->write_function(stream, "dumping interface '%s'\n\n", argv[0]);
+			tech_pvt = &globals.GSMOPEN_INTERFACES[i];
+
+
+			stream->write_function(stream, "interface_name = %s\n", tech_pvt->name);
+			stream->write_function(stream, "interface_id = %s\n", tech_pvt->id);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->active);
+			stream->write_function(stream, "active = %s\n", value);
+			if(!tech_pvt->network_creg_not_supported){
+				snprintf(value, sizeof(value)-1, "%d", tech_pvt->not_registered);
+				stream->write_function(stream, "not_registered = %s\n", value);
+				snprintf(value, sizeof(value)-1, "%d", tech_pvt->home_network_registered);
+				stream->write_function(stream, "home_network_registered = %s\n", value);
+				snprintf(value, sizeof(value)-1, "%d", tech_pvt->roaming_registered);
+				stream->write_function(stream, "roaming_registered = %s\n", value);
+			}else{
+				stream->write_function(stream, "not_registered = %s\n", "N/A");
+				stream->write_function(stream, "home_network_registered = %s\n", "N/A");
+				stream->write_function(stream, "roaming_registered = %s\n", "N/A");
+			}
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->got_signal);
+			stream->write_function(stream, "got_signal = %s\n", value);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->running);
+			stream->write_function(stream, "running = %s\n", value);
+			stream->write_function(stream, "imei = %s\n", tech_pvt->imei);
+			stream->write_function(stream, "imsi = %s\n", tech_pvt->imsi);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->controldev_dead);
+			stream->write_function(stream, "controldev_dead = %s\n", value);
+			stream->write_function(stream, "controldevice_name = %s\n", tech_pvt->controldevice_name);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->no_sound);
+			stream->write_function(stream, "no_sound = %s\n", value);
+#ifdef GSMOPEN_ALSA
+			stream->write_function(stream, "alsacname = %s\n", tech_pvt->alsacname);
+			stream->write_function(stream, "alsapname = %s\n", tech_pvt->alsapname);
+#endif// GSMOPEN_ALSA
+#ifdef GSMOPEN_PORTAUDIO
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiocindex);
+			stream->write_function(stream, "portaudiocindex = %s\n", value);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiopindex);
+			stream->write_function(stream, "portaudiopindex = %s\n", value);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexecho);
+			stream->write_function(stream, "speexecho = %s\n", value);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->speexpreprocess);
+			stream->write_function(stream, "speexpreprocess = %s\n", value);
+#endif// GSMOPEN_PORTAUDIO
+			snprintf(value, sizeof(value)-1, "%f", tech_pvt->playback_boost);
+			stream->write_function(stream, "playback_boost = %s\n", value);
+			snprintf(value, sizeof(value)-1, "%f", tech_pvt->capture_boost);
+			stream->write_function(stream, "capture_boost = %s\n", value);
+			stream->write_function(stream, "dialplan = %s\n", tech_pvt->dialplan);
+			stream->write_function(stream, "context = %s\n", tech_pvt->context);
+			stream->write_function(stream, "destination = %s\n", tech_pvt->destination);
+			snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_calls);
+			stream->write_function(stream, "ib_calls = %s\n", value);
+			snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_calls);
+			stream->write_function(stream, "ob_calls = %s\n", value);
+			snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ib_failed_calls);
+			stream->write_function(stream, "ib_failed_calls = %s\n", value);
+			snprintf(value, sizeof(value)-1, "%lu", tech_pvt->ob_failed_calls);
+			stream->write_function(stream, "ob_failed_calls = %s\n", value);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->interface_state);
+			stream->write_function(stream, "interface_state = %s\n", value);
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->phone_callflow);
+			stream->write_function(stream, "phone_callflow = %s\n", value);
+			stream->write_function(stream, "session_uuid_str = %s\n", tech_pvt->session_uuid_str);
+			stream->write_function(stream, "\n");
+
 			dump_event(tech_pvt);
 		} else{
 			stream->write_function(stream, "interface '%s' was not found\n", argv[0]);