Commit Graph
88 Commits
Author SHA1 Message Date
yibaiba 604ca53312 fix: harden VoWiFi proxy recovery handling 2026-09-05 17:25:45 +08:00
yibaiba f8e16e7246 feat(vowifi): let cards pin or randomly pick country proxy nodes
Allow multiple upstream proxies per country, card-level pin or
direct override, and restart WiFi calling when the route changes.
2026-09-05 16:32:58 +08:00
yibaiba 826e5c1b49 fix(phone): harden IMS recovery and contact identity state 2026-09-04 13:26:21 +08:00
yibaiba 527ecd4bd0 fix(ims): recover early port-s resets and coalesce native VoLTE starts
Track port-s open/close and peer RST, switch P-CSCF with a full security
agreement teardown after Vodafone UK early resets, and keep only one
native VoLTE start in flight per device.
2026-09-04 12:02:34 +08:00
yibaiba c753d7897c feat(vowifi): track WiFi Calling health 2026-09-04 11:37:16 +08:00
yibaiba 46f1892de0 fix: harden modem and IMS recovery 2026-09-04 09:05:21 +08:00
yibaiba 6b820454b1 fix(volte): keep host off the LTE internet PDN when 网络 is off
Native VoLTE still has the operator default 3gnet bearer for LTE
attach; that cannot be CGACT-deactivated. Hideck must not use it as
usbnet. Always flush/down the data iface when NetworkEnabled is
false, including after IMS PDN comes up.
2026-09-03 20:13:12 +08:00
yibaiba 869ff5791a fix(qmi): unstick wedged CTL after SIM swap without CFUN
SIM swap can leave qmi_wwan/qmi-proxy holding a dead cdc-wdm
session while AT still works. Recovery then kept allocating CTL
clients on that wedged port. Prefer AT IMEI during rescan, skip
startup UIM reset when the card is already ready, and if CTL
allocate times out twice with AT alive, USB-reset only that modem.
2026-09-03 19:56:46 +08:00
yibaiba 8e81aa811d fix(qmi): keep StartCore retry and read SIM over AT
QMI DMS allocate timeout after SIM swap was tearing down the worker
because identity refresh only used QMI and recovery treated empty
identity as half-ready. Leave the worker running while StartCore
retries, and read IMSI/ICCID from the AT port so card policy can
apply without a CFUN reboot.
2026-09-03 19:40:08 +08:00
yibaiba 9f02f4ec0f fix(qmi): rebuild after qmi-proxy pipe break on SIM swap
Modem reboot leaves the proxy socket dead while NAS reconcile stays
in flight, so health checks never reopen QMI. Treat that broken pipe
as transport-down, keep AT VoLTE when IMS client allocate fails, and
fall back to AT+CNUM for the local number.
2026-09-03 19:18:27 +08:00
yibaibaandCursor b414f1e135 fix(phone): stop incoming ringing after remote hangup
Map QMI disconnecting and early CANCEL/BYE to a missed call, and use standalone titles so WeCom, QQ, Feishu, and other channels no longer stack 通话结束.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 16:21:11 +08:00
yibaiba 9d3e0d06a7 fix(esim): recover Lebara UK 204/04 identity without deleting the profile
When a Lebara UK eSIM flips to 20404, reset the same ICCID with Disable/Enable or a parking profile, wait for a stable 23487 IMSI, then start VoWiFi. Keep the RF lock. Do not start VoWiFi during recover or on classify-failure for unrelated cards.
2026-09-01 16:09:07 +08:00
yibaiba 7ae34939ed fix(volte): hold and resume native calls over QMI
Native HoldCall/ResumeCall were stubs. Send VOICE_MANAGE_CALLS
HOLD_ACTIVE_ACCEPT_WAITING_OR_HELD, then local hold/unhold if the
modem rejects the network supplementary service.
2026-09-01 14:45:55 +08:00
yibaiba 54ebcb3690 fix(volte): skip unusable UAC and keep China SIMs on native IMS
DJI/Baiwang USB audio enumerates but opening PCM kills QMI on the
same composite. Skip QPCMV and ALSA there; QPCMV failure also skips
PCM open. Working UAC is unchanged. China MCC 460/461 force native
VoLTE. Rebuild QMI when the proxy socket dies during a native call.
2026-09-01 14:22:20 +08:00
yibaiba 3f7d232af4 fix(device): retry native VoLTE start and show LTE RSRP
Why: a transient AT/QMI timeout aborted native IMS provision, and QMI LTE placeholder RSSI made the overview look like there was no signal.

Why this works: native VoLTE start retries timeout-class errors, serializes AT on one port, and the overview uses RSRP when RSSI is a sentinel. Shutdown now takes the stop context so IMS can finish Contact Expires=0.

Remaining: Lebara UK RF-lock and unique-MBN failures stay non-retryable.
2026-09-01 12:26:37 +08:00
yibaiba 5326e3c657 fix(device): cache SMSC across VoWiFi start and accept proxy errors
Why: a one-shot 5s SMSC read left later starts empty, and Darwin qmi-proxy errors hid a successful IMEI rebind.
Why this works: start retries the read, remembers the last IMSI/ICCID SMSC, and the bootstrap test accepts proxy-unsupported as a rebound start failure.
Remaining: preset SMSC fallback is still not a carrier-plan field.
2026-08-31 13:23:15 +08:00
yibaiba 24bb2e0072 fix(sms): send once via IMS or CS without a double submit
/send, automatic tasks, and the balance gateway now use SendRoutedSMS.
A VoWiFi failure falls back to CS once; it does not also send on IMS.
Notify /status shows MWI, and vocall hold from notify stays skipped.
2026-08-31 00:46:58 +08:00
yibaiba 49f97a50b5 feat(device): record VoWiFi MWI on runtime DTOs and teardown
Keep the latest RFC 3842 snapshot on the pool, attach it to device
runtime JSON, and clear it when VoWiFi is disabled. Call-waiting
notify is forwarded from the same dispatcher.
2026-08-31 00:46:58 +08:00
yibaiba 37ea2f75fd test(device): keep default new-card policy off the cellular radio
Bind and policy projection must stay in airplane / RF-off. Switching
that default into VoWiFi must not call ModeOnline or start IMS.
2026-08-31 00:46:58 +08:00
yibaibaandCursor d36ebb08bc fix(device): keep cellular radio off when VoWiFi is the default
Default Wi-Fi calling was skipping bind-time RFOff and treating QMI LowPower as airplane, so the modem could camp after restart. Persist the flight mode and uncamp if NAS comes back while radio is suppressed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-29 11:51:23 +08:00
yibaibaandCursor 4ced58c4de feat(vowifi): align remaining IR.92 signaling and realtime AMR/EVS IO
Subscribe to MWI, accept in-dialog REFER and call waiting, and advertise
preconditions plus identity headers without enabling emergency calls.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-29 05:01:31 +08:00
yibaibaandCursor 593cb967bc feat(vowifi): close SMS, hold, outbound, and SWu protocol gaps
Register now advertises outbound, prefers Service-Route then Path, and
tears down RFC 3680 subscriptions in-dialog. Voice adds hold/resume and
RFC 4028 timers; SWu sends AKA' bidding, IKE fragmentation, redirect
limits, and a correctly coded AUTS. Host SMS gets SMMA backpressure and
CS fallback without double-send.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-28 23:19:43 +08:00
yibaiba b442567b6d fix(ims): advertise MSISDN-less SMS, 488 unmatched reports, and emergency ePDG
TS 24.341 5.3.2.6.2: REGISTER Contact includes +g.3gpp.smsip-msisdn-less so
future SIMs can use MSISDN-less SMS over IP.

TS 24.341 5.3.1.4.2: 488 when In-Reply-To is present and does not match a
submitted SM. Late reports still match the delivery store. RP-MR is not used
to steal another message when In-Reply-To is set.

IR.51: carrier profile now carries sos.epdg.epc.mncXXX.mccYYY.pub.3gppnetwork.org.
Ordinary VoWiFi IKE still uses the standard/custom ePDG.
2026-08-28 08:32:38 +08:00
yibaiba 1497cb5ae7 fix(qmi): stop and reap the spawned qmi-proxy with the service
Keep a single proxy child in the hideck cgroup, do not spawn another
when the socket is busy, and tear it down on shutdown so a restart
does not leave /dev/cdc-wdm busy.
2026-08-27 20:27:20 +08:00
yibaiba 43559936ec fix(volte): release USB audio before QMI hangup
Isochronous UAC traffic on the virtual xHCI stalls cdc-wdm writes.
Close ALSA with a 300ms budget before EndCall, ignore leftover EndCall
responses as indications, and skip QMI health eviction during the call
and for 20s after so wwan0 is not marked offline.
2026-08-24 19:09:56 +08:00
yibaiba d0e15a913e test: replace live modem IMEIs with fictional fixtures
Keep the same pairing and 14-digit prefix behavior, but stop using
real module identities in Go tests.
2026-08-24 18:53:10 +08:00
yibaiba 5119e01219 fix(device): skip QMI handshake and fall back to AT IMEI
Identity probes were spending the rescan budget on GET_VERSION/sync,
so USB re-enumeration left configured modems with empty IMEI. Skip the
open handshake for DMS-only reads and retry IMEI on the same device AT
port when QMI fails.
2026-08-24 18:21:24 +08:00
yibaiba d3a39c5ceb fix(volte): play call audio from the module UAC card
Signaling used a silent PCM sink, so 10000 connected with no sound.
Open the USB-parent ALSA device during the call and do not claim UAC
ready until that card exists.
2026-08-24 16:03:29 +08:00
yibaiba 6d747adc01 fix(volte): send SMS via modem instead of software VoWiFi
Native VoLTE reuses VoWiFiEnabled as the phone-on bit, so SMS was still
routed to the software IMS path. Modem AT/QMI SMS is the native path.
2026-08-24 15:44:41 +08:00
yibaiba f1a5994671 fix(device): ignore stale SIM snapshot and UIM IMSI errors
Why: after swapping CTE for a China SIM, QMI still reported inserted from the old snapshot, and GetIMSI failure blocked turning off airplane. Reboots could not enumerate the new card.

Why this works: IsSimInserted live-queries UIM when the snapshot has no IMSI/ICCID. Lebara RF lock still applies from cache or 23487 history; a UIM error without Lebara evidence no longer fail-closes flight-mode off. QSIMDET stays 0,0 and CFUN=1,1 is not automatic.

Remaining: physical SIM insert still has no UIM resample path; native VoLTE Enable is not on 179 yet.
2026-08-24 14:10:57 +08:00
yibaiba 74539c0994 refactor(volte): collapse phone policy and share G.711
Why: quality review found triplicate radio policy, untyped native_volte, duplicated mu-law, and IMS lifecycle buried in manager.go.

Why this works: camped modes share PhoneModeCampsOnCell and applyPhoneRadioPolicy; DeviceStatus.NativeVoLTE is volte.Status; PCM bridge calls phone G.711; IMS clients live in ims_clients.go. VoWiFiEnabled JSON/DB name is unchanged.

Remaining: live IMS/UAC still wait on a China VoLTE SIM; AudioRuntime stays unwired until helper audit; Enable half-applied rollback is not in this change.
2026-08-24 10:20:50 +08:00
yibaiba 855e6a4a63 fix(volte): address native call and enable review bugs
Reuse of QMI call ids, inbound PCMU SDP, IMS client leak,
Lebara live classify, and VoLTE policy mirroring.
2026-08-24 10:00:17 +08:00
yibaiba 3f4efb0cc5 feat(volte): make native QMI voice events idempotent
Project MO/MT call states once, ignore backward indications,
and reconcile GetAllCallInfo after reconnect.
2026-08-24 00:31:28 +08:00
yibaiba e6759b9f17 feat(volte): manage native IMS clients on demand
Allocate IMS/IMSA/IMSP only for VoLTE, register IMSA indications,
and release them when switching off native mode.
2026-08-24 00:24:47 +08:00
yibaiba 7e911413b8 feat(volte): snapshot and restore modem voice config by IMEI
Write USBCFG/IMS/VoLTE/MBN only after a hashed-IMEI backup.
Failed stages never claim restore; VID/PID and IMEI must match.
2026-08-24 00:15:46 +08:00
yibaiba e550d2edd5 feat(volte): add native VoLTE phone mode on QDC507
Keep wifi and cellular software IMS. VoLTE camps LTE, enables
modem IMS over AT, and routes /phone through QMI VOICE.
2026-08-23 21:55:46 +08:00
yibaiba 38fa4d9d74 fix(sms): wait for VoWiFi recovery before sending 2026-08-20 14:59:41 +08:00
yibaiba 7a07c18b24 fix: enforce Lebara UK radio lock safely 2026-08-19 15:43:18 +08:00
yibaiba d22874111d feat: add Lebara UK NextGen WiFi calling and radio lock
Add the 234/87 preset and keep shared eSIMs off domestic cells so a dual-IMSI flip to 20404 cannot kill UK WFC.
2026-08-19 14:58:04 +08:00
yibaiba 34f7738ce9 fix: serialize USB rescans and retry card policy 2026-08-18 11:30:44 +08:00
yibaiba bc17a20b81 fix: recognize USB remount faster and hold RF off first
udev no longer resets a 3s timer on every ttyUSB event. USB
rescan/rebuild sends RFOff before NAS search, then applies the
existing card policy. Process restart does not flight-cycle
already camped SIMs.
2026-08-18 10:48:40 +08:00
yibaiba 13de6d7be4 fix: rematch USB QMI devices and keep delete/re-add usable
Subscribe to kernel uevents and rematch IMEI-only configs after unplug.
Abandon in-flight recovery on delete so the same ID can be added again.
Keep the add dialog on theme tokens and prefill the device ID.
2026-08-17 19:05:05 +08:00
yibaiba be4e0d97a5 fix: do not recover cellular IMS while airplane is on
Airplane plus cellular always was still scheduled for VoWiFi recover,
so EnableVoWiFi could start PDP after flight mode was cleared even
when Network stayed off. Hold recover in that state, refuse dial/data
until RF is back, and restore Network for always when leaving airplane.
2026-08-17 16:40:09 +08:00
yibaiba 76b77d1462 fix: interlock airplane, network, and phone mode
Camp and airplane stay mutually exclusive. Opening network exits
airplane; WiFi calling locks airplane and data; cellular can keep the
software phone while RF is off. Policy screens use a flight switch
instead of a camp/airplane radio pair.
2026-08-17 16:22:08 +08:00
yibaiba 300098edef fix: camp without data and align radio/network UI
Airplane still turns the radio off. Network only starts a data session, so an idle card can stay registered with no traffic. Device list, card policy, overview, and the dialer now describe that split, including that a cellular call temporarily brings data up.
2026-08-17 15:48:14 +08:00
yibaiba ce16d1532b fix: do not camp or search when Network is off
Disabling software phone on a card with Network off was treated as online idle, so QMI kept waking NAS. Keep RF off and skip registration reconcile until Network is turned on.
2026-08-17 15:26:20 +08:00
yibaiba db22458f35 fix: default new devices to airplane and gate cellular on network
New binds and new SIMs start in airplane so QMI does not camp immediately. Cellular on_demand without Network stays RF-off; on_demand/always only take effect after Network is on. The dialer and card policy now say this, and clicking WiFi calling starts the software phone even when it already looks selected.
2026-08-17 15:04:13 +08:00
yibaiba 588e16a992 fix: stop cellular idle VoWiFi recover and restore data toggle
Skip desired-state recover for cellular on_demand so idle devices
do not start SWu. Probe the cellular path before IMS and fall back
to the country proxy when the bearer cannot reach the internet.
Allow the network switch to stay on with cellular software phone.

Bump Docker image to 2.0.4.
2026-08-17 10:39:36 +08:00
yibaiba 3893853e66 fix: do not build SWu tunnel when cellular on_demand has no data
Clicking cellular mode no longer tries IKE_SA_INIT on a down bearer.
on_demand only arms the policy; data and IMS start at dial time.
always still brings data up before the tunnel.
2026-08-17 09:50:16 +08:00
yibaiba 3c0d79742a fix: harden docker runtime, PushPlus transport, and DB write logs
Align the Hub Dockerfile with Dockerfile.github so recordings keep
AMR/MP3 codecs and healthcheck. Send PushPlus over HTTPS with a timeout.
Log traffic rollup, SMS persist, and device IP update failures without
changing call/SMS success semantics.

Bump image to 2.0.3.
2026-08-17 01:35:52 +08:00