[Freetz-NG][smstools3] Proposed improvement for SMS eventhandler

cybermaus

Neuer User
Mitglied seit
5 Mai 2008
Beiträge
104
Punkte für Reaktionen
2
Punkte
18
Hi. I recently setup a 7560 with Freetz-NG and smstools3, so I could receive and auto-forward SMS send to my LTE modem.
See this thread.

However, the smstools3 implementation at Freetz is such that smstools3 cannot use its eventhandler.

The reason is the config file is dynamically recreated on every restart, and I found no configurable way to add the "eventhandler" stanza to the file, without it being overwritten on the next tool restart.
Eventually I simply modded the Freetz source and hardcoded it in there.

But I am wondering:
- Is this a good permanent enhancement to Freetz?
- I also made the Web UI update.
- I made the Freetz mods so that out of the box it works the same (no event handler)
- Would anyone be willing to do this for me, because I am really not comfortable pushing changes into the git repo. Actual changes made are below.

EDIT: unless if someone tells me exactly what GIT command to run:
1609500874324.png
[Edit Novize: Pic reduced to prewiev - see forum rules]
Many thanks, and keep up the good work.

----

Tweaked Freetz source: make/smstools3/files/root/etc/default.smstools3/smstools3.cfg
I added the SMSTOOLS3_EVENTS line
Code:
export SMSTOOLS3_ENABLED='no'
export SMSTOOLS3_DIR=''
export SMSTOOLS3_DEVICE='/dev/ttyUSB0'
export SMSTOOLS3_PIN=''
export SMSTOOLS3_LOGLEVEL='5'
export SMSTOOLS3_EVENTS=''

Tweaked Freetz source: make/smstools3/files/root/etc/default.smstools3/smstools3_conf
Here too I added the SMSTOOLS3_EVENTS line
PS: it works when eventhandler is empty, I tested.
Code:
#!/bin/sh

cat << EOF
devices = GSM
logfile = /var/log/smsd.log
loglevel = $SMSTOOLS3_LOGLEVEL
eventhandler = $SMSTOOLS3_EVENTS

[GSM]
device = $SMSTOOLS3_DEVICE
incoming = yes
EOF

[ -n "$SMSTOOLS3_PIN" ] && echo "pin = $SMSTOOLS3_PIN"

Tweaked Freetz source: make/smstools3/files/root/usr/lib/cgi-bin/smstools3.cgi
Yet again the SMSTOOLS3_EVENTS line
Code:
#!/bin/sh


. /usr/lib/libmodcgi.sh

sec_begin '$(lang de:"Starttyp" en:"Start type")'
cgi_print_radiogroup_service_starttype "enabled" "$SMSTOOLS3_ENABLED" "" "" 0
sec_end

sec_begin '$(lang de:"SMS senden und empfangen" en:"Send and receive SMS")'
cat << EOF
<ul>
<li><a href="$(href status smstools3)">$(lang de:"Hier klicken f&uuml;r Statusseite" en:"Click here for status page").</a></li>
</ul>
EOF
sec_end

sec_begin '$(lang de:"Konfiguration" en:"Configuration")'
cgi_print_textline_p "dir"      "$SMSTOOLS3_DIR"      50/255 \
  "$(lang de:"Datenverzeichnis" en:"data directory"): "
cgi_print_textline_p "events"   "$SMSTOOLS3_EVENTS"   50/255 \
  "$(lang de:"Event-Handler" en:"event handler"): "
cgi_print_textline_p "device"   "$SMSTOOLS3_DEVICE"   15/255 \
  "$(lang de:"UMTS-Ger&auml;t" en:"UMTS device"): "
cgi_print_textline_p "pin"      "$SMSTOOLS3_PIN"      8      \
  "PIN: " " ($(lang de:"leer lassen wenn deaktiviert" en:"leave empty if deactivated"))"
cgi_print_textline_p "loglevel" "$SMSTOOLS3_LOGLEVEL" 1      \
  "$(lang de:"Loglevel" en:"Log level"): "
sec_end
 

Anhänge

  • smstools3_config_eventhandler.patch.zip
    865 Bytes · Aufrufe: 0
Zuletzt bearbeitet von einem Moderator:
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.