Add IMS/VoLTE/VoWiFi stack and fix Dual-SIM cellular mobile data

- Add Qualcomm MCFG .mbn parser and profile store (bananarchy-imsctl), QMI_PDC/QMI_IMSDCM VoLTE daemon (bananarchy-imsd), and SWu IKEv2/EAP-AKA/ESP/SIP/AMR VoWiFi engine (bananarchy-vowifi) with disabled-by-default (auto) 4G-only activation and xmodem/xfiles/xcallscreen UI support.

- Add libmm-wds-bind.so QMI_SERVICE_WDS PRIMARY subscription binding (including serialized post-mux/data-port binding), msm-modem-uim-selection DSDS PS-domain handoff, cs-only dial pause/restore (10-bananarchy-dpm.sh), cold-boot mmcli -K recovery, and networks.so connection.autoconnect no race fix.

- Add offline test suites (test-ims-mbn.py, test-imsd-volte.py, test-vowifi-swu-ims.py, test-lte-mobile-data.py), update docs (CHANGELOG.md Unreleased, README.md, MANUAL.md, AGENTS.md), and pin rebuilt 4-target image SHA-256 hashes in scripts/check-rebuild.sh.
This commit is contained in:
Luxferre committed 2026-11-20 19:18:58 +02:00
1 parent 03bc80f267
commit c40ec932de
65 files changed
+11916 -129

No files matched your search

+89
View File
@@ -36,6 +36,75 @@ resolve_sim_state() {
[ -n "$DUAL_ACTIVE" ] || DUAL_ACTIVE="0"
}
is_emergency_number() {
case "$1" in
112|911|999|000|110|118|119|998) return 0 ;;
*) return 1 ;;
esac
}
ims_read_kv() {
awk -F= -v k="$1" '$1 == k { gsub(/\047/, "", $2); print $2; exit }' "$2" 2>/dev/null || true
}
ims_should_prefer_userspace() {
_slot="$1"
_emerg="$2"
_st="${BANANARCHY_IMS_STATE_PATH:-/run/bananarchy/ims/state.env}"
_cf="${BANANARCHY_IMS_CONF_PATH:-/etc/bananarchy/ims.conf}"
[ -r "$_st" ] || return 1
IMS_VOWIFI_REG="$(ims_read_kv VOWIFI_REGISTERED "$_st")"
IMS_VOLTE_REG="$(ims_read_kv VOLTE_REGISTERED "$_st")"
IMS_VOLTE_BACK="$(ims_read_kv VOLTE_BACKEND "$_st")"
IMS_NET4G="$(ims_read_kv NETWORK_4G_ONLY "$_st")"
IMS_SIM="$(ims_read_kv VOWIFI_SIM "$_st")"
IMS_WFC_PREF="$(ims_read_kv wfc_preference "$_cf")"
[ -n "$IMS_SIM" ] || IMS_SIM="1"
[ -n "$IMS_WFC_PREF" ] || IMS_WFC_PREF="cellular_preferred"
if [ "$_emerg" = "1" ]; then
return 1
fi
[ "$_slot" = "$IMS_SIM" ] || return 1
if [ "$IMS_VOWIFI_REG" = "1" ]; then
case "$IMS_WFC_PREF" in
wifi_only|wifi_preferred) return 0 ;;
*) [ "$IMS_NET4G" = "1" ] && return 0 ;;
esac
fi
if [ "$IMS_VOLTE_BACK" = "userspace" ] && [ "$IMS_VOLTE_REG" = "1" ]; then
return 0
fi
return 1
}
ims_dial_userspace() {
_num="$1"
_slot="$2"
_ctl="${BANANARCHY_IMS_CTL:-/usr/bin/bananarchy-imsctl}"
[ -x "$_ctl" ] || return 1
_tag="VOWIFI${_slot}"
[ "${IMS_VOWIFI_REG:-0}" = "1" ] || _tag="VOLTE${_slot}"
if [ -p "/tmp/dwm_plugin_callscreen.fifo" ]; then
printf "OUTGOING - %s %s\n" "$_num" "$_tag" > /tmp/dwm_plugin_callscreen.fifo 2>/dev/null || true
elif command -v xcallscreen >/dev/null 2>&1; then
xcallscreen outgoing "-" "$_num" "$_tag" >/dev/null 2>&1 || true
fi
_out="$("$_ctl" call-dial "$_num" 2>/dev/null || true)"
_cid="$(printf '%s\n' "$_out" | awk '/^OK / { print $2; exit }')"
[ -n "$_cid" ] || return 1
_safe_cid="$(printf '%s' "$_cid" | tr ':/' '__')"
touch "$XDG_RUNTIME_DIR/sxmo_calls/${_safe_cid}.initiatedcall" 2>/dev/null || true
if [ -p "/tmp/dwm_plugin_callscreen.fifo" ]; then
printf "OUTGOING %s %s %s\n" "$_cid" "$_num" "$_tag" > /tmp/dwm_plugin_callscreen.fifo 2>/dev/null || true
elif command -v xcallscreen >/dev/null 2>&1; then
xcallscreen outgoing "$_cid" "$_num" "$_tag" >/dev/null 2>&1 || true
fi
sxmo_hook_dial.sh || true
sxmo_modemaudio.sh setup_audio || true
sxmo_hook_statusbar.sh state &
return 0
}
dial_number() {
NUMBER="$(printf "%s" "$1" | tr -cd '+0-9*#')"
if [ -z "$NUMBER" ]; then
@@ -67,6 +136,21 @@ dial_number() {
fi
[ -n "$TARGET_SIM" ] || TARGET_SIM="$PRIM_SLOT"
IS_EMERG=0
is_emergency_number "$NUMBER" && IS_EMERG=1
if ims_should_prefer_userspace "$TARGET_SIM" "$IS_EMERG"; then
if ims_dial_userspace "$NUMBER" "$TARGET_SIM"; then
return 0
fi
[ "${IMS_WFC_PREF:-}" = "wifi_only" ] && {
if command -v xcallscreen >/dev/null 2>&1; then
xcallscreen ended >/dev/null 2>&1 || true
fi
sxmo_notify_user.sh --urgency=critical "VoWiFi call failed (wifi_only mode)"
return 1
}
fi
# Secondary GW SIM call via QMI VOICE sub=1
if [ "$TARGET_SIM" = "$SEC_SLOT" ] && [ "$SEC_SLOT" != "0" ]; then
sxmo_log "Attempting to dial on Secondary GW (SIM $TARGET_SIM): $NUMBER"
@@ -127,6 +211,11 @@ dial_number() {
fi
if [ -z "$CALLID" ]; then
if [ ! -f /tmp/sxmo_hangup_requested ]; then
if [ "$IS_EMERG" = "1" ] && [ "${IMS_VOWIFI_REG:-0}" = "1" ]; then
if ims_dial_userspace "$NUMBER" "$TARGET_SIM"; then
return 0
fi
fi
if command -v xcallscreen >/dev/null 2>&1; then
xcallscreen ended >/dev/null 2>&1 || true
fi