From 7cf1dadf5f4ae0dd79ffdc61639061e9623ef12d Mon Sep 17 00:00:00 2001 From: Stacy Harper Date: Mon, 7 Jun 2021 17:58:31 +0200 Subject: [PATCH] Fix the notification for outgoing call hanged up by the contact There was a hole in the event logging where we start a call that the contact hang up. As we dont have an event for outgoing call, modemmonitor think this is a missed call. Adding a dedicated event file help modemmonitor to know what happen. Signed-off-by: Stacy Harper Signed-off-by: Maarten van Gompel --- scripts/modem/sxmo_modemcall.sh | 1 + scripts/modem/sxmo_modemmonitor.sh | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/modem/sxmo_modemcall.sh b/scripts/modem/sxmo_modemcall.sh index 822bccb..5283607 100755 --- a/scripts/modem/sxmo_modemcall.sh +++ b/scripts/modem/sxmo_modemcall.sh @@ -106,6 +106,7 @@ acceptcall() { )" if [ "$DIRECTION" = "outgoing" ]; then modem_cmd_errcheck -m "$(modem_n)" -o "$CALLID" --start + touch "$CACHEDIR/${CALLID}.initiatedcall" #this signals that we started this call log_event "call_start" "$CALLID" echo "sxmo_modemcall: Started call $CALLID">&2 elif [ "$DIRECTION" = "incoming" ]; then diff --git a/scripts/modem/sxmo_modemmonitor.sh b/scripts/modem/sxmo_modemmonitor.sh index b420753..18b7109 100755 --- a/scripts/modem/sxmo_modemmonitor.sh +++ b/scripts/modem/sxmo_modemmonitor.sh @@ -103,10 +103,15 @@ checkforfinishedcalls() { rm -f "$CACHEDIR/${FINISHEDCALLID}.pickedupcall" printf %b "$TIME\tcall_finished\t$FINISHEDNUMBER\n" >> "$LOGDIR/modemlog.tsv" elif [ -f "$CACHEDIR/${FINISHEDCALLID}.hangedupcall" ]; then - #this call was hanged up + #this call was hung up by the user echo "sxmo_modemmonitor: Finished call from $FINISHEDNUMBER">&2 rm -f "$CACHEDIR/${FINISHEDCALLID}.hangedupcall" printf %b "$TIME\tcall_finished\t$FINISHEDNUMBER\n" >> "$LOGDIR/modemlog.tsv" + elif [ -f "$CACHEDIR/${FINISHEDCALLID}.initiatedcall" ]; then + #this call was hung up by the contact + echo "sxmo_modemmonitor: Finished call from $FINISHEDNUMBER">&2 + rm -f "$CACHEDIR/${FINISHEDCALLID}.initiatedcall" + printf %b "$TIME\tcall_finished\t$FINISHEDNUMBER\n" >> "$LOGDIR/modemlog.tsv" elif [ -f "$CACHEDIR/${FINISHEDCALLID}.mutedring" ]; then #this ring was muted up echo "sxmo_modemmonitor: Muted ring from $FINISHEDNUMBER">&2