From 02a37c9dea5e30e7549b982d1082c88afdf78f59 Mon Sep 17 00:00:00 2001 From: Stacy Harper Date: Tue, 29 Jun 2021 14:01:11 +0200 Subject: [PATCH] Add back a notification when receiving a call If a menu already is open while receiving a call, the dedicated menu could not open itself. It prevent completly the user to pickup the call. We add a notification to open this menu manually. Signed-off-by: Stacy Harper Signed-off-by: Maarten van Gompel --- scripts/modem/sxmo_modemcall.sh | 1 + scripts/modem/sxmo_modemmonitor.sh | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/scripts/modem/sxmo_modemcall.sh b/scripts/modem/sxmo_modemcall.sh index 5283607..5ed0833 100755 --- a/scripts/modem/sxmo_modemcall.sh +++ b/scripts/modem/sxmo_modemcall.sh @@ -252,6 +252,7 @@ incomingcallmenu() { elif echo "$PICKED" | grep -q "Mute"; then mute "$1" fi + rm -f "$NOTIFDIR/incomingcall_${1}_notification"* #there may be multiple actionable notification for one call } modem_n || finish "Couldn't determine modem number - is modem online?" diff --git a/scripts/modem/sxmo_modemmonitor.sh b/scripts/modem/sxmo_modemmonitor.sh index 18b7109..cde591d 100755 --- a/scripts/modem/sxmo_modemmonitor.sh +++ b/scripts/modem/sxmo_modemmonitor.sh @@ -86,6 +86,7 @@ checkforfinishedcalls() { FINISHEDNUMBER="$(lookupnumberfromcallid "$FINISHEDCALLID")" FINISHEDNUMBER="$(cleanupnumber "$FINISHEDNUMBER")" mmcli -m "$(modem_n)" --voice-delete-call "$FINISHEDCALLID" + rm -f "$NOTIFDIR/incomingcall_${FINISHEDCALLID}_notification"* #there may be multiple actionable notification for one call rm -f "$CACHEDIR/${FINISHEDCALLID}.monitoredcall" @@ -178,6 +179,11 @@ checkforincomingcalls() { mkdir -p "$LOGDIR" printf %b "$TIME\tcall_ring\t$INCOMINGNUMBER\n" >> "$LOGDIR/modemlog.tsv" + sxmo_notificationwrite.sh \ + "$NOTIFDIR/incomingcall_${VOICECALLID}_notification" \ + "sxmo_modemcall.sh incomingcallmenu '$VOICECALLID'" \ + none \ + "Incoming Call - $CONTACTNAME" & sxmo_modemcall.sh incomingcallmenu "$VOICECALLID" & echo "sxmo_modemmonitor: Call from number: $INCOMINGNUMBER (VOICECALLID: $VOICECALLID)">&2