Fix background call hangup and end calls on screen lock or lid close
This commit is contained in:
1 parent
c7cdde6734
commit
0c352f0a10
55 files changed
+391
-120
No files matched your search
@@ -2,6 +2,10 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2022 Sxmo Contributors
|
||||
|
||||
export HOME="${HOME:-/home/user}"
|
||||
export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/10000}"
|
||||
export PATH="${XDG_CONFIG_HOME:-$HOME/.config}/sxmo/hooks:/usr/share/sxmo/default_hooks:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin:$PATH"
|
||||
|
||||
# include common definitions
|
||||
# shellcheck source=scripts/core/sxmo_common.sh
|
||||
. sxmo_common.sh
|
||||
@@ -57,8 +61,7 @@ dial_number() {
|
||||
sxmo_log "Attempting to dial on Secondary GW (SIM $TARGET_SIM): $NUMBER"
|
||||
if [ -p "/tmp/dwm_plugin_callscreen.fifo" ]; then
|
||||
printf "OUTGOING - %s SIM%s\n" "$NUMBER" "$TARGET_SIM" > /tmp/dwm_plugin_callscreen.fifo 2>/dev/null || true
|
||||
fi
|
||||
if command -v xcallscreen >/dev/null 2>&1; then
|
||||
elif command -v xcallscreen >/dev/null 2>&1; then
|
||||
xcallscreen outgoing "-" "$NUMBER" >/dev/null 2>&1 || true
|
||||
fi
|
||||
if ! CALLID="$(doas -n /usr/libexec/msm-modem-uim-selection call-dial "$TARGET_SIM" "$NUMBER" 2>/dev/null || /usr/libexec/msm-modem-uim-selection call-dial "$TARGET_SIM" "$NUMBER" 2>/dev/null)"; then
|
||||
@@ -68,13 +71,19 @@ dial_number() {
|
||||
sxmo_notify_user.sh --urgency=critical "We failed to initiate call on SIM $TARGET_SIM"
|
||||
return 1
|
||||
fi
|
||||
rm "$XDG_RUNTIME_DIR/sxmo_calls/$CALLID."* 2>/dev/null || true
|
||||
rm -f "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.terminated" \
|
||||
"$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.hangedupcall" \
|
||||
"$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.discardedcall" 2>/dev/null || true
|
||||
touch "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.initiatedcall"
|
||||
doas -n dbus-send --system --type=signal / org.ofono.VoiceCallManager.CallAdded >/dev/null 2>&1 || true
|
||||
sxmo_hook_dial.sh || true
|
||||
sxmo_modemaudio.sh setup_audio || true
|
||||
if [ -p "/tmp/dwm_plugin_callscreen.fifo" ]; then
|
||||
printf "OUTGOING %s %s SIM%s\n" "$CALLID" "$NUMBER" "$TARGET_SIM" > /tmp/dwm_plugin_callscreen.fifo 2>/dev/null || true
|
||||
if [ -f "$XDG_RUNTIME_DIR/sxmo_calls/${CALLID}.active" ]; then
|
||||
printf "ACTIVE %s %s SIM%s\n" "$CALLID" "$NUMBER" "$TARGET_SIM" > /tmp/dwm_plugin_callscreen.fifo 2>/dev/null || true
|
||||
else
|
||||
printf "OUTGOING %s %s SIM%s\n" "$CALLID" "$NUMBER" "$TARGET_SIM" > /tmp/dwm_plugin_callscreen.fifo 2>/dev/null || true
|
||||
fi
|
||||
elif command -v xcallscreen >/dev/null 2>&1; then
|
||||
xcallscreen outgoing "$CALLID" "$NUMBER" >/dev/null 2>&1 || true
|
||||
fi
|
||||
@@ -93,8 +102,7 @@ dial_number() {
|
||||
sxmo_log "Attempting to dial (SIM $TARGET_SIM): $NUMBER"
|
||||
if [ -p "/tmp/dwm_plugin_callscreen.fifo" ]; then
|
||||
printf "OUTGOING - %s SIM%s\n" "$NUMBER" "$TARGET_SIM" > /tmp/dwm_plugin_callscreen.fifo 2>/dev/null || true
|
||||
fi
|
||||
if command -v xcallscreen >/dev/null 2>&1; then
|
||||
elif command -v xcallscreen >/dev/null 2>&1; then
|
||||
xcallscreen outgoing "-" "$NUMBER" >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
|
||||
Reference in new issue
Block a user