gsmopen: works04
This commit is contained in:
parent
64e0a5ab0d
commit
5b98e04e49
|
@ -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
|
||||
|
|
|
@ -135,6 +135,17 @@
|
|||
#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),
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
/***********************************/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue