Revision
16438
Author
gmaruzz
Date
2010-01-21 13:08:51 -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/mod_gsmopen.cpp (16437 => 16438)


--- freeswitch/branches/gmaruzz/mod_gsmopen/mod_gsmopen.cpp	2010-01-21 18:46:40 UTC (rev 16437)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/mod_gsmopen.cpp	2010-01-21 19:08:51 UTC (rev 16438)
@@ -99,7 +99,7 @@
 #endif //0
 
 SWITCH_STANDARD_API(gsmopen_boost_audio_function);
-#define GSMOPEN_BOOST_AUDIO_SYNTAX "interface_name [<play|capt> <in decibels: -40 ... +40>]"
+#define GSMOPEN_BOOST_AUDIO_SYNTAX "interface_name [<play|capt> <in decibels: -40 ... 0 ... +40>]"
 SWITCH_STANDARD_API(sendsms_function);
 #define SENDSMS_SYNTAX "gsmopen_sendsms interface_name destination_number SMS_text"
 SWITCH_STANDARD_API(gsmopen_dump_function);
@@ -2669,11 +2669,15 @@
 				goto end;
 			} else if ((strncmp("play", argv[1], strlen(argv[1])) == 0)) {
 				if (switch_is_number(argv[2])) {
+					stream->write_function(stream,"[%s] playback boost was %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].playback_boost);
 					gsmopen_store_boost(argv[2], &globals.GSMOPEN_INTERFACES[i].playback_boost);	//FIXME
+					stream->write_function(stream,"[%s] playback boost is now %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].playback_boost);
 				}
 			}else if ((strncmp("capt", argv[1], strlen(argv[1])) == 0)) {
 				if (switch_is_number(argv[2])) {
+					stream->write_function(stream,"[%s] capture boost was %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].capture_boost);
 					gsmopen_store_boost(argv[2], &globals.GSMOPEN_INTERFACES[i].capture_boost);	//FIXME
+					stream->write_function(stream,"[%s] capture boost is now %f\n", globals.GSMOPEN_INTERFACES[i].name, globals.GSMOPEN_INTERFACES[i].capture_boost);
 				}
 			} else {
 				stream->write_function(stream, "ERROR, usage: %s", GSMOPEN_BOOST_AUDIO_SYNTAX);
@@ -2937,6 +2941,7 @@
 	switch_event_t *event;
 	switch_core_session_t *session = NULL;
 	int event_sent_to_esl = 0;
+	char value[512];
 
 	DEBUGA_GSMOPEN("STATUS of interface %s: \n", GSMOPEN_P_LOG, tech_pvt->name );
 
@@ -2944,7 +2949,26 @@
 		session = switch_core_session_locate(tech_pvt->session_uuid_str);
 	}
 	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", tech_pvt->name);
+		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);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "controldevice_name", tech_pvt->controldevice_name);
+#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);
+#endif// GSMOPEN_ALSA
+#ifdef GSMOPEN_PORTAUDIO
+		snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiocindex);
+		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);
+#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);
+		snprintf(value, sizeof(value)-1, "%f", tech_pvt->capture_boost);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "capture_boost", value);
+		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);
 		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) {
@@ -2964,7 +2988,27 @@
 	if (!event_sent_to_esl) {
 
 		if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
-			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "interface", tech_pvt->name);
+			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);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "controldevice_name", tech_pvt->controldevice_name);
+#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);
+#endif// GSMOPEN_ALSA
+#ifdef GSMOPEN_PORTAUDIO
+			snprintf(value, sizeof(value)-1, "%d", tech_pvt->portaudiocindex);
+			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);
+#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);
+			snprintf(value, sizeof(value)-1, "%f", tech_pvt->capture_boost);
+			switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "capture_boost", value);
+			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);
+
 			if (session) {
 				switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "during-call", "true");
 			} else {			//no session

Modified: freeswitch/branches/gmaruzz/mod_gsmopen/portaudio_nogsmlib_noalsa_nocplusplus/mod_gsmopen/Makefile (16437 => 16438)


--- freeswitch/branches/gmaruzz/mod_gsmopen/portaudio_nogsmlib_noalsa_nocplusplus/mod_gsmopen/Makefile	2010-01-21 18:46:40 UTC (rev 16437)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/portaudio_nogsmlib_noalsa_nocplusplus/mod_gsmopen/Makefile	2010-01-21 19:08:51 UTC (rev 16438)
@@ -2,5 +2,5 @@
 SVNDEF := -D'GSMOPEN_SVN_VERSION="$(shell svnversion -n .)"'
 LOCAL_CFLAGS += $(SVNDEF) -DNO_GSMLIB -DNO_ALSA -DGSMOPEN_PORTAUDIO
 LOCAL_LDFLAGS=-lportaudio -lspeex -lspeexdsp
-LOCAL_OBJS=gsmopen_protocol.o pablio.o pa_ringbuffer.o
+LOCAL_OBJS=gsmopen_protocol.o pablio.o pa_ringbuffer.o celliax_spandsp.o
 include ../../../../../../build/modmake.rules