diff --git a/scripts/modem/sxmo_modemmonitor.sh b/scripts/modem/sxmo_modemmonitor.sh index 6e06ae2..cf8ad8e 100755 --- a/scripts/modem/sxmo_modemmonitor.sh +++ b/scripts/modem/sxmo_modemmonitor.sh @@ -125,12 +125,16 @@ checkfornewtexts() { } mainloop() { - while true; do - checkformissedcalls - checkforincomingcalls - checkfornewtexts - sleep $TIMEOUT & wait - done + dbus-monitor --system "interface='org.freedesktop.ModemManager1.Modem.Voice',type='signal',member='CallAdded'" | \ + while read line; do + checkforincomingcalls + done & + dbus-monitor --system "interface='org.freedesktop.ModemManager1.Modem.Messaging',type='signal',member='Added'" | \ + while read line; do + checkfornewtexts + done & + wait + wait } mainloop