Revision
16170
Author
gmaruzz
Date
2010-01-06 06:29:05 -0600 (Wed, 06 Jan 2010)

Log Message

gsmopen: added 'noalsa', 'nogsmlib_nocplusplus', 'nogsmlib_noalsa_nocplusplus', directories so you can compile it without alsa, gsmlib, and in pure c. Good for you embedded developer :)

Modified Paths

Added Paths

Diff

Modified: freeswitch/branches/gmaruzz/mod_gsmopen/gsmopen.h (16169 => 16170)


--- freeswitch/branches/gmaruzz/mod_gsmopen/gsmopen.h	2010-01-06 04:31:20 UTC (rev 16169)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/gsmopen.h	2010-01-06 12:29:05 UTC (rev 16170)
@@ -52,7 +52,9 @@
 #endif //GIOVA48
 #define     SAMPLERATE_GSMOPEN   8000
 
+#ifndef NO_ALSA
 #define GSMOPEN_ALSA
+#endif // NO_ALSA
 #include <switch.h>
 #include <switch_version.h>
 #include <termios.h>

Modified: freeswitch/branches/gmaruzz/mod_gsmopen/gsmopen_protocol.cpp (16169 => 16170)


--- freeswitch/branches/gmaruzz/mod_gsmopen/gsmopen_protocol.cpp	2010-01-06 04:31:20 UTC (rev 16169)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/gsmopen_protocol.cpp	2010-01-06 12:29:05 UTC (rev 16170)
@@ -1,5 +1,6 @@
 #include "gsmopen.h"
 //#include <iostream.h>
+#ifndef NO_GSMLIB
 #include <gsmlib/gsm_sms.h>
 #ifdef WIN32
 #include <gsmlib/gsm_win32_serial.h>
@@ -12,6 +13,7 @@
 
 using namespace std;
 using namespace gsmlib;
+#endif// NO_GSMLIB
 
 
 #ifdef ASTERISK
@@ -42,6 +44,8 @@
 	int fd;
 	int rt;
 	struct termios tp;
+	unsigned int status = 0;
+	unsigned int flags = TIOCM_DTR;
 
 /* if there is a file descriptor, close it. But it is probably just an old value, so don't check for close success*/
 	fd = tech_pvt->controldevfd;
@@ -91,14 +95,12 @@
 	if (rt == -1) {
 		ERRORA("serial error: %s", GSMOPEN_P_LOG, strerror(errno));
 	}
-	unsigned int status = 0;
 #ifndef __CYGWIN__
 	ioctl(fd, TIOCMGET, &status);
 	status |= TIOCM_DTR;		/*  Set DTR high */
 	status &= ~TIOCM_RTS;		/*  Set RTS low */
 	ioctl(fd, TIOCMSET, &status);
 	ioctl(fd, TIOCMGET, &status);
-	unsigned int flags = TIOCM_DTR;
 	ioctl(fd, TIOCMBIS, &flags);
 	flags = TIOCM_RTS;
 	ioctl(fd, TIOCMBIC, &flags);
@@ -187,6 +189,30 @@
 
 int gsmopen_serial_config(private_t * tech_pvt)
 {
+#ifndef NO_GSMLIB
+		SMSMessageRef sms;
+		char content2[1000];
+		//sms = SMSMessage::decode("079194710167120004038571F1390099406180904480A0D41631067296EF7390383D07CD622E58CD95CB81D6EF39BDEC66BFE7207A794E2FBB4320AFB82C07E56020A8FC7D9687DBED32285C9F83A06F769A9E5EB340D7B49C3E1FA3C3663A0B24E4CBE76516680A7FCBE920725A5E5ED341F0B21C346D4E41E1BA790E4286DDE4BC0BD42CA3E5207258EE1797E5A0BA9B5E9683C86539685997EBEF61341B249BC966"); // dataCodingScheme = 0
+		//sms = SMSMessage::decode("0791934329002000040C9193432766658100009001211133318004D4F29C0E"); // dataCodingScheme = 0
+		//sms = SMSMessage::decode("0791934329002000040C919343276665810008900121612521801600CC00E800E900F900F200E00020006300690061006F"); // dataCodingScheme = 8
+		sms = SMSMessage::decode("0791934329002000040C919343276665810008900172002293404C006300690061006F0020003100320033002000620065006C00E80020043D043E0432043E044104420438002005DC05E7002005E805D005EA0020FE8EFEE0FEA0FEE4FECBFE9300204EBA5927");	// dataCodingScheme = 8 , text=ciao 123 belè новости לק ראת ﺎﻠﺠﻤﻋﺓ 人大
+		//sms = SMSMessage::decode("07911497941902F00414D0E474989D769F5DE4320839001040122151820000"); // dataCodingScheme = 0
+		NOTICA("SMS=\n%s\n", GSMOPEN_P_LOG, sms->toString().c_str());
+
+		memset(content2, '\0', sizeof(content2));
+		if (sms->dataCodingScheme().getAlphabet() == DCS_DEFAULT_ALPHABET) {
+			iso_8859_1_to_utf8(tech_pvt, (char *) sms->userData().c_str(), content2, sizeof(content2));
+		} else if (sms->dataCodingScheme().getAlphabet() == DCS_SIXTEEN_BIT_ALPHABET) {
+			ucs2_to_utf8(tech_pvt, (char *) bufToHex((unsigned char *) sms->userData().data(), sms->userData().length()).c_str(), content2,
+					sizeof(content2));
+		} else {
+			ERRORA("dataCodingScheme not supported=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet());
+
+		}
+		NOTICA("dataCodingScheme=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet());
+		NOTICA("userData= |||%s|||\n", GSMOPEN_P_LOG, content2);
+#endif// NO_GSMLIB
+
 	if (tech_pvt->controldevprotocol == PROTOCOL_AT)
 		return gsmopen_serial_config_AT(tech_pvt);
 #ifdef GSMOPEN_FBUS2
@@ -197,12 +223,15 @@
 	if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL)
 		return gsmopen_serial_config_CVM_BUSMAIL(tech_pvt);
 #endif /* GSMOPEN_CVM */
+
 	return -1;
 }
 
 int gsmopen_serial_config_AT(private_t * tech_pvt)
 {
 	int res;
+	char at_command[5];
+	int i;
 
 /* initial_pause? */
 	if (tech_pvt->at_initial_pause) {
@@ -300,8 +329,6 @@
 	}
 
 	/* various phone manufacturer identifier */
-	char at_command[5];
-	int i;
 	for (i = 0; i < 10; i++) {
 		memset(at_command, 0, sizeof(at_command));
 		sprintf(at_command, "ATI%d", i);
@@ -328,7 +355,6 @@
 		DEBUGA_GSMOPEN("AT+CGSN failed\n", GSMOPEN_P_LOG);
 	}
 
-/* this take a lot of time to complete on devices with slow serial link (eg.: 9600bps) */
 	/* signal incoming SMS with a +CMTI unsolicited msg */
 	res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CNMI=3,1,0,0,0");
 	if (res) {
@@ -530,6 +556,7 @@
 	LOKKA(tech_pvt->controldev_lock);
 
 	while ((!tech_pvt->controldev_dead) && ((select_err = select(tech_pvt->controldevfd + 1, &read_fds, NULL, NULL, &timeout)) > 0)) {
+		char *token_ptr;
 		timeout.tv_sec = timeout_sec;	//reset the timeout, linux modify it
 		timeout.tv_usec = timeout_usec;	//reset the timeout, linux modify it
 		read_count = read(tech_pvt->controldevfd, tmp_answer_ptr, AT_BUFSIZ - (tmp_answer_ptr - tmp_answer));
@@ -554,7 +581,6 @@
 		}
 		tmp_answer_ptr = tmp_answer_ptr + read_count;
 
-		char *token_ptr;
 
 		la_counter = 0;
 		memset(tmp_answer2, 0, sizeof(char) * AT_BUFSIZ);
@@ -638,13 +664,13 @@
 			}
 
 			if ((strncmp(tech_pvt->line_array.result[i], "+CLCC", 5) == 0)) {
-				/* with clcc we wait for clip */
-				memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name));
-				memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number));
 				int commacount = 0;
 				int a = 0;
 				int b = 0;
 				int c = 0;
+				/* with clcc we wait for clip */
+				memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name));
+				memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number));
 
 				for (a = 0; a < strlen(tech_pvt->line_array.result[i]); a++) {
 
@@ -673,15 +699,15 @@
 			}
 
 			if ((strncmp(tech_pvt->line_array.result[i], "+CLIP", 5) == 0)) {
-				/* with CLIP, we want to answer right away */
-				memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name));
-				memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number));
-
 				int commacount = 0;
 				int a = 0;
 				int b = 0;
 				int c = 0;
+				/* with CLIP, we want to answer right away */
+				memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name));
+				memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number));
 
+
 				for (a = 7; a < strlen(tech_pvt->line_array.result[i]); a++) {
 					if (tech_pvt->line_array.result[i][a] == ',') {
 						commacount++;
@@ -1451,15 +1477,15 @@
 #if 1
 					char content[512];
 					char content2[512];
+					int inside_comma = 0;
+					int inside_quote = 0;
+					int which_field = 0;
+					int d = 0;
 
 					ERRORA("HERE\n", GSMOPEN_P_LOG);
 
 					memset(content, '\0', sizeof(content));
 
-					int inside_comma = 0;
-					int inside_quote = 0;
-					int which_field = 0;
-					int d = 0;
 
 					for (c = 0; c < strlen(tech_pvt->line_array.result[i]); c++) {
 						if (tech_pvt->line_array.result[i][c] == ',' && tech_pvt->line_array.result[i][c - 1] != '\\' && inside_quote == 0) {
@@ -1534,9 +1560,9 @@
 					DEBUGA_GSMOPEN("body=%s\n", GSMOPEN_P_LOG, sms_body);
 					DEBUGA_GSMOPEN("tech_pvt->line_array.result[i]=%s\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]);
 					if (tech_pvt->sms_cnmi_not_supported) {
+						char content3[1000];
 						strncpy(tech_pvt->sms_message, tech_pvt->line_array.result[i], sizeof(tech_pvt->sms_message));
 
-						char content3[1000];
 						//int howmanyleft;
 
 
@@ -1549,8 +1575,9 @@
 						sms_incoming(tech_pvt);
 						WARNINGA("2 content3=%s\n", GSMOPEN_P_LOG, content3);
 					} else {
+#ifndef NO_GSMLIB
+						char content2[1000];
 						SMSMessageRef sms;
-						char content2[1000];
 //MessageType messagetype;
 //Address servicecentreaddress;
 //Timestamp servicecentretimestamp;
@@ -1594,6 +1621,7 @@
 //servicecentretimestamp = sms->serviceCentreTimestamp();
 //sender_recipient_address = sms->address();
 
+#endif// NO_GSMLIB
 					}
 
 #if 0
@@ -2095,10 +2123,10 @@
 	char *outbuf;
 	char *inbuf;
 	size_t inbytesleft;
-	int c;
-	char stringa[5];
-	double hexnum;
-	int i = 0;
+	//int c;
+	//char stringa[5];
+	//double hexnum;
+	//int i = 0;
 
 	memset(converted, '\0', sizeof(converted));
 
@@ -2124,7 +2152,7 @@
 	}
 	DEBUGA_GSMOPEN
 		(" strlen(iso_8859_1_in)=%d, iconv_res=%d,  inbuf=%s, inleft=%d, out=%s, outleft=%d, utf8_out=%s\n",
-		 GSMOPEN_P_LOG, strlen(iso_8859_1_in), iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_out);
+		 GSMOPEN_P_LOG, (int) strlen(iso_8859_1_in), iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_out);
 
 
 
@@ -2333,7 +2361,7 @@
 
 
 
-#define GSMOPEN_ALSA
+//#define GSMOPEN_ALSA
 #ifdef GSMOPEN_ALSA
 /*! \brief ALSA pcm format, according to endianess  */
 #if __BYTE_ORDER == __LITTLE_ENDIAN
@@ -2447,6 +2475,7 @@
 	int stop_delay = 0;
 	snd_pcm_state_t state;
 	snd_pcm_info_t *info;
+	unsigned int chan_num;
 
 	period_size = tech_pvt->alsa_period_size;
 
@@ -2499,7 +2528,6 @@
 		DEBUGA_GSMOPEN("Channels count set failed: %s\n", GSMOPEN_P_LOG, snd_strerror(err));
 	}
 #if 1
-	unsigned int chan_num;
 	err = snd_pcm_hw_params_get_channels(params, &chan_num);
 	if (err < 0) {
 		ERRORA("Channels count non available: %s\n", GSMOPEN_P_LOG, snd_strerror(err));
@@ -2675,6 +2703,7 @@
 		}
 		snd_pcm_dump(handle, output);
 
+#ifndef NO_GSMLIB
 		SMSMessageRef sms;
 		char content2[1000];
 		//sms = SMSMessage::decode("079194710167120004038571F1390099406180904480A0D41631067296EF7390383D07CD622E58CD95CB81D6EF39BDEC66BFE7207A794E2FBB4320AFB82C07E56020A8FC7D9687DBED32285C9F83A06F769A9E5EB340D7B49C3E1FA3C3663A0B24E4CBE76516680A7FCBE920725A5E5ED341F0B21C346D4E41E1BA790E4286DDE4BC0BD42CA3E5207258EE1797E5A0BA9B5E9683C86539685997EBEF61341B249BC966"); // dataCodingScheme = 0
@@ -2696,6 +2725,7 @@
 		}
 		NOTICA("dataCodingScheme=%d\n", GSMOPEN_P_LOG, sms->dataCodingScheme().getAlphabet());
 		NOTICA("userData= |||%s|||\n", GSMOPEN_P_LOG, content2);
+#endif// NO_GSMLIB
 
 	}
 	if (option_debug > 1)
@@ -2744,6 +2774,7 @@
 	return 0;
 }
 
+#ifdef GSMOPEN_ALSA
 /*! \brief Write audio frames to interface */
 int alsa_write(private_t * tech_pvt, short *data, int datalen)
 {
@@ -3014,10 +3045,10 @@
 		r = snd_pcm_readi(tech_pvt->alsac, buf + readpos, left);
 		//DEBUGA_GSMOPEN("r=%d, buf=%p, buf+readpos=%p, datalen=%d, left=%d\n", GSMOPEN_P_LOG, r, (void *)buf, (void *)(buf + readpos), datalen, left);
 	} else {
+		int a = 0;
+		int i = 0;
 		r = snd_pcm_readi(tech_pvt->alsac, buf2 + (readpos * 2), left);
 
-		int a = 0;
-		int i = 0;
 		for (i = 0; i < (GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2;) {
 			__buf[a] = (__buf2[i] + __buf2[i + 1]) / 2;	//comment out this line to use only left
 			//__buf[a] = __buf2[i]; // enable this line to use only left
@@ -3042,10 +3073,10 @@
 			if (tech_pvt->alsa_capture_is_mono) {
 				r = snd_pcm_readi(tech_pvt->alsac, buf + readpos, left);
 			} else {
+				int a = 0;
+				int i = 0;
 				r = snd_pcm_readi(tech_pvt->alsac, buf2 + (readpos * 2), left);
 
-				int a = 0;
-				int i = 0;
 				for (i = 0; i < (GSMOPEN_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2;) {
 					__buf[a] = (__buf2[i] + __buf2[i + 1]) / 2;
 					a++;
@@ -3066,10 +3097,10 @@
 	left -= r;
 
 	if (readpos >= GSMOPEN_FRAME_SIZE) {
+		int i;
 		/* A real frame */
 		readpos = 0;
 		left = GSMOPEN_FRAME_SIZE;
-		int i;
 		for (i = 0; i < r; i++)
 			data[i] = buf[i];
 
@@ -3077,6 +3108,7 @@
 	return r;
 }
 
+#endif // GSMOPEN_ALSA
 
 
 
@@ -3179,7 +3211,7 @@
 		}
 
 		smscommand[strlen(smscommand)] = 0x1A;
-		DEBUGA_GSMOPEN("smscommand len is: %d, text is:|||%s|||\n", GSMOPEN_P_LOG, strlen(smscommand), smscommand);
+		DEBUGA_GSMOPEN("smscommand len is: %d, text is:|||%s|||\n", GSMOPEN_P_LOG, (int) strlen(smscommand), smscommand);
 
 		err = gsmopen_serial_write_AT_ack_nocr_longtime(tech_pvt, smscommand);
 		//TODO would be better to unlock controldev here

Modified: freeswitch/branches/gmaruzz/mod_gsmopen/mod_gsmopen.cpp (16169 => 16170)


--- freeswitch/branches/gmaruzz/mod_gsmopen/mod_gsmopen.cpp	2010-01-06 04:31:20 UTC (rev 16169)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/mod_gsmopen.cpp	2010-01-06 12:29:05 UTC (rev 16170)
@@ -263,6 +263,7 @@
 	//teletone_dtmf_detect_init(&tech_pvt->dtmf_detect, tech_pvt->read_codec.implementation->actual_samples_per_second);
 	teletone_dtmf_detect_init(&tech_pvt->dtmf_detect, 8000);
 
+#ifdef GSMOPEN_ALSA
 	if(tech_pvt->no_sound==0){
 		if (alsa_init(tech_pvt)) {
 			ERRORA("alsa_init failed\n", GSMOPEN_P_LOG);
@@ -270,6 +271,7 @@
 
 		}
 	}
+#endif// GSMOPEN_ALSA
 	if (switch_core_timer_init(&tech_pvt->timer_read, "soft", 20, tech_pvt->read_codec.implementation->samples_per_packet, gsmopen_module_pool) !=
 		SWITCH_STATUS_SUCCESS) {
 		ERRORA("setup timer failed\n", GSMOPEN_P_LOG);
@@ -497,9 +499,11 @@
 		switch_core_timer_destroy(&tech_pvt->timer_read);
 		switch_core_timer_destroy(&tech_pvt->timer_write);
 
+#ifdef GSMOPEN_ALSA
 	if(tech_pvt->no_sound==0){
 		alsa_shutdown(tech_pvt);
 	}
+#endif// GSMOPEN_ALSA
 
 		*tech_pvt->session_uuid_str = '\0';
 		tech_pvt->interface_state = GSMOPEN_STATE_IDLE;
@@ -674,6 +678,10 @@
 	switch_channel_t *channel = NULL;
 	private_t *tech_pvt = NULL;
 	switch_byte_t *data;
+#ifdef GSMOPEN_ALSA
+	int samples;
+	char digit_str[256];
+#endif// GSMOPEN_ALSA
 
 	channel = switch_core_session_get_channel(session);
 	switch_assert(channel != NULL);
@@ -698,8 +706,10 @@
 
 	switch_core_timer_next(&tech_pvt->timer_read);
 
-	int samples;
-
+		if(tech_pvt->no_sound==1){
+		goto cng;
+		}
+#ifdef GSMOPEN_ALSA
 	//if ((samples = snd_pcm_readi(tech_pvt->alsac, tech_pvt->read_frame.data, tech_pvt->read_codec.implementation->samples_per_packet)) > 0) 
 	if ((samples = alsa_read(tech_pvt, (short *) tech_pvt->read_frame.data, tech_pvt->read_codec.implementation->samples_per_packet)) > 0) {
 
@@ -721,9 +731,7 @@
 	}
 
 	if (samples != 160) {
-		if(tech_pvt->no_sound==0){
-			ERRORA("samples=%d\n", GSMOPEN_P_LOG, samples);
-		}
+		ERRORA("samples=%d\n", GSMOPEN_P_LOG, samples);
 		goto cng;
 	}
 //DEBUGA_GSMOPEN("samples=%d tech_pvt->read_frame.timestamp=%d\n", GSMOPEN_P_LOG, samples, tech_pvt->read_frame.timestamp);
@@ -733,7 +741,6 @@
 
 
 
-	char digit_str[256];
 
 
 	memset(digit_str, 0, sizeof(digit_str));
@@ -794,7 +801,7 @@
 
 	DEBUGA_GSMOPEN("CHANNEL READ FALSE\n", GSMOPEN_P_LOG);
 	return SWITCH_STATUS_FALSE;
-
+#endif// GSMOPEN_ALSA
   cng:
 	data = (switch_byte_t *) tech_pvt->read_frame.data;
 	data[0] = 65;
@@ -810,7 +817,9 @@
 {
 	switch_channel_t *channel = NULL;
 	private_t *tech_pvt = NULL;
+#ifdef GSMOPEN_ALSA
 	unsigned int sent;
+#endif// GSMOPEN_ALSA
 
 	channel = switch_core_session_get_channel(session);
 	switch_assert(channel != NULL);
@@ -836,12 +845,14 @@
 	//snd_pcm_writei(tech_pvt->alsap, (short *) frame->data, (int) (frame->datalen / 2));
 
 	gsmopen_sound_boost(frame->data, frame->samples, tech_pvt->playback_boost);
+#ifdef GSMOPEN_ALSA
 	sent = alsa_write(tech_pvt, (short *) frame->data, (int) (frame->datalen));
 //DEBUGA_GSMOPEN("sent=%d \n", GSMOPEN_P_LOG, sent);
 
 	if (sent && sent != frame->datalen / 2 && sent != -1) {
 		DEBUGA_GSMOPEN("sent %d\n", GSMOPEN_P_LOG, sent);
 	}
+#endif// GSMOPEN_ALSA
 	//NOTICA("sent=%d\n", GSMOPEN_P_LOG, sent);
 	return SWITCH_STATUS_SUCCESS;
 }
@@ -896,8 +907,10 @@
 {
 	switch_channel_t *channel;
 	private_t *tech_pvt;
+#ifdef GSMOPEN_ALSA
 	int samples;
 	short tmp_buffer[1280];
+#endif// GSMOPEN_ALSA
 
 	channel = switch_core_session_get_channel(session);
 	switch_assert(channel != NULL);
@@ -915,9 +928,11 @@
 	case SWITCH_MESSAGE_INDICATE_AUDIO_SYNC:
 
 		WARNINGA("%s CHANNEL got SWITCH_MESSAGE_INDICATE_AUDIO_SYNC\n", GSMOPEN_P_LOG, switch_channel_get_name(channel));
+#ifdef GSMOPEN_ALSA
 		while ((samples = alsa_read(tech_pvt, tmp_buffer, tech_pvt->read_codec.implementation->samples_per_packet * 4)) > 160) {
 			//WARNINGA("read %d samples\n", GSMOPEN_P_LOG, samples);
 		}
+#endif// GSMOPEN_ALSA
 		switch_core_timer_sync(&tech_pvt->timer_read);
 		switch_core_timer_sync(&tech_pvt->timer_write);
 
@@ -1237,7 +1252,11 @@
 			const char *alsa_capture_is_mono = "1";
 			const char *capture_boost = "5";
 			const char *playback_boost = "10";
+#ifdef GSMOPEN_ALSA
 			const char *no_sound = "0";
+#else // GSMOPEN_ALSA
+			const char *no_sound = "1";
+#endif // GSMOPEN_ALSA
 
 			uint32_t interface_id = 0;
 			uint32_t controldevice_speed = B115200;	//FIXME TODO
@@ -1495,6 +1514,7 @@
 			if (interface_id && interface_id < GSMOPEN_MAX_INTERFACES) {
 				private_t newconf;
 				switch_threadattr_t *gsmopen_api_thread_attr = NULL;
+				int res = 0;
 
 				memset(&newconf, '\0', sizeof(newconf));
 				globals.GSMOPEN_INTERFACES[interface_id] = newconf;
@@ -1564,22 +1584,30 @@
 				switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].at_indicator_callsetupremoteringing_string,
 								  at_indicator_callsetupremoteringing_string);
 				//switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].sms_receiving_program, sms_receiving_program);
+#ifdef GSMOPEN_ALSA
 				switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].alsacname, alsacname);
 				switch_set_string(globals.GSMOPEN_INTERFACES[interface_id].alsapname, alsapname);
+#endif// GSMOPEN_ALSA
 
 				globals.GSMOPEN_INTERFACES[interface_id].at_early_audio = atoi(at_early_audio);
 				globals.GSMOPEN_INTERFACES[interface_id].at_after_preinit_pause = atoi(at_after_preinit_pause);
 				globals.GSMOPEN_INTERFACES[interface_id].at_initial_pause = atoi(at_initial_pause);
 				globals.GSMOPEN_INTERFACES[interface_id].at_has_clcc = atoi(at_has_clcc);
 				globals.GSMOPEN_INTERFACES[interface_id].at_has_ecam = atoi(at_has_ecam);
+#ifdef GSMOPEN_ALSA
 				globals.GSMOPEN_INTERFACES[interface_id].alsa_period_size = atoi(alsa_period_size);
 				globals.GSMOPEN_INTERFACES[interface_id].alsa_periods_in_buffer = atoi(alsa_periods_in_buffer);
 				globals.GSMOPEN_INTERFACES[interface_id].gsmopen_sound_rate = atoi(gsmopen_sound_rate);
 				globals.GSMOPEN_INTERFACES[interface_id].alsa_play_is_mono = atoi(alsa_play_is_mono);
 				globals.GSMOPEN_INTERFACES[interface_id].alsa_capture_is_mono = atoi(alsa_capture_is_mono);
+#endif// GSMOPEN_ALSA
 				globals.GSMOPEN_INTERFACES[interface_id].capture_boost = atoi(capture_boost);
 				globals.GSMOPEN_INTERFACES[interface_id].playback_boost = atoi(playback_boost);
+#ifdef GSMOPEN_ALSA
 				globals.GSMOPEN_INTERFACES[interface_id].no_sound = atoi(no_sound);
+#else // GSMOPEN_ALSA
+				globals.GSMOPEN_INTERFACES[interface_id].no_sound = 1;
+#endif // GSMOPEN_ALSA
 
 
 
@@ -1597,10 +1625,11 @@
 				DEBUGA_GSMOPEN("dialplan=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].dialplan);
 				DEBUGA_GSMOPEN("destination=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].destination);
 				DEBUGA_GSMOPEN("controldevice_name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].controldevice_name);
+#ifdef GSMOPEN_ALSA
 				DEBUGA_GSMOPEN("alsacname=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].alsacname);
 				DEBUGA_GSMOPEN("alsapname=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[interface_id].alsapname);
+#endif// GSMOPEN_ALSA
 
-				int res = 0;
 
 				/* init the serial port */
 				if (globals.GSMOPEN_INTERFACES[interface_id].controldevprotocol != PROTOCOL_NO_SERIAL) {
@@ -1622,6 +1651,7 @@
 				}
 
 				if(globals.GSMOPEN_INTERFACES[interface_id].no_sound==0){
+#ifdef GSMOPEN_ALSA
 					if (alsa_init(&globals.GSMOPEN_INTERFACES[interface_id])) {
 						ERRORA("alsa_init failed\n", GSMOPEN_P_LOG);
 						return SWITCH_STATUS_FALSE;
@@ -1633,7 +1663,9 @@
 						return SWITCH_STATUS_FALSE;
 
 					}
+#endif// GSMOPEN_ALSA
 				}
+
 				//gsmopen_store_boost((char *)"5", &globals.GSMOPEN_INTERFACES[interface_id].capture_boost);    //FIXME
 				//gsmopen_store_boost((char *)"10", &globals.GSMOPEN_INTERFACES[interface_id].playback_boost);  //FIXME
 				gsmopen_store_boost((char *) capture_boost, &globals.GSMOPEN_INTERFACES[interface_id].capture_boost);	//FIXME
@@ -1669,8 +1701,10 @@
 				DEBUGA_GSMOPEN("dialplan=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].dialplan);
 				DEBUGA_GSMOPEN("destination=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].destination);
 				DEBUGA_GSMOPEN("controldevice_name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].controldevice_name);
+#ifdef GSMOPEN_ALSA
 				DEBUGA_GSMOPEN("alsacname=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].alsacname);
 				DEBUGA_GSMOPEN("alsapname=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].alsapname);
+#endif// GSMOPEN_ALSA
 			}
 		}
 	}

Added: freeswitch/branches/gmaruzz/mod_gsmopen/noalsa/mod_gsmopen/Makefile (0 => 16170)


--- freeswitch/branches/gmaruzz/mod_gsmopen/noalsa/mod_gsmopen/Makefile	                        (rev 0)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/noalsa/mod_gsmopen/Makefile	2010-01-06 12:29:05 UTC (rev 16170)
@@ -0,0 +1,6 @@
+MODNAME=mod_gsmopen
+SVNDEF := -D'GSMOPEN_SVN_VERSION="$(shell svnversion -n .)"'
+LOCAL_CFLAGS += $(SVNDEF) -DNO_ALSA
+LOCAL_LDFLAGS=-lgsmme
+LOCAL_OBJS=gsmopen_protocol.o 
+include ../../../../../../build/modmake.rules

Added: freeswitch/branches/gmaruzz/mod_gsmopen/noalsa/mod_gsmopen/gsmopen.h (0 => 16170)


--- freeswitch/branches/gmaruzz/mod_gsmopen/noalsa/mod_gsmopen/gsmopen.h	                        (rev 0)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/noalsa/mod_gsmopen/gsmopen.h	2010-01-06 12:29:05 UTC (rev 16170)
@@ -0,0 +1 @@
+link ../../gsmopen.h
\ No newline at end of file
Property changes on: freeswitch/branches/gmaruzz/mod_gsmopen/noalsa/mod_gsmopen/gsmopen.h
___________________________________________________________________
Name: svn:special
   + *

Added: freeswitch/branches/gmaruzz/mod_gsmopen/noalsa/mod_gsmopen/gsmopen_protocol.cpp (0 => 16170)


--- freeswitch/branches/gmaruzz/mod_gsmopen/noalsa/mod_gsmopen/gsmopen_protocol.cpp	                        (rev 0)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/noalsa/mod_gsmopen/gsmopen_protocol.cpp	2010-01-06 12:29:05 UTC (rev 16170)
@@ -0,0 +1 @@
+link ../../gsmopen_protocol.cpp
\ No newline at end of file
Property changes on: freeswitch/branches/gmaruzz/mod_gsmopen/noalsa/mod_gsmopen/gsmopen_protocol.cpp
___________________________________________________________________
Name: svn:special
   + *

Added: freeswitch/branches/gmaruzz/mod_gsmopen/noalsa/mod_gsmopen/mod_gsmopen.cpp (0 => 16170)


--- freeswitch/branches/gmaruzz/mod_gsmopen/noalsa/mod_gsmopen/mod_gsmopen.cpp	                        (rev 0)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/noalsa/mod_gsmopen/mod_gsmopen.cpp	2010-01-06 12:29:05 UTC (rev 16170)
@@ -0,0 +1 @@
+link ../../mod_gsmopen.cpp
\ No newline at end of file
Property changes on: freeswitch/branches/gmaruzz/mod_gsmopen/noalsa/mod_gsmopen/mod_gsmopen.cpp
___________________________________________________________________
Name: svn:special
   + *

Added: freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noalsa_noc++/mod_gsmopen/Makefile (0 => 16170)


--- freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noalsa_noc++/mod_gsmopen/Makefile	                        (rev 0)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noalsa_noc++/mod_gsmopen/Makefile	2010-01-06 12:29:05 UTC (rev 16170)
@@ -0,0 +1,6 @@
+MODNAME=mod_gsmopen
+SVNDEF := -D'GSMOPEN_SVN_VERSION="$(shell svnversion -n .)"'
+LOCAL_CFLAGS += $(SVNDEF) -DNO_GSMLIB -DNO_ALSA
+LOCAL_LDFLAGS=
+LOCAL_OBJS=gsmopen_protocol.o 
+include ../../../../../../build/modmake.rules

Added: freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noalsa_noc++/mod_gsmopen/gsmopen.h (0 => 16170)


--- freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noalsa_noc++/mod_gsmopen/gsmopen.h	                        (rev 0)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noalsa_noc++/mod_gsmopen/gsmopen.h	2010-01-06 12:29:05 UTC (rev 16170)
@@ -0,0 +1 @@
+link ../../gsmopen.h
\ No newline at end of file
Property changes on: freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noalsa_noc++/mod_gsmopen/gsmopen.h
___________________________________________________________________
Name: svn:special
   + *

Added: freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noalsa_noc++/mod_gsmopen/gsmopen_protocol.c (0 => 16170)


--- freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noalsa_noc++/mod_gsmopen/gsmopen_protocol.c	                        (rev 0)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noalsa_noc++/mod_gsmopen/gsmopen_protocol.c	2010-01-06 12:29:05 UTC (rev 16170)
@@ -0,0 +1 @@
+link ../../gsmopen_protocol.cpp
\ No newline at end of file
Property changes on: freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noalsa_noc++/mod_gsmopen/gsmopen_protocol.c
___________________________________________________________________
Name: svn:special
   + *

Added: freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noalsa_noc++/mod_gsmopen/mod_gsmopen.c (0 => 16170)


--- freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noalsa_noc++/mod_gsmopen/mod_gsmopen.c	                        (rev 0)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noalsa_noc++/mod_gsmopen/mod_gsmopen.c	2010-01-06 12:29:05 UTC (rev 16170)
@@ -0,0 +1 @@
+link ../../mod_gsmopen.cpp
\ No newline at end of file
Property changes on: freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noalsa_noc++/mod_gsmopen/mod_gsmopen.c
___________________________________________________________________
Name: svn:special
   + *

Added: freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noc++/mod_gsmopen/Makefile (0 => 16170)


--- freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noc++/mod_gsmopen/Makefile	                        (rev 0)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noc++/mod_gsmopen/Makefile	2010-01-06 12:29:05 UTC (rev 16170)
@@ -0,0 +1,6 @@
+MODNAME=mod_gsmopen
+SVNDEF := -D'GSMOPEN_SVN_VERSION="$(shell svnversion -n .)"'
+LOCAL_CFLAGS += $(SVNDEF) -Wno-error=address -DNO_GSMLIB
+LOCAL_LDFLAGS=-lasound 
+LOCAL_OBJS=gsmopen_protocol.o 
+include ../../../../../../build/modmake.rules

Added: freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noc++/mod_gsmopen/gsmopen.h (0 => 16170)


--- freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noc++/mod_gsmopen/gsmopen.h	                        (rev 0)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noc++/mod_gsmopen/gsmopen.h	2010-01-06 12:29:05 UTC (rev 16170)
@@ -0,0 +1 @@
+link ../../gsmopen.h
\ No newline at end of file
Property changes on: freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noc++/mod_gsmopen/gsmopen.h
___________________________________________________________________
Name: svn:special
   + *

Added: freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noc++/mod_gsmopen/gsmopen_protocol.c (0 => 16170)


--- freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noc++/mod_gsmopen/gsmopen_protocol.c	                        (rev 0)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noc++/mod_gsmopen/gsmopen_protocol.c	2010-01-06 12:29:05 UTC (rev 16170)
@@ -0,0 +1 @@
+link ../../gsmopen_protocol.cpp
\ No newline at end of file
Property changes on: freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noc++/mod_gsmopen/gsmopen_protocol.c
___________________________________________________________________
Name: svn:special
   + *

Added: freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noc++/mod_gsmopen/mod_gsmopen.c (0 => 16170)


--- freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noc++/mod_gsmopen/mod_gsmopen.c	                        (rev 0)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noc++/mod_gsmopen/mod_gsmopen.c	2010-01-06 12:29:05 UTC (rev 16170)
@@ -0,0 +1 @@
+link ../../mod_gsmopen.cpp
\ No newline at end of file
Property changes on: freeswitch/branches/gmaruzz/mod_gsmopen/nogsmlib_noc++/mod_gsmopen/mod_gsmopen.c
___________________________________________________________________
Name: svn:special
   + *