Skip to content
mosfaqurPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

Repository files navigation

VoWiFi Software UE & Gateway (LXC / Docker)

A containerized, open-source Voice over WiFi (VoWiFi / Wi-Fi Calling) Software User Equipment (UE) implementation designed for Linux servers and Proxmox VE LXC environments using physical USB Smart Card Readers (CCID) and cellular USIM cards.


Highlights

  • Hardware USIM Integration: Direct PC/SC interface (pyscard / pcscd) with physical 3GPP USIM / UICC smart cards.
  • 3GPP SWu Interface: Pure-Python IKEv2 / IPsec client (swu_ike.py) executing RFC 4187 EAP-AKA authentication via the SIM's onboard Milenage algorithm.
  • IMS Core (SIP/VoIP): Powered by sysmocom Asterisk 20.7.0 with IMS PJSIP, IMS-AKA digest, cellular SMS-over-IP (SIP MESSAGE), and P-Access-Network-Info (PANI) header injection.
  • WebRTC & Softphone: WebUI dashboard with an integrated browser softphone, real-time line telemetry, and SMS inbox/outbox. Supports reverse proxy and custom domain integration.
  • eSIM / eUICC Management: Integrated GSMA SGP.22 Local Profile Assistant (lpac) for over-the-air profile download, enabling, disabling, and switching on physical eUICC / ESTKme cards directly from the WebUI.
  • Proxmox VE 8+ Native: Designed to run inside unprivileged Proxmox LXC containers with native character device and TUN passthrough.
  • Turnkey LXC Templates: Includes pre-packaged Proxmox appliance archives (local:vztmpl) and instant linked-clone master templates for rapid multi-SIM scale-out.

Architecture

flowchart TD
    subgraph Host["Proxmox Host (PVE 8.4)"]
        USB["USB Smart Card Reader\n(Realtek 0bda:0169)"]
        SIM["3GPP 4G/5G USIM"]
        USB --- SIM
        Udev["Udev Rules\n(99-smartcard.rules)"]
        USB --> Udev
        XFRM["Linux Kernel\n(esp4, esp6, xfrm, tun)"]
    end

    subgraph LXC["Unprivileged LXC Container (Ubuntu 24.04)"]
        DevUSB["/dev/bus/usb/... (mode 0666)"]
        DevTUN["/dev/net/tun (mode 0666)"]
        PCSC["pcsc-lite (v2.3.3, -Dpolkit=false)\n(/run/pcscd socket)"]
        ControlPlane["FastAPI Control Plane\n(Systemd: vowifi-control)"]
        WebUI["React/Vite WebUI Dashboard\n(HTTPS :8443)"]

        subgraph DockerEngine["Docker Engine Container: vowifi-engine-1"]
            PinKeeper["pin_keeper.py\n(PIN State Guard)"]
            SWuIKE["swu_ike.py\n(IKEv2 / EAP-AKA / Userspace ESP)"]
            AMIBridge["ami_usim.py\n(AMI <-> USIM IMS-AKA)"]
            Asterisk["sysmocom Asterisk 20.7.0\n(IMS PJSIP Fork)"]
        end
    end

    subgraph Operator["Mobile Operator Core Network"]
        ePDG["Carrier ePDG\n(IKEv2 :500/:4500)"]
        AAA["3GPP AAA Server\n(Diameter SWm)"]
        HSS["HSS / Subscriber Profile"]
        PCSCF["P-CSCF / IMS Core"]
    end

    USB -.->|dev0 passthrough| DevUSB
    XFRM -.->|dev1 passthrough| DevTUN
    DevUSB --> PCSC
    PCSC --> PinKeeper
    PCSC --> SWuIKE
    PCSC --> AMIBridge

    ControlPlane --- WebUI
    ControlPlane --> DockerEngine

    SWuIKE <==>|"IKEv2 / EAP-AKA (SWu)"| ePDG
    ePDG <==>|"Diameter SWm"| AAA
    AAA <==> HSS
    SWuIKE -.->|"Userspace ESP (ipsec0)"| Asterisk
    Asterisk -.->|"SIP REGISTER (TS 24.229)"| PCSCF
Loading

Directory Structure


Prerequisites & Checklist

Before deploying, ensure you have:

  1. USB Smart Card Reader: A CCID-compliant USB reader (e.g. Realtek, Omnikey, ACS) plugged into the host.
  2. Physical USIM Card: A 3GPP LTE/5G SIM card with VoWiFi / VoLTE service activated by the carrier (the ims APN must be provisioned in the HSS).
  3. ePDG DNS Reachability: Carrier ePDG hostname (epdg.epc.mnc<MNC>.mcc<MCC>.pub.3gppnetwork.org) must resolve from your network (run scripts/check_sim.py to verify).
  4. Proxmox VE 8+ / Linux: With kernel IPsec modules enabled.

Deployment Options

Method A: Turnkey Proxmox LXC Template (Recommended)

A pre-built, sanitized master LXC template is stored in Proxmox with all dependencies, Asterisk IMS patches, Docker images, and auto-detecting control plane pre-installed.

Option 1: Proxmox Web GUI

  1. In the Proxmox tree, right-click vowifi-template (VMID 107) $\rightarrow$ Clone.
  2. Mode:
    • Linked Clone (Instant, 0 extra disk space)
    • Full Clone (Independent copy)
  3. Enter your new VMID and Name (e.g. vowifi-sim2).
  4. Go to Network $\rightarrow$ assign your static IP (or leave as DHCP).
  5. Start container!

Alternatively, click Create CT at the top right $\rightarrow$ under Template, select local:vztmpl/vowifi-gateway-clean-ubuntu-24.04.tar.zst.

Option 2: Proxmox CLI

# 1. Clone template (e.g. into VMID 108)
pct clone 107 108 --hostname vowifi-sim2

# 2. Assign static IP
pct set 108 -net0 name=eth0,bridge=vmbr0,firewall=1,gw=192.168.1.1,ip=192.168.1.108/24

# 3. Pass through the dedicated USB SIM reader (adjust bus/device from lsusb)
pct set 108 -dev0 /dev/bus/usb/001/005,mode=0666

# 4. Start the container
pct start 108

Method B: Clean Installation from Scratch

1. Host Preparation (Proxmox Host)

Run the automated host setup script to configure udev rules and kernel modules:

git clone https://github.com/mosfaqur/vowifi.git /root/vowifi
/root/vowifi/scripts/setup_lxc_host.sh

2. Proxmox Container Configuration

In /etc/pve/lxc/<VMID>.conf, ensure the following passthrough devices and features are enabled:

features: nesting=1,keyctl=1
dev0: /dev/bus/usb/001/002,mode=0666
dev1: /dev/net/tun,mode=0666

(Adjust the USB bus and device numbers to match lsusb on your host).

3. Deploy Inside the LXC Container

Log in to your Ubuntu 24.04 container and run the automated deployment script:

git clone https://github.com/mosfaqur/vowifi.git /root/vowifi
/root/vowifi/scripts/deploy_lxc.sh

Tip: deploy_lxc.sh automatically fetches the gateway codebase, builds the fast Asterisk engine layer in ~30 seconds (bypassing the standard 20-minute compile), and configures the control plane service.


Configuration & Access

1. Essential Carrier Configuration Note

When provisioning your SIM line in the WebUI:

  • APN: Set to ims.
  • IDr Mode: If your operator's ePDG rejects registration with AUTHENTICATION_FAILED (24), ensure idr_mode is set to apn (bare string "ims") rather than fqdn. See docs/OPERATOR_CONFIG_EXAMPLE.md.

2. Access the WebUI

Open your browser and navigate to:

https://<LXC_IP>:8443

Accept the self-signed TLS certificate to access the line dashboard, softphone, and SMS messages.

3. Verify Registration via CLI

Check that your line successfully registered to the carrier IMS core:

docker exec vowifi-engine-1 asterisk -rx 'pjsip show registrations'

Expected output:

 <Registration/ServerURI..............................>  <Auth....................>  <Status.......>
==========================================================================================
 volte_ims/sip:ims.mnc003.mcc470.3gppnetwork.org         volte_ims                   Registered

Attribution & Licenses

This project integrates work from several specialized open-source cellular projects:

See docs/SOURCES_AND_ATTRIBUTION.md for complete details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages