Overview
Gammu SMS Daemon is a program that periodically scans GSM modem for received
messages, stores them in defined storage and also sends messages enqueued in
this storage.
Overall schema
The interactions of SMS Daemon and related components can be seen on following
picture.
digraph smsdinteractions {
"gammu-smsd-inject" [shape=box];
"gammu-smsd" [shape=box];
"Run on receive" [shape=box, style=dotted];
"GSM modem" [shape=box, style=dashed];
"gammu-smsd-monitor" [shape=box];
"Service\nstorage" [shape=doublecircle];
"Kalkun" [shape=box, style=dotted];
"gammu-smsd" -> "GSM modem" [label="Outgoing"];
"GSM modem" -> "gammu-smsd" [label="Incoming"];
"gammu-smsd" -> "Service\nstorage" [label="Save"];
"Service\nstorage" -> "gammu-smsd" [label="Read"];
"gammu-smsd" -> "Run on receive" [label="Execute"];
"Service\nstorage" -> "Run on receive" [label="Read"];
"Kalkun" -> "Service\nstorage" [label="Inject"];
"Service\nstorage" -> "Kalkun" [label="Read"];
"gammu-smsd-inject" -> "Service\nstorage" [label="Inject"];
"gammu-smsd" -> "gammu-smsd-monitor" [label="Monitor"];
}
SMSD operation
The SMSD operation consist of several steps.
digraph smsloop {
start[shape="box", style=rounded, label="Startup"];
end[shape="box", style=rounded, label="Termination"];
connected[shape="diamond", style="", label="Phone connected?"];
connect[label="Connect to phone"];
security[label="Check for security code"];
receive[label="Receive messages"];
reset[label="Reset phone if needed"];
send[label="Send messages"];
status[label="Check phone status"];
sleep[label="Sleep"];
shutdown[shape="diamond", style="", label="Shutdown requested?"];
start -> connected;
connected -> connect [label="No"];
connected -> security [label="Yes"];
connect -> security;
security -> receive;
receive -> reset;
reset -> send;
send -> status;
status -> sleep;
sleep -> shutdown;
shutdown -> connected [label="No"];
shutdown -> end [label="Yes"];
}
Process command line options.
Configure backend service.
Main loop is executed until it is signalled to be terminated.
Try to connect to phone if not connected.
Check for security code if configured (configured by CheckSecurity
).
Check for received messages (frequency configured by ReceiveFrequency
).
Check for reset of the phone if configured (frequency configured by ResetFrequency
).
Check for messages to send (frequency configured by CommTimeout
).
Check phone status (frequency configured by StatusFrequency
).
Sleep for defined time (LoopSleep
).
Backend service is freed.