New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modem Pool with one Imei and Multiple port #334

Open
khairu-aqsara opened this Issue Aug 4, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@khairu-aqsara

khairu-aqsara commented Aug 4, 2017

i have 1 modem connected with 16 port of sim card,each config connected to same database on my server,send and receive sms all working like a charm, each port have smsd services, like

gammu-smsd -c /etc/gammu-smsdrc-modem1 --pid /var/run/gammu-smsdrc-modem1 --daemon
gammu-smsd -c /etc/gammu-smsdrc-modem2 --pid /var/run/gammu-smsdrc-modem2 --daemon

each port have their own PhoneID, like modem1 and modem2, the problem is why phones tables in gammu databases keep replacing the data with last gammu-smsd services run ?

ex: if i run the first config, then phones tables will contains all informations , like signal, IMEI from 1st port, but when i run 2nd gammu-smsd data from 1st port will gone, changed from 2nd port config

here is my smsdrc config from modem1 /etc/gammu-smsdrc-modem1

[gammu]
port = /dev/ttyUSB0
model =
connection = at115200
synchronizetime = yes
logfile = /var/log/gammu-smsdrc-modem1
logformat = nothing
use_locking =
gammuloc =

[smsd]
service=sql
logfile=/var/log/gammu-smsdrc-modem1
debuglevel=0
Driver=native_mysql
User=root
Password=root
PC=localhost
Database=test
PhoneID=modem1

here is my smsd config from modem2 /etc/gammu-smsdrc-modem2

[gammu]
port = /dev/ttyUSB1
model =
connection = at115200
synchronizetime = yes
logfile = /var/log/gammu-smsdrc-modem2
logformat = nothing
use_locking =
gammuloc =

[smsd]
service=sql
logfile=/var/log/gammu-smsdrc-modem2
debuglevel=0
Driver=native_mysql
User=root
Password=root
PC=localhost
Database=test
PhoneID=modem2

after some reading on API Doc of gammu, i have figure it out, yes like the first one, it because i use one modem with 16 port of sim card, gammu just detect singel IMEI even the modem have 16 port, quick answer for my question come from smsd/services/sql.c

if (SMSDSQL_option(Config, SQL_QUERY_DELETE_PHONE, "delete_phone",
    "DELETE FROM phones WHERE ", ESCAPE_FIELD("IMEI"), " = %I", NULL) != ERR_NONE) {
    return ERR_UNKNOWN;
}

.......
.......
.......

if (SMSDSQL_option(Config, SQL_QUERY_UPDATE_RECEIVED, "update_received",
    "UPDATE phones SET ",
        ESCAPE_FIELD("Received"), " = ", ESCAPE_FIELD("Received"), " + 1"
        " WHERE ", ESCAPE_FIELD("IMEI"), " = %I", NULL) != ERR_NONE) {
    return ERR_UNKNOWN;
}

i know i have to modify that code in other sql run trough PhoneID not By IMEI, but can we make that changes from SMSD Config File , like or similiar like this one ? because not every body can compiling the sources

[tables]
phones

[phones_key]
ID
@sikumkum

This comment has been minimized.

Show comment
Hide comment
@sikumkum

sikumkum Oct 30, 2017

i have the same problem also.. working on win10 pro with 16 modem pool..
not working

i have the same problem also.. working on win10 pro with 16 modem pool..
not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment