From 4293c6165a17103edbdacb9971a8724bba275d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Sun, 23 Oct 2016 14:49:34 +0200 Subject: New upstream version 1.37.91 --- CMakeLists.txt | 4 ++-- ChangeLog | 8 +++++++ cmake/FindMySQL.cmake | 21 +++++++++++++----- description-pak | 2 +- docs/man/gammu-backup.5 | 2 +- docs/man/gammu-config.1 | 2 +- docs/man/gammu-detect.1 | 2 +- docs/man/gammu-smsbackup.5 | 2 +- docs/man/gammu-smsd-dbi.7 | 2 +- docs/man/gammu-smsd-files.7 | 2 +- docs/man/gammu-smsd-inject.1 | 2 +- docs/man/gammu-smsd-monitor.1 | 2 +- docs/man/gammu-smsd-mysql.7 | 2 +- docs/man/gammu-smsd-null.7 | 2 +- docs/man/gammu-smsd-odbc.7 | 12 +++++++++- docs/man/gammu-smsd-pgsql.7 | 2 +- docs/man/gammu-smsd-run.7 | 2 +- docs/man/gammu-smsd-sql.7 | 2 +- docs/man/gammu-smsd-tables.7 | 2 +- docs/man/gammu-smsd.1 | 2 +- docs/man/gammu-smsdrc.5 | 2 +- docs/man/gammu.1 | 2 +- docs/man/gammurc.5 | 2 +- docs/man/jadmaker.1 | 2 +- docs/manual/smsd/odbc.rst | 7 ++++++ docs/manual/smsd/smsd.rst | 26 +++++++++++++++++++++- gammu.spec | 4 ++-- gammu/CMakeTests.txt | 7 ++++++ gammu/test-incoming.sh.in | 16 +++++++++++++ libgammu/api.c | 7 ++++++ libgammu/gsmphones.c | 2 ++ libgammu/gsmstate.h | 4 ++++ libgammu/phone/alcatel/alcatel.c | 3 ++- libgammu/phone/at/atgen.c | 4 +++- libgammu/phone/atobex/atobex.c | 3 ++- libgammu/phone/dummy/dummy.c | 37 ++++++++++++++++++++++++++++++- libgammu/phone/nokia/dct3/n0650.c | 3 ++- libgammu/phone/nokia/dct3/n6110.c | 3 ++- libgammu/phone/nokia/dct3/n7110.c | 3 ++- libgammu/phone/nokia/dct3/n9210.c | 3 ++- libgammu/phone/nokia/dct4s40/6510/n6510.c | 3 ++- libgammu/phone/nokia/dct4s40/n3320.c | 3 ++- libgammu/phone/nokia/nauto.c | 3 ++- libgammu/phone/nokia/wd2/n3650.c | 3 ++- libgammu/phone/obex/obexgen.c | 3 ++- libgammu/phone/s60/s60phone.c | 3 ++- libgammu/phone/symbian/gnapgen.c | 3 ++- libgammu/protocol/at/at.c | 1 + locale/id/libgammu.po | 13 +++++------ smsd/services/sql.c | 21 +++++++++++++----- 50 files changed, 214 insertions(+), 59 deletions(-) create mode 100644 gammu/test-incoming.sh.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 9cba3de..fe6e45f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,14 +28,14 @@ if (LARGE_FILES) endif (LARGE_FILES) # Set version -set (GAMMU_VERSION "1.37.90" CACHE INTERNAL "") +set (GAMMU_VERSION "1.37.91" CACHE INTERNAL "") string (REGEX REPLACE "^([0-9]*)\\.([0-9]*)\\.([0-9]*)$" "\\1" "GAMMU_VERSION_MAJOR" "${GAMMU_VERSION}") string (REGEX REPLACE "^([0-9]*)\\.([0-9]*)\\.([0-9]*)$" "\\2" "GAMMU_VERSION_MINOR" "${GAMMU_VERSION}") string (REGEX REPLACE "^([0-9]*)\\.([0-9]*)\\.([0-9]*)$" "\\3" "GAMMU_VERSION_PATCH" "${GAMMU_VERSION}") math(EXPR GAMMU_VERSION_NUM "${GAMMU_VERSION_MAJOR} * 10000 + ${GAMMU_VERSION_MINOR} * 100 + ${GAMMU_VERSION_PATCH}") message (STATUS "Configuring ${CMAKE_PROJECT_NAME} ${GAMMU_VERSION}") -set (GAMMU_SOVERSION "7" CACHE INTERNAL "") +set (GAMMU_SOVERSION "8" CACHE INTERNAL "") if ("${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") message ("Warning: In tree build is not recommended way to build Gammu.") diff --git a/ChangeLog b/ChangeLog index 5a310a0..67837c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,14 @@ the issue. ChangeLog ========= +20161023 - 1.37.91 + +[!] * Changed version of the shared library. +[-] * Improved support for ZTE MF100. +[-] * Ignore unsolicited +CLCC: reply. +[-] * Correctly report when some SMSD SQL backend is not compiled in. +[-] * Fix build of MySQL backend on Linux. + 20161018 - 1.37.90 [-] * Improved support Huawei K3770. diff --git a/cmake/FindMySQL.cmake b/cmake/FindMySQL.cmake index 453ea43..4ae071a 100644 --- a/cmake/FindMySQL.cmake +++ b/cmake/FindMySQL.cmake @@ -96,8 +96,8 @@ endif() set(TMP_MYSQL_LIBRARIES "") -foreach(LIB ${MYSQL_ADD_LIBRARIES}) - if (WIN32) +if (WIN32) + foreach(LIB ${MYSQL_ADD_LIBRARIES}) find_library("MYSQL_LIBRARIES_${LIB}" NAMES ${LIB} PATHS ${MYSQL_ADD_LIBRARY_PATH} @@ -113,9 +113,20 @@ foreach(LIB ${MYSQL_ADD_LIBRARIES}) $ENV{SystemDrive}/MySQL/*/lib/opt "C:/Program Files/MySQL/*/lib/opt" ) - endif() - list(APPEND TMP_MYSQL_LIBRARIES "${MYSQL_LIBRARIES_${LIB}}") -endforeach(LIB ${MYSQL_ADD_LIBRARIES}) + list(APPEND TMP_MYSQL_LIBRARIES "${MYSQL_LIBRARIES_${LIB}}") + endforeach(LIB ${MYSQL_ADD_LIBRARIES}) +else() + find_library("MYSQL_LIBRARIES_mysqlclient" NAMES mysqlclient + PATHS + ${MYSQL_ADD_LIBRARY_PATH} + /usr/lib/mysql + /usr/local/lib + /usr/local/lib/mysql + /usr/local/mysql/lib + ) + + list(APPEND TMP_MYSQL_LIBRARIES "${MYSQL_LIBRARIES_mysqlclient}") +endif() if (TMP_MYSQL_LIBRARIES) set(MYSQL_LIBRARIES ${TMP_MYSQL_LIBRARIES} CACHE FILEPATH "MySQL Libraries" FORCE) diff --git a/description-pak b/description-pak index dfe0ff5..d95ada5 100644 --- a/description-pak +++ b/description-pak @@ -1,4 +1,4 @@ -Gammu (Gammu All Mobile Management Utilities) 1.37.90 +Gammu (Gammu All Mobile Management Utilities) 1.37.91 Gammu is a command line utility and library to work with mobile phones from many vendors. Support for different models differs, but basic diff --git a/docs/man/gammu-backup.5 b/docs/man/gammu-backup.5 index e6e2406..1e1e1fd 100644 --- a/docs/man/gammu-backup.5 +++ b/docs/man/gammu-backup.5 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU-BACKUP" "5" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU-BACKUP" "5" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu-backup \- gammu(1) backup file format. . diff --git a/docs/man/gammu-config.1 b/docs/man/gammu-config.1 index 6fb367f..e373891 100644 --- a/docs/man/gammu-config.1 +++ b/docs/man/gammu-config.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU-CONFIG" "1" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU-CONFIG" "1" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu-config \- Gammu configurator . diff --git a/docs/man/gammu-detect.1 b/docs/man/gammu-detect.1 index 9be1995..3dc6527 100644 --- a/docs/man/gammu-detect.1 +++ b/docs/man/gammu-detect.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU-DETECT" "1" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU-DETECT" "1" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu-detect \- Gammu device detection . diff --git a/docs/man/gammu-smsbackup.5 b/docs/man/gammu-smsbackup.5 index c4601f2..c46ea3d 100644 --- a/docs/man/gammu-smsbackup.5 +++ b/docs/man/gammu-smsbackup.5 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU-SMSBACKUP" "5" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU-SMSBACKUP" "5" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu-smsbackup \- gammu(1) SMS backup file format. . diff --git a/docs/man/gammu-smsd-dbi.7 b/docs/man/gammu-smsd-dbi.7 index acc9077..e9c0d35 100644 --- a/docs/man/gammu-smsd-dbi.7 +++ b/docs/man/gammu-smsd-dbi.7 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU-SMSD-DBI" "7" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU-SMSD-DBI" "7" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu-smsd-dbi \- gammu-smsd(1) backend using DBI abstraction layer to use any supported database as a message storage . diff --git a/docs/man/gammu-smsd-files.7 b/docs/man/gammu-smsd-files.7 index 9eafe59..b245621 100644 --- a/docs/man/gammu-smsd-files.7 +++ b/docs/man/gammu-smsd-files.7 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU-SMSD-FILES" "7" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU-SMSD-FILES" "7" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu-smsd-files \- gammu-smsd(1) backend using filesystem as a message storage . diff --git a/docs/man/gammu-smsd-inject.1 b/docs/man/gammu-smsd-inject.1 index c985884..1b55f14 100644 --- a/docs/man/gammu-smsd-inject.1 +++ b/docs/man/gammu-smsd-inject.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU-SMSD-INJECT" "1" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU-SMSD-INJECT" "1" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu-smsd-inject \- Inject messages into queue of SMS daemon for Gammu . diff --git a/docs/man/gammu-smsd-monitor.1 b/docs/man/gammu-smsd-monitor.1 index c891f91..fab9d3e 100644 --- a/docs/man/gammu-smsd-monitor.1 +++ b/docs/man/gammu-smsd-monitor.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU-SMSD-MONITOR" "1" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU-SMSD-MONITOR" "1" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu-smsd-monitor \- Monitor state of SMS daemon for Gammu . diff --git a/docs/man/gammu-smsd-mysql.7 b/docs/man/gammu-smsd-mysql.7 index fd04cb9..311404b 100644 --- a/docs/man/gammu-smsd-mysql.7 +++ b/docs/man/gammu-smsd-mysql.7 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU-SMSD-MYSQL" "7" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU-SMSD-MYSQL" "7" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu-smsd-mysql \- gammu-smsd(1) backend using MySQL database server as a message storage . diff --git a/docs/man/gammu-smsd-null.7 b/docs/man/gammu-smsd-null.7 index 5d6fc67..3a7f08f 100644 --- a/docs/man/gammu-smsd-null.7 +++ b/docs/man/gammu-smsd-null.7 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU-SMSD-NULL" "7" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU-SMSD-NULL" "7" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu-smsd-null \- gammu-smsd(1) backend not storing messages . diff --git a/docs/man/gammu-smsd-odbc.7 b/docs/man/gammu-smsd-odbc.7 index 06fb62e..a74d148 100644 --- a/docs/man/gammu-smsd-odbc.7 +++ b/docs/man/gammu-smsd-odbc.7 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU-SMSD-ODBC" "7" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU-SMSD-ODBC" "7" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu-smsd-odbc \- gammu-smsd(1) backend using ODBC abstraction layer to use any supported database as a message storage . @@ -61,6 +61,16 @@ this manual to do that. You specify data source name (DSN) as \fBHost\fP in gammu\-smsdrc\&. The data source is configured depending on your platform. .sp +\fBNOTE:\fP +.INDENT 0.0 +.INDENT 3.5 +Please remember that SMSD might be running in different context than your +user (separate account on Linux or as as service on Windows), so the ODBC +DSN needs to be configured as system wide in this case (system DSN on +Windows or in global configuration on Linux). +.UNINDENT +.UNINDENT +.sp On Microsoft Windows, you can find instructions on Microsoft website: \fI\%http://support.microsoft.com/kb/305599\fP .sp diff --git a/docs/man/gammu-smsd-pgsql.7 b/docs/man/gammu-smsd-pgsql.7 index 40928ef..2be9867 100644 --- a/docs/man/gammu-smsd-pgsql.7 +++ b/docs/man/gammu-smsd-pgsql.7 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU-SMSD-PGSQL" "7" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU-SMSD-PGSQL" "7" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu-smsd-pgsql \- gammu-smsd(1) backend using PostgreSQL database server as a message storage . diff --git a/docs/man/gammu-smsd-run.7 b/docs/man/gammu-smsd-run.7 index 178cbd7..86fcc01 100644 --- a/docs/man/gammu-smsd-run.7 +++ b/docs/man/gammu-smsd-run.7 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU-SMSD-RUN" "7" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU-SMSD-RUN" "7" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu-smsd-run \- documentation for RunOnReceive directive . diff --git a/docs/man/gammu-smsd-sql.7 b/docs/man/gammu-smsd-sql.7 index b1d05ef..6d1034c 100644 --- a/docs/man/gammu-smsd-sql.7 +++ b/docs/man/gammu-smsd-sql.7 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU-SMSD-SQL" "7" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU-SMSD-SQL" "7" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu-smsd-sql \- gammu-smsd(1) backend using SQL abstraction layer to use any supported database as a message storage . diff --git a/docs/man/gammu-smsd-tables.7 b/docs/man/gammu-smsd-tables.7 index ed78880..4d4f0c9 100644 --- a/docs/man/gammu-smsd-tables.7 +++ b/docs/man/gammu-smsd-tables.7 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU-SMSD-TABLES" "7" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU-SMSD-TABLES" "7" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu-smsd-tables \- description of tables for database backends of gammu-smsd(1) . diff --git a/docs/man/gammu-smsd.1 b/docs/man/gammu-smsd.1 index 0f448c7..c37a454 100644 --- a/docs/man/gammu-smsd.1 +++ b/docs/man/gammu-smsd.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU-SMSD" "1" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU-SMSD" "1" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu-smsd \- SMS daemon for Gammu . diff --git a/docs/man/gammu-smsdrc.5 b/docs/man/gammu-smsdrc.5 index 38edc16..b716d1f 100644 --- a/docs/man/gammu-smsdrc.5 +++ b/docs/man/gammu-smsdrc.5 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU-SMSDRC" "5" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU-SMSDRC" "5" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu-smsdrc \- gammu-smsd(1) configuration file . diff --git a/docs/man/gammu.1 b/docs/man/gammu.1 index 38ea0ec..1cdc650 100644 --- a/docs/man/gammu.1 +++ b/docs/man/gammu.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMU" "1" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMU" "1" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammu \- Does some neat things with your cellular phone or modem. . diff --git a/docs/man/gammurc.5 b/docs/man/gammurc.5 index dc19f6f..d359660 100644 --- a/docs/man/gammurc.5 +++ b/docs/man/gammurc.5 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "GAMMURC" "5" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "GAMMURC" "5" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME gammurc \- gammu(1) configuration file . diff --git a/docs/man/jadmaker.1 b/docs/man/jadmaker.1 index 411e74a..d339520 100644 --- a/docs/man/jadmaker.1 +++ b/docs/man/jadmaker.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "JADMAKER" "1" "Oct 18, 2016" "1.37.90" "Gammu" +.TH "JADMAKER" "1" "Oct 23, 2016" "1.37.91" "Gammu" .SH NAME jadmaker \- JAD File Generator . diff --git a/docs/manual/smsd/odbc.rst b/docs/manual/smsd/odbc.rst index 4b3475d..fd78044 100644 --- a/docs/manual/smsd/odbc.rst +++ b/docs/manual/smsd/odbc.rst @@ -43,6 +43,13 @@ this manual to do that. You specify data source name (DSN) as :config:option:`Host` in :ref:`gammu-smsdrc`. The data source is configured depending on your platform. +.. note:: + + Please remember that SMSD might be running in different context than your + user (separate account on Linux or as as service on Windows), so the ODBC + DSN needs to be configured as system wide in this case (system DSN on + Windows or in global configuration on Linux). + On Microsoft Windows, you can find instructions on Microsoft website: http://support.microsoft.com/kb/305599 diff --git a/docs/manual/smsd/smsd.rst b/docs/manual/smsd/smsd.rst index f89e6e0..78ecc2b 100644 --- a/docs/manual/smsd/smsd.rst +++ b/docs/manual/smsd/smsd.rst @@ -118,6 +118,8 @@ accepted on some platforms): .. versionadded:: 1.31.90 +.. _gammu-smsd-signals: + Signals ------- @@ -210,13 +212,35 @@ For example the command line can look like: You now should be able to get errors from SMSD even if it fails to start as a service. +.. _gammu-smsd-suspend: + +Invoking Gammu and suspending SMSD +++++++++++++++++++++++++++++++++++ + +As you can not run Gammu and Gammu SMSD at same time on signle device, you can +workaround this limitation by suspending SMSD temporarily using `SIGUSR1` and +`SIGUSR2` signals (see also :ref:`gammu-smsd-signals`): + +.. code-block:: sh + + SMSD_PID=`pidof gammu-smsd` + if [ -z "$SMSD_PID" ] ; then + echo "Failed to figure out SMSD PID!" + else + kill -SIGUSR1 $SMSD_PID + gammu identify + kill -SIGUSR2 $SMSD_PID + fi + + Known Limitations ----------------- You can not use same phone by more programs in same time. However in case you did not enable locking in :config:section:`[gammu]` section, it might be able to start the communication with phone from more programs. In this case neither -of the programs will probably work. +of the programs will probably work, see :ref:`gammu-smsd-suspend` for +workaround. There is no way to detect that SMS message is reply to another by looking at message headers. The only way to achieve this is to add some token to the diff --git a/gammu.spec b/gammu.spec index 954aba1..1275dcf 100644 --- a/gammu.spec +++ b/gammu.spec @@ -3,13 +3,13 @@ # -%define so_ver 7 +%define so_ver 8 # Change if using tar.gz sources %define extension bz2 Name: gammu -Version: 1.37.90 +Version: 1.37.91 Release: 0 Summary: Mobile phone management utility License: GPL-2.0 diff --git a/gammu/CMakeTests.txt b/gammu/CMakeTests.txt index 41d4cc1..d3809e6 100644 --- a/gammu/CMakeTests.txt +++ b/gammu/CMakeTests.txt @@ -221,6 +221,13 @@ if (WITH_BACKUP) ) endif (WITH_BACKUP) +# TODO For some reason this test fails on Windows +if (NOT WIN32) + configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/test-incoming.sh.in" "${CMAKE_CURRENT_BINARY_DIR}/test-incoming.sh" ESCAPE_QUOTES) + add_test(NAME "gammu-incoming" COMMAND "${SH_BIN}" "${CMAKE_CURRENT_BINARY_DIR}/test-incoming.sh" "${CMAKE_CURRENT_BINARY_DIR}/gammu${CMAKE_EXECUTABLE_SUFFIX}" "${CMAKE_CURRENT_BINARY_DIR}") + set_tests_properties("gammu-incoming" PROPERTIES PASS_REGULAR_EXPRESSION "incoming call from \"\\+800123456\"") +endif() + gammu_test(monitor GammuTel 1) gammu_test(battery "Lithium Polymer") gammu_test(networkinfo "B00B.*FACE") diff --git a/gammu/test-incoming.sh.in b/gammu/test-incoming.sh.in new file mode 100644 index 0000000..88afc86 --- /dev/null +++ b/gammu/test-incoming.sh.in @@ -0,0 +1,16 @@ +#!@SH_BIN@ + +set -x +set -e + +EXE="$1" +CMAKE_CURRENT_BINARY_DIR="$2" + +cd "$CMAKE_CURRENT_BINARY_DIR" + +CONFIG="$CMAKE_CURRENT_BINARY_DIR/.gammurc" +DUMMY="$CMAKE_CURRENT_BINARY_DIR/.gammu-dummy" + +touch $DUMMY/incoming-call + +exec "$EXE" -c "$CONFIG" monitor 1 diff --git a/libgammu/api.c b/libgammu/api.c index 3ae8dbb..4ed04b6 100644 --- a/libgammu/api.c +++ b/libgammu/api.c @@ -2,6 +2,7 @@ #include #include "gsmstate.h" +#include "gsmcomon.h" #include "debug.h" #ifdef __FUNCTION__WORKING @@ -40,6 +41,12 @@ if (!GSM_IsConnected(s)) { \ return ERR_NOTCONNECTED; \ } \ + if (s->Phone.Functions->PreAPICall != NONEFUNCTION) { \ + err = s->Phone.Functions->PreAPICall(s); \ + if (err != ERR_NONE) { \ + return err; \ + } \ + } \ } /** diff --git a/libgammu/gsmphones.c b/libgammu/gsmphones.c index 6f0c2b8..2f6a457 100644 --- a/libgammu/gsmphones.c +++ b/libgammu/gsmphones.c @@ -971,6 +971,7 @@ GSM_PhoneModel allmodels[] = { {"K4511", "K4511", "", {F_SMS_LOCATION_0, F_ENCODED_USSD, F_FOUR_DIGIT_YEAR, F_RESET_AFTER_TIMEOUT, F_HUAWEI_INIT, 0}}, /* ZTE */ + {"MF100", "MF100", "", {F_ZTE_INIT, 0}}, {"MF190", "MF190", "", {F_ZTE_INIT, 0}}, /* Ubinetics */ @@ -981,6 +982,7 @@ GSM_PhoneModel allmodels[] = { /* Other */ {"SIMCOM_SIM300D","SIMCOM_SIM300D","", {F_ENCODED_USSD, 0}}, + {"SIMCOM_SIM900","SIMCOM_SIM900","", {0}}, /* Qualcomm */ {"HP un2420 Mobile Broadband Module", "un2420", "", {F_NO_STOP_CUSD, 0}}, diff --git a/libgammu/gsmstate.h b/libgammu/gsmstate.h index 2d665ea..2ca0b21 100644 --- a/libgammu/gsmstate.h +++ b/libgammu/gsmstate.h @@ -1311,6 +1311,10 @@ typedef struct { * Post connect hook */ GSM_Error (*PostConnect) (GSM_StateMachine *s); + /** + * API action hook, executed before API call + */ + GSM_Error (*PreAPICall)(GSM_StateMachine *s); } GSM_Phone_Functions; extern GSM_Phone_Functions NAUTOPhone; diff --git a/libgammu/phone/alcatel/alcatel.c b/libgammu/phone/alcatel/alcatel.c index 9ad9b44..d926f69 100644 --- a/libgammu/phone/alcatel/alcatel.c +++ b/libgammu/phone/alcatel/alcatel.c @@ -4204,7 +4204,8 @@ GSM_Phone_Functions ALCATELPhone = { NOTSUPPORTED, /* SetGPRSAccessPoint */ NOTSUPPORTED, /* GetScreenshot */ NOTSUPPORTED, /* SetPower */ - NOTSUPPORTED /* PostConnect */ + NOTSUPPORTED, /* PostConnect */ + NONEFUNCTION /* PreAPICall */ }; #endif diff --git a/libgammu/phone/at/atgen.c b/libgammu/phone/at/atgen.c index 067f5d4..e13684e 100644 --- a/libgammu/phone/at/atgen.c +++ b/libgammu/phone/at/atgen.c @@ -6215,6 +6215,7 @@ GSM_Reply_Function ATGENReplyFunctions[] = { {ATGEN_GenericReplyIgnore, "+ZUSIMR:" ,0x00,0x00,ID_IncomingFrame }, {ATGEN_GenericReplyIgnore, "+ZEND" ,0x00,0x00,ID_IncomingFrame }, {ATGEN_GenericReplyIgnore, "+CDSI:" ,0x00,0x00,ID_IncomingFrame }, +{ATGEN_GenericReplyIgnore, "+CLCC:" ,0x00,0x00,ID_IncomingFrame }, /* Sony Ericsson screenshot */ {SONYERICSSON_Reply_Screenshot, "AT*ZISI=?\r", 0x00,0x00,ID_Screenshot }, @@ -6407,7 +6408,8 @@ GSM_Phone_Functions ATGENPhone = { NOTSUPPORTED, /* SetGPRSAccessPoint */ SONYERICSSON_GetScreenshot, ATGEN_SetPower, - ATGEN_PostConnect + ATGEN_PostConnect, + NONEFUNCTION /* PreAPICall */ }; #endif diff --git a/libgammu/phone/atobex/atobex.c b/libgammu/phone/atobex/atobex.c index fcf0953..b31213c 100644 --- a/libgammu/phone/atobex/atobex.c +++ b/libgammu/phone/atobex/atobex.c @@ -1677,7 +1677,8 @@ GSM_Phone_Functions ATOBEXPhone = { NOTSUPPORTED, /* SetGPRSAccessPoint */ SONYERICSSON_GetScreenshot, /* GetScreenshot */ ATOBEX_SetPower, - NOTSUPPORTED /* PostConnect */ + NOTSUPPORTED, /* PostConnect */ + NONEFUNCTION /* PreAPICall */ }; #endif diff --git a/libgammu/phone/dummy/dummy.c b/libgammu/phone/dummy/dummy.c index 778e682..e34998e 100644 --- a/libgammu/phone/dummy/dummy.c +++ b/libgammu/phone/dummy/dummy.c @@ -1921,6 +1921,40 @@ GSM_Error DUMMY_GetBatteryCharge(GSM_StateMachine *s, GSM_BatteryCharge *bat) return ERR_NONE; } +GSM_Error DUMMY_PreAPICall(GSM_StateMachine *s) +{ + char *path; + struct stat sb; + GSM_Error error = ERR_NONE; + GSM_Call call; + + /* Check for incoming call trigger */ + if (s->Phone.Data.EnableIncomingCall && s->User.IncomingCall != NULL) { + path = DUMMY_GetFilePath(s, "incoming-call"); + if (path == NULL) { + return ERR_MOREMEMORY; + } + if (stat(path, &sb) == 0) { + smprintf(s, "Incoming call!\n"); + + memset(&call, 0, sizeof(call)); + + call.Status = 0; + call.StatusCode = 0; + call.CallIDAvailable = FALSE; + call.Status = GSM_CALL_IncomingCall; + call.CallIDAvailable = TRUE; + EncodeUnicode(call.PhoneNumber, "+800123456", 11); + + s->User.IncomingCall(s, &call, s->User.IncomingCallUserData); + + unlink(path); + } + free(path); + } + return error; +} + /*@}*/ GSM_Reply_Function DUMMYReplyFunctions[] = { @@ -2068,7 +2102,8 @@ GSM_Phone_Functions DUMMYPhone = { NOTSUPPORTED, /* SetGPRSAccessPoint */ NOTSUPPORTED, /* GetScreenshot */ NOTSUPPORTED, /* SetPower */ - NOTSUPPORTED /* PostConnect */ + NOTSUPPORTED, /* PostConnect */ + DUMMY_PreAPICall }; /*@}*/ diff --git a/libgammu/phone/nokia/dct3/n0650.c b/libgammu/phone/nokia/dct3/n0650.c index 9ec1d1c..4c1ee15 100644 --- a/libgammu/phone/nokia/dct3/n0650.c +++ b/libgammu/phone/nokia/dct3/n0650.c @@ -157,7 +157,8 @@ GSM_Phone_Functions N650Phone = { NOTSUPPORTED, /* SetGPRSAccessPoint */ NOTSUPPORTED, /* GetScreenshot */ NOTSUPPORTED, /* SetPower */ - NOTSUPPORTED /* PostConnect */ + NOTSUPPORTED, /* PostConnect */ + NONEFUNCTION /* PreAPICall */ }; #endif diff --git a/libgammu/phone/nokia/dct3/n6110.c b/libgammu/phone/nokia/dct3/n6110.c index fe19b02..ee7924d 100644 --- a/libgammu/phone/nokia/dct3/n6110.c +++ b/libgammu/phone/nokia/dct3/n6110.c @@ -2936,7 +2936,8 @@ GSM_Phone_Functions N6110Phone = { NOTSUPPORTED, /* SetGPRSAccessPoint */ NOTSUPPORTED, /* GetScreenshot */ NOTSUPPORTED, /* SetPower */ - NOTSUPPORTED /* PostConnect */ + NOTSUPPORTED, /* PostConnect */ + NONEFUNCTION /* PreAPICall */ }; #endif diff --git a/libgammu/phone/nokia/dct3/n7110.c b/libgammu/phone/nokia/dct3/n7110.c index a4572e6..0807a4b 100644 --- a/libgammu/phone/nokia/dct3/n7110.c +++ b/libgammu/phone/nokia/dct3/n7110.c @@ -1779,7 +1779,8 @@ GSM_Phone_Functions N7110Phone = { NOTSUPPORTED, /* SetGPRSAccessPoint */ NOTSUPPORTED, /* GetScreenshot */ NOTSUPPORTED, /* SetPower */ - NOTSUPPORTED /* PostConnect */ + NOTSUPPORTED, /* PostConnect */ + NONEFUNCTION /* PreAPICall */ }; #endif diff --git a/libgammu/phone/nokia/dct3/n9210.c b/libgammu/phone/nokia/dct3/n9210.c index b1e3e3b..c0860d7 100644 --- a/libgammu/phone/nokia/dct3/n9210.c +++ b/libgammu/phone/nokia/dct3/n9210.c @@ -408,7 +408,8 @@ GSM_Phone_Functions N9210Phone = { NOTSUPPORTED, /* SetGPRSAccessPoint */ NOTSUPPORTED, /* GetScreenshot */ NOTSUPPORTED, /* SetPower */ - NOTSUPPORTED /* PostConnect */ + NOTSUPPORTED, /* PostConnect */ + NONEFUNCTION /* PreAPICall */ }; #endif diff --git a/libgammu/phone/nokia/dct4s40/6510/n6510.c b/libgammu/phone/nokia/dct4s40/6510/n6510.c index cde4ff7..86f1cdc 100644 --- a/libgammu/phone/nokia/dct4s40/6510/n6510.c +++ b/libgammu/phone/nokia/dct4s40/6510/n6510.c @@ -4616,7 +4616,8 @@ GSM_Phone_Functions N6510Phone = { N6510_SetGPRSAccessPoint, DCT4_Screenshot, NOTSUPPORTED, /* SetPower */ - NOTSUPPORTED /* PostConnect */ + NOTSUPPORTED, /* PostConnect */ + NONEFUNCTION /* PreAPICall */ }; #endif diff --git a/libgammu/phone/nokia/dct4s40/n3320.c b/libgammu/phone/nokia/dct4s40/n3320.c index e730902..3da384b 100644 --- a/libgammu/phone/nokia/dct4s40/n3320.c +++ b/libgammu/phone/nokia/dct4s40/n3320.c @@ -282,7 +282,8 @@ GSM_Phone_Functions N3320Phone = { NOTSUPPORTED, /* SetGPRSAccessPoint */ NOTSUPPORTED, /* GetScreenshot */ NOTSUPPORTED, /* SetPower */ - NOTSUPPORTED /* PostConnect */ + NOTSUPPORTED, /* PostConnect */ + NONEFUNCTION /* PreAPICall */ }; #endif diff --git a/libgammu/phone/nokia/nauto.c b/libgammu/phone/nokia/nauto.c index 82ee1e7..6633723 100644 --- a/libgammu/phone/nokia/nauto.c +++ b/libgammu/phone/nokia/nauto.c @@ -176,7 +176,8 @@ GSM_Phone_Functions NAUTOPhone = { NOTSUPPORTED, /* SetGPRSAccessPoint */ NOTSUPPORTED, /* GetScreenshot */ NOTSUPPORTED, /* SetPower */ - NOTSUPPORTED /* PostConnect */ + NOTSUPPORTED, /* PostConnect */ + NONEFUNCTION /* PreAPICall */ }; #endif diff --git a/libgammu/phone/nokia/wd2/n3650.c b/libgammu/phone/nokia/wd2/n3650.c index 8a68da3..e0ba708 100644 --- a/libgammu/phone/nokia/wd2/n3650.c +++ b/libgammu/phone/nokia/wd2/n3650.c @@ -417,7 +417,8 @@ GSM_Phone_Functions N3650Phone = { NOTSUPPORTED, /* SetGPRSAccessPoint */ NOTSUPPORTED, /* GetScreenshot */ NOTSUPPORTED, /* SetPower */ - NOTSUPPORTED /* PostConnect */ + NOTSUPPORTED, /* PostConnect */ + NONEFUNCTION /* PreAPICall */ }; #endif diff --git a/libgammu/phone/obex/obexgen.c b/libgammu/phone/obex/obexgen.c index 4802023..e6751ae 100644 --- a/libgammu/phone/obex/obexgen.c +++ b/libgammu/phone/obex/obexgen.c @@ -3924,7 +3924,8 @@ GSM_Phone_Functions OBEXGENPhone = { NOTSUPPORTED, /* SetGPRSAccessPoint */ NOTSUPPORTED, /* GetScreenshot */ NOTSUPPORTED, /* SetPower */ - NOTSUPPORTED /* PostConnect */ + NOTSUPPORTED, /* PostConnect */ + NONEFUNCTION /* PreAPICall */ }; #endif diff --git a/libgammu/phone/s60/s60phone.c b/libgammu/phone/s60/s60phone.c index 369098e..24e3882 100644 --- a/libgammu/phone/s60/s60phone.c +++ b/libgammu/phone/s60/s60phone.c @@ -2191,7 +2191,8 @@ GSM_Phone_Functions S60Phone = { NOTSUPPORTED, /* SetGPRSAccessPoint */ S60_GetScreenshot, NOTSUPPORTED, /* SetPower */ - NOTSUPPORTED /* PostConnect */ + NOTSUPPORTED, /* PostConnect */ + NONEFUNCTION /* PreAPICall */ }; #endif diff --git a/libgammu/phone/symbian/gnapgen.c b/libgammu/phone/symbian/gnapgen.c index feeec5d..5b0f0e6 100644 --- a/libgammu/phone/symbian/gnapgen.c +++ b/libgammu/phone/symbian/gnapgen.c @@ -1984,7 +1984,8 @@ GSM_Phone_Functions GNAPGENPhone = { NOTSUPPORTED, /* SetGPRSAccessPoint */ NOTSUPPORTED, /* GetScreenshot */ NOTSUPPORTED, /* SetPower */ - NOTSUPPORTED /* PostConnect */ + NOTSUPPORTED, /* PostConnect */ + NONEFUNCTION /* PreAPICall */ }; #endif diff --git a/libgammu/protocol/at/at.c b/libgammu/protocol/at/at.c index 620bd62..a0713a7 100644 --- a/libgammu/protocol/at/at.c +++ b/libgammu/protocol/at/at.c @@ -96,6 +96,7 @@ GSM_Error AT_StateMachine(GSM_StateMachine *s, unsigned char rx_char) {"+CLIP" ,1, ID_All}, {"+CRING" ,1, ID_All}, {"+CCWA" ,1, ID_All}, + {"+CLCC" ,1, ID_All}, /* Standard AT */ {"RING" ,1, ID_All}, diff --git a/locale/id/libgammu.po b/locale/id/libgammu.po index 93e4ad5..993218c 100644 --- a/locale/id/libgammu.po +++ b/locale/id/libgammu.po @@ -7,15 +7,16 @@ msgstr "" "Project-Id-Version: libGammu 1.37.90\n" "Report-Msgid-Bugs-To: gammu-users@lists.sourceforge.net\n" "POT-Creation-Date: 2016-10-11 08:16+0200\n" -"PO-Revision-Date: 2012-03-29 17:19+0200\n" -"Last-Translator: Michal Čihař \n" -"Language-Team: none\n" +"PO-Revision-Date: 2016-10-22 17:05+0000\n" +"Last-Translator: Kiswanto D \n" +"Language-Team: Indonesian " +"\n" "Language: id\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 0.8\n" +"X-Generator: Weblate 2.9-dev\n" #: libgammu/gsmcomon.c:84 msgid "No error." @@ -382,10 +383,8 @@ msgid "Failed to configure DB driver." msgstr "Gagal menghubung ke telepon" #: libgammu/gsmcomon.c:160 -#, fuzzy -#| msgid "Failed to connect to phone" msgid "Failed to connect to database." -msgstr "Gagal menghubung ke telepon" +msgstr "Gagal terhubung ke database." #: libgammu/gsmcomon.c:161 #, fuzzy diff --git a/smsd/services/sql.c b/smsd/services/sql.c index 34c2855..d3a0191 100644 --- a/smsd/services/sql.c +++ b/smsd/services/sql.c @@ -1314,24 +1314,33 @@ GSM_Error SMSDSQL_ReadConfiguration(GSM_SMSDConfig *Config) } Config->db = NULL; -#ifdef HAVE_MYSQL_MYSQL_H if (!strcasecmp(Config->driver, "native_mysql")) { +#ifdef HAVE_MYSQL_MYSQL_H Config->db = &SMSDMySQL; - } +#else + SMSD_Log(DEBUG_ERROR, Config, "The %s driver was not compiled in!", Config->driver); + return ERR_DISABLED; #endif -#ifdef HAVE_POSTGRESQL_LIBPQ_FE_H + } if (!strcasecmp(Config->driver, "native_pgsql")) { +#ifdef HAVE_POSTGRESQL_LIBPQ_FE_H Config->db = &SMSDPgSQL; - } +#else + SMSD_Log(DEBUG_ERROR, Config, "The %s driver was not compiled in!", Config->driver); + return ERR_DISABLED; #endif -#ifdef ODBC_FOUND + } if (!strcasecmp(Config->driver, "odbc")) { +#ifdef ODBC_FOUND Config->db = &SMSDODBC; if (Config->sql == NULL) { SMSD_Log(DEBUG_INFO, Config, "Using generic SQL for ODBC, this might fail. In such case please set SQL configuration option."); } - } +#else + SMSD_Log(DEBUG_ERROR, Config, "The %s driver was not compiled in!", Config->driver); + return ERR_DISABLED; #endif + } if (Config->db == NULL) { #ifdef LIBDBI_FOUND Config->db = &SMSDDBI; -- cgit v1.2.3