From a621cdee99cb3979d82d893f674919e34f57ef88 Mon Sep 17 00:00:00 2001 From: Giovanni Maruzzelli Date: Tue, 17 Apr 2012 22:54:54 +0200 Subject: [PATCH] gsmopen: added proof of concet to send pdu messages via gsmlib --- src/mod/endpoints/mod_gsmopen/Makefile | 2 +- .../mod_gsmopen/gsmopen_protocol.cpp | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_gsmopen/Makefile b/src/mod/endpoints/mod_gsmopen/Makefile index 7084df12e4..bf1920aa6f 100644 --- a/src/mod/endpoints/mod_gsmopen/Makefile +++ b/src/mod/endpoints/mod_gsmopen/Makefile @@ -1,6 +1,6 @@ MODNAME=mod_gsmopen SVNDEF := -D'GSMOPEN_SVN_VERSION="$(shell svnversion -n .)"' LOCAL_CFLAGS += $(SVNDEF) -I../../../../libs/spandsp/src -I../../../..//libs/tiff-3.8.2/libtiff -LOCAL_LDFLAGS=-L../../../../libs/spandsp/src -lspandsp -lctb-0.16 +LOCAL_LDFLAGS=-L../../../../libs/spandsp/src -lspandsp -lctb-0.16 -lgsmme LOCAL_OBJS=gsmopen_protocol.o include ../../../../build/modmake.rules diff --git a/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp b/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp index a03c2b614b..041ed8caa6 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp +++ b/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp @@ -1685,6 +1685,26 @@ read: //servicecentretimestamp = sms->serviceCentreTimestamp(); //sender_recipient_address = sms->address(); + + +#ifdef NOTDEF_SENDING_EXAMPLE + SMSMessageRef smsMessage; + // message text has probably to be in 8859-1 + smsMessage = new SMSSubmitMessage("submit me ", "3472665618"); + cout << smsMessage->toString() << endl; + string pdu = smsMessage->encode(); + cout << pdu << endl; + //cout << intToStr(pdu.length() / 2 - getSCAddressLen()) << endl; + cout << intToStr(pdu.length() / 2 - 1) << endl; + + /* + string pdu = encode(); + Parser p(_at->sendPdu("+CMGS=" + + intToStr(pdu.length() / 2 - getSCAddressLen()), + "+CMGS:", pdu)); + */ +#endif// NOTDEF_SENDING_EXAMPLE + #endif// WANT_GSMLIB