Xiaopei's DokuWiki

These are the good times in your life,
so put on a smile and it'll be alright

User Tools

Site Tools


it:gammu_smsd

Gammu SMSD

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. It is perfect tool for managing big amounts of received or sent messages and automatically process them.

tips

  • 定期清理 outbox
    /etc/cron.d/gammu
    # 每小时h并删除过时(1小时前)的未发短信(mysql backend)
    37 * * * * root mysql -u gammu sms -e "delete from outbox where timediff(now(), InsertIntoDB) > '01:00:00'"

Config

Device name always changes on Linux, how to solve that?

http://wammu.eu/docs/manual/faq/general.html#device-name-always-changes-on-linux-how-to-solve-that

设置 udev 规则, 以增加固定名称的设备链接. 在 gammu 配置中连这个名称固定的设备.

/etc/udev/rules.d/80-phone.rules
# idVendor, idProduct 由 lsusb -v 得来
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="phone"

gammu-smsd-inject

gammu-smsd-inject is a program that enqueues message in Gammu SMS Daemon, which will be later sent by the daemon using connected GSM modem.

examples

Inject text message up to standard 160 chars:

echo "All your base are belong to us" | gammu-smsd-inject TEXT 123456
# or
gammu-smsd-inject TEXT 123456 -text "All your base are belong to us"

Inject long text message:

echo "All your base are belong to us" | gammu-smsd-inject TEXT 123456 -len 400
# or
gammu-smsd-inject TEXT 123456 -len 400 -text "All your base are belong to us"
# or
gammu-smsd-inject EMS 123456 -text "All your base are belong to us"

gammu-smsd-monitor

gammu-smsd-monitor is a program that monitors state of Gammu SMS Daemon. It periodically displays information about phone and number of processed messages.

参考

it/gammu_smsd.txt · Last modified: 2013/08/19 07:22 (external edit)