]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
gsmopen: works04
authorGiovanni Maruzzelli <gmaruzz@gmail.com>
Mon, 2 Apr 2012 07:26:11 +0000 (09:26 +0200)
committerGiovanni Maruzzelli <gmaruzz@gmail.com>
Mon, 2 Apr 2012 07:26:11 +0000 (09:26 +0200)
src/mod/endpoints/mod_gsmopen/Makefile
src/mod/endpoints/mod_gsmopen/gsmopen.h
src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp

index 610dfc13aea84bcbac1cb0fcbf49a6a740415006..06109af5ae4519f663e02f27ce53b619ad0cf27b 100644 (file)
@@ -1,9 +1,11 @@
 MODNAME=mod_gsmopen
 SVNDEF := -D'GSMOPEN_SVN_VERSION="$(shell svnversion -n .)"'
 #LOCAL_CFLAGS += $(SVNDEF) -I/usr/src/gsmlib-1.10
-LOCAL_CFLAGS += $(SVNDEF) -DNO_GSMLIB -DNO_ALSA -I../../../../libs/spandsp/src -I../../../..//libs/tiff-3.8.2/libtiff
+LOCAL_CFLAGS += $(SVNDEF) -DNO_GSMLIB -DNO_ALSA -I../../../../libs/spandsp/src -I../../../..//libs/tiff-3.8.2/libtiff -Ilibctb-0.16/include/
 #LOCAL_LDFLAGS=-lasound -L/usr/src/gsmlib-1.10/gsmlib/.libs -lgsmme
-LOCAL_LDFLAGS=-L../../../../libs/spandsp/src -lspandsp
-LOCAL_OBJS=gsmopen_protocol.o 
+LOCAL_LDFLAGS=-L../../../../libs/spandsp/src -lspandsp -lctb-0.16
+
+LOCAL_OBJS=gsmopen_protocol.o
 #OUR_OBJS += /usr/src/gsmlib-1.10/gsmlib/libgsmme.la
+#OUR_OBJS += libctb-0.16/lib/libctbd-0.16.a
 include ../../../../build/modmake.rules
index a3350706040ef91aa6d5d2fbc530f105f125e059..e8cd61a0a0d7ebb44d7f9eceb71e27161cc8afa5 100644 (file)
 #define GSMOPEN_SVN_VERSION SWITCH_VERSION_REVISION
 #endif /* GSMOPEN_SVN_VERSION */
 
+#include "ctb-0.16/ctb.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
 typedef enum {
        TFLAG_IO = (1 << 0),
        TFLAG_INBOUND = (1 << 1),
index e7ad4d046b91b8712367d8b464d05135b6acface..fed0996deae5aa80cad76d8b9460fa63caa10670 100644 (file)
@@ -2152,7 +2152,31 @@ static switch_status_t load_config(int reload_type)
 #endif// GSMOPEN_PORTAUDIO
                                DEBUGA_GSMOPEN("gsmopen_serial_sync_period=%d\n", GSMOPEN_P_LOG, (int)globals.GSMOPEN_INTERFACES[i].gsmopen_serial_sync_period);
                                DEBUGA_GSMOPEN("controldevice_audio_name=%s\n", GSMOPEN_P_LOG, globals.GSMOPEN_INTERFACES[i].controldevice_audio_name);
+/***********************************/
 
+                               ctb::IOBase* device = NULL;
+
+
+                               ctb::SerialPort* serialPort = new ctb::SerialPort();
+
+                               //if( serialPort->Open( devname.c_str(), baudrate,
+                               if( serialPort->Open( "/dev/ttyUSB3", 115200, "8N1", ctb::SerialPort::NoFlowControl ) >= 0 ) {
+
+                                       device = serialPort;
+
+                                       if( device->Write( "AT+CLAC\r\n", 9 ) != 7 ) {
+
+                                               ERRORA("BIZARRE\n", GSMOPEN_P_LOG);
+
+                                       }
+
+                               } else {
+
+                                       ERRORA("port NOT open\n", GSMOPEN_P_LOG);
+                               }
+
+
+/***********************************/
                        }
                }
        }