Commit Graph
214 Commits
Author SHA1 Message Date
yibaibaandCursor c4f359cb1e 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 84ebdc8eab 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
yibaibaandCursor f3d5aaf231 feat(vowifi): add Hotlink, AIS, Smart, Globe, KPN and MTN presets
Match home PLMN for travel eSIMs that publicly offer 3GPP Wi-Fi Calling, without guessing balance shortcodes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 15:46:07 +08:00
yibaibaandCursor c1ddcf1864 feat(vowifi): add common travel eSIM carrier presets
Match popular voice eSIMs by home PLMN, including EE, Lycamobile, Japan MNOs, CMHK, and Estonia Elisa for 乌龟卡.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 15:32:17 +08:00
yibaiba 21b7d437e1 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 bf433ea45b 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 fd328f74d1 Merge pull request #3 from rayyume/fix/webrtc-public-host-candidate
fix(phone): preserve fixed WebRTC UDP port in public ICE candidate
2026-09-01 13:04:37 +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 40dbc7cf31 feat(ut): add Vodafone xcap PDN and hide 呼叫设置
Why: Ut is HTTPS to an operator-internal IPv4 XCAP host, not SIP. IMS IPv6-only could not reach it, and CS-only devices still opened the page and waited on 502.

Why this works: Vodafone UK starts a second SWu session with APN xcap and omits INITIAL_CONTACT. Errors no longer leak the XCAP URL. The sidebar drops 呼叫设置; /ut redirects home.

Remaining: the xcap PDN gets IPv4, but TCP to the XCAP address still times out.
2026-09-01 12:26:23 +08:00
Ray 8c26a9ef8d debug: fix webrtc connection issue on cellular network 2026-09-01 08:46:54 +08:00
yibaiba 3264470acb feat(ut): start XCAP PDN after IMS and dial Ut through it
Why: DEV-20/21 still left StartAdditionalPDNs uncalled and Server.utClient unset, so the second SWu and Ut HTTP never ran on the production path.
Why this works: RunSession starts the xcap slot after IMS is up and waits for it without tearing down IMS on failure. Ut HTTP dials that PDN; a requested XCAP APN does not fall back to the IMS inner network. The API looks up the live runtime instance when utClient is not injected.
Remaining: live operator XCAP is untested; in-app browser MCP is still unavailable.
2026-08-31 15:24:57 +08:00
yibaiba 239feb172b feat(voice): keep two live calls and switch between them
Why: conference and ECT need more than activeCall plus a ring-only waitingCall; a second answered call was rejected as busy.
Why this works: occupancy is the live call map, capped at two, and a second call is allowed only after the first is connected. SwitchCall changes focus; hangup promotes the remaining call.
Remaining: inbound Replaces, conference, and ECT are still separate rows.
2026-08-31 14:26:12 +08:00
yibaiba c01e6e5126 feat(ut): configure simservs through XCAP instead of USSI
Why: IR.92 2.3.2 requires Ut/XCAP for call forwarding, identity restriction, and barring; MMI codes are not Ut.
Why this works: GET/PUT simservs uses If-Match and one service per request; 404 retries an alternate XUI; missing XCAP PDN returns a visible error.
Remaining: production still needs the XCAP PDN transport wired to the second SWu; browser evidence was not collected in this session.
2026-08-31 14:12:18 +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 a0203084b0 feat(phone): map hold-unavailable and surface call waiting
Hold that is not aligned returns 503 with a Chinese message. A second
inbound CallWaiting stays in the active list and is shown on the phone
page and call bar.
2026-08-31 00:46:58 +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
yibaiba 94b5ad8d66 fix(qmi): always open QMI backends through qmi-proxy
Unused control devices used to fall back to a raw open. On dual-module
hosts that lets the second card grab the fd, then UIM reset/AKA stalls
the modem. Discovery and runtime QMI both stay on the proxy.
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 916e4c40c4 fix(notify): give vocall hold and resume their own timeouts
The shared 8s context expired during the 3s hold pause, so resume
re-INVITE was cancelled and looked like a protocol failure.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-28 23:23:59 +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 aaf774b8bc feat(esim): decode activation QR images and PDFs on the server
Upload screenshots or carrier PDFs to decode LPA:1$ payloads so install
no longer depends on the browser BarcodeDetector API.
2026-08-27 18:39:03 +08:00
yibaiba e44e1e4323 fix(esim): decode dropped or pasted QR images and keep LPA tokens
Prefer LPA payloads over labeled SM-DP+ text, fall back to the form
host when an activation blob does not parse, and accept QR screenshots
via drag-and-drop or clipboard paste.
2026-08-27 18:18:26 +08:00
yibaiba 14a66303e4 fix(esim): install profiles from market QR activation codes
Accept GSMA LPA:1$ payloads, Apple-wrapped URLs, host$token strings,
and labeled SM-DP+/activation-code emails so VOXI, Giffgaff, Airalo
and similar cards can be added from the QR rather than a bare host.
2026-08-27 17:35:55 +08:00
yibaiba d243a4116f fix(notify): write call-end notices in Chinese like incoming calls
Channel text no longer dumps English direction/reason codes. Hangup,
miss, reject, and busy use 主叫/被叫 and the same title / status layout
as SMS and incoming-call notices.
2026-08-25 11:26:25 +08:00
yibaiba 466a8a03e5 fix(volte): route native call PCM through QPCMV
Native VoLTE skipped the AT manager, so AT+QPCMV=1,2 never ran even when a USB sound card was present. Send it on provision and at call setup, and surface QPCMV failure as silent-audio instead of a healthy UAC path.
2026-08-24 19:34:37 +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 e5a9466e8a test: replace a live caller number with a fictional one
Fixtures copied a real inbound MSISDN from the host. Use +1555550100.
2026-08-24 18:45:18 +08:00
yibaiba 4488884979 fix(phone): notify channels when a native call starts ringing
VoLTE incoming only published the phone-page SSE event. Channel
notifiers still waited for the terminal result. Broadcast 来电通知
from the phone service on inbound ring, and collapse duplicate
incoming alerts from the software IMS path.
2026-08-24 18:41:15 +08:00
yibaiba e79d2ee3c5 fix(phone): drop ghost ringing after QMI slot reuse
A just-ended native call can reappear on QMI call id 1 and be stored as
a new inbound ringing row. Ignore the same number on that slot for 3s,
close leftover in-progress records on process start, and refresh active
calls when the phone event stream drops.
2026-08-24 18:34:27 +08:00
yibaiba 45d203b4f9 fix(phone): always publish call_ended after hangup
Hangup could return 204 while native VoLTE never emitted CallEnded, so
the page stayed on 挂断中. Finish the phone-layer call after a successful
hangup or reject, replay events when after_id is from a previous process,
and apply restarted SSE ids instead of dropping them.
2026-08-24 18:21:49 +08:00
yibaiba ae87b79e30 fix(volte): unique native call IDs and bounded ALSA open
QMI reuses call slot 1, so volte-{device}-{qmiID} overwrote history.
Identify live calls by QMI id and mint a unique persistent call_id.
Cap ALSA open at 800ms, refine hwparams before HW_PARAMS, and skip
later opens after a failure so dialing is not blocked by set_interface.
2026-08-24 18:21:32 +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 7e05067494 fix(volte): refresh UAC status when the USB sound card appears
Worker start can beat snd-usb-audio bind. Re-read the USB-parent
ALSA device on status so the phone page stops claiming reboot.
2026-08-24 16:12:48 +08:00
yibaiba 01b197165c fix(volte): talk to module UAC through ALSA ioctls
179 has no alsa-utils. Open hw:N,M capture/playback with kernel
ioctls so a re-enumerated USB sound card can carry call audio.
2026-08-24 16:08:29 +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 ea10457745 fix(volte): clear stale calls when QMI EndCall returns 0x0029
Reject/hangup failed with invalid call id after the modem already
dropped the call, so the local session stayed busy. Treat already-gone
VOICE errors as ended and emit CallEnded.
2026-08-24 15:50:23 +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 b5e785f32a fix(volte): stop treating native mode as WiFi calling
Card policy already stored phone_mode=volte with airplane off, but the
embedded UI still classified any non-cellular mode as WiFi calling and
locked flight. Device list also dropped PhoneMode when merging yaml.
2026-08-24 15:04:24 +08:00
yibaiba aea62a5e6d fix(volte): project RF on enable and skip missing usbcfg
Why: live Enable on 179 failed twice: volte PATCH left CFUN=4 so CEREG stayed 0; CU-VoLTE MBN returns ERROR for AT+QCFG usbcfg and aborted identity.

Why this works: enabling native VoLTE now applies card policy so camped modes leave airplane. Provision continues IMS when usbcfg is unsupported and does not demand UAC bits.

Remaining: redeploy to 179 to register Unicom IMSA; no real call yet.
2026-08-24 14:37:04 +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 0f93fb928a feat(volte): map China Broadnet 460-15 to a VoLTE MBN
Prefer a dedicated CBN profile when the module has one.
Otherwise use CMCC because CBN shares that radio.
2026-08-24 09:06:03 +08:00
yibaiba e403ec9599 feat(volte): implement native IMS bring-up and PCMU SDP
Map China PLMN to a unique MBN, wait for LTE and IMS PDN, and
give /phone a local PCMU endpoint. Unknown PLMNs fail closed.
2026-08-24 08:57:24 +08:00