Skip to content
DinosaurPotato534Public

About

Reverse engineering Apple Private API to place a real cellular call from a Mac

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Placing a real cellular call from a Mac (headless / programmatic)

TL;DR

tucall is a small Objective-C tool that programatically places a real cellular phone call from a Mac by driving Apple's private TelephonyUtilities framework directly. The call goes out over the paired iPhone's cell via Continuity (the same relay Phone.app uses), so the recipient sees a normal call from the iPhone's number and it reaches Android and landlines.

# one-time per machine: SIP off + AMFI boot-arg (see "One-time machine setup")
# then, each time you build:
./sign-tucall.sh +1XXXXXXXXXX

Status: proven working on macOS 27.0 (26A5368g), Apple Silicon


Why this approach

The obvious approaches were tried and rejected:

Approach Verdict
open tel: + click the "Click to Call" banner The banner is an AXNotificationCenterBanner with no accessibility children and no AXPress, meaning its button cannot be reached programmatically. Coordinate-clicking works but isn't reliable (breaks on any size/position change).
BlueBubbles-style notification scripting Reads static text of the notification group, which stopped working when Apple stopped vending banner internals over AX.
AppleScript call verb Phone.app and FaceTime.app ship no scriptable dictionary.
Drive TUCallCenter directly This. Same mechanism Phone.app uses. Requires entitlements but is robust and legible.

On macOS 26/27 the tel: handler is Phone.app, not FaceTime. FaceTime is irrelevant here.


How the final system works

The call pipeline

tucall (our process)
  │  dlopen TelephonyUtilities.framework
  │  build a TUDialRequest from tel:<number>
  │  attach the sender identity (which phone line to dial as)
  │  clear showUIPrompt (no banner)
  ▼
TUCallCenter.sharedInstance  ──XPC──►  callservicesd
                                          │  entitlement check: access-calls + modify-calls
                                          │  dispatch to the coretelephony call provider
                                          ▼
                                       Continuity relay ──► paired iPhone's cellular radio ──► callee

The Mac has no baseband of its own. "Telephony" on a Mac is the Continuity relay to the iPhone.

What tucall does, step by step

  1. dlopen /System/Library/PrivateFrameworks/TelephonyUtilities.framework. All the classes below are private, so everything is resolved and called dynamically (via NSInvocation with checked method signatures).
  2. Build a TUDialRequest with -initWithURL: from tel:<number>. The framework parses the URL, resolving the telephony provider and service.
  3. Attach the sender identity - setLocalSenderIdentityUUID: + setLocalSenderIdentityAccountUUID:. This is which cell number the call is placed as, sourced from the iPhone. This is machine-specific (see "Sender identity" below).
  4. Clear showUIPrompt so no "Click to Call" notification appears, the call just starts.
  5. Preflight - canDialWithRequest: and the relay-availability probe log whether the call is dialable and whether it will use the cellular relay, before anything rings.
  6. dialWithRequest: on TUCallCenter.sharedInstance. Returns a TUProxyCall.
  7. Watch the proxy call for up to 45s, printing the state each second (Sending -> Dialing -> Connected, or Disconnected). The receiving handset is the only real pass/fail; the watch loop is a heuristic on top.

The three gates (all discovered from the callservicesd log)

Each gate announced itself in the log; each was closed in turn:

  1. access-calls entitlement - without it, callservicesd rejects the XPC connection to its callstatecontroller outright (entitlementCapabilities={( )}).
  2. modify-calls entitlement - with only access-calls, the client can observe calls but -[CSDCallStateController dialWithRequest:] rejects it: "lacks capability 'modify-calls'". Needed to place a call.
  3. A sender identity on the request - without it, the request is accepted but has no line to originate on; the call is minted and sits at Sending forever.

Both entitlements are granted by ad-hoc code-signing (sign-tucall.sh). The sender identity is set at runtime by tucall.


Prerequisites

Hardware / accounts

  • A Mac (Apple Silicon; Intel should work but is untested here) paired with an iPhone.
  • Same Apple ID on both, signed in to FaceTime on the Mac.
  • The iPhone has an active cellular line.

iPhone relay (Continuity calling)

  • iPhone -> Settings -> Phone -> Calls on Other Devices -> Allow Calls on Other Devices ON, and this Mac toggled on in the per-device list underneath.
  • iPhone -> Settings -> Phone -> Wi-Fi Calling ON.
  • Mac -> FaceTime -> Settings -> General -> "Calls From iPhone" checked.
  • Both devices on the same Wi-Fi, Bluetooth on, iPhone unlocked and nearby.
  • Sanity check: place a normal call from FaceTime/Phone.app on the Mac. If that doesn't ring, fix the relay first. tucall cannot work until the native path does.

Toolchain

  • Xcode Command Line Tools: xcode-select --install (provides clang, codesign).

Security posture (see next section)

  • SIP disabled and amfi_get_out_of_my_way=0x1 in boot-args.

One-time machine setup: SIP + AMFI

The entitlement com.apple.telephonyutilities.callservicesd is a restricted Apple entitlement. AMFI (the kernel's code-signing enforcer) will only honour it on a self-signed binary when the machine is at Permissive Security with the AMFI boot-arg set. Otherwise the binary is SIGKILLed the instant it loads the framework (zsh: killed ./tucall).

This is a real, lasting reduction in the machine's security. With amfi_get_out_of_my_way=0x1, any binary can claim any Apple entitlement, system-wide. Do this only on a machine where that trade-off is acceptable. Revert steps are at the end.

Steps (Apple Silicon)

  1. Disable SIP:

    • Shut down. Hold the power button until "Loading startup options" appears -> Options -> Continue -> pick an admin user.
    • Utilities -> Terminal, then:
      csrutil disable
      
  2. Set the AMFI boot-arg. Boot back into normal MacOS, then open a fresh terminal and run these as sudo: Be sure to check for existing args so you don't accidentally remove them:

    nvram boot-args                # note any existing value
    nvram boot-args="amfi_get_out_of_my_way=0x1"
    # if boot-args already had a value, preserve it, e.g.:
    # nvram boot-args="-v amfi_get_out_of_my_way=0x1"
    nvram boot-args                # confirm it echoes back
    

After OS updates: nvram survives updates, but a point release can reset it. If tucall suddenly gets SIGKILLed again, check nvram boot-args first.


Sender identity (MACHINE-SPECIFIC)

tucall must attach which phone line to dial as to the request. This is a pair of UUIDs (localSenderIdentityUUID and localSenderIdentityAccountUUID) that are specific to your Mac + iPhone pairing.

tucall tries to discover them at runtime (via TUSenderIdentityClient), but that discovery is best-effort and unverified across machines. If the call fails on a fresh machine, find your own UUIDs and pass them explicitly. It's a 60-second procedure:

  1. In one terminal, stream the log to a file:
    log stream --style compact --predicate 'process == "callservicesd" OR process == "FaceTime" OR process == "Phone"' --level debug > native.txt
    
  2. Place a normal call from Phone.app on the Mac; let it ring, hang up, Ctrl-C the stream.
  3. Extract the two UUIDs:
    grep -oE 'localSenderIdentityUUID=[0-9A-F-]+ localSenderIdentityAccountUUID=[0-9A-F-]+' native.txt | head -1
    
  4. Pass them to tucall:
    ./tucall +1XXXXXXXXXX --si-uuid <UUID> --si-account <ACCOUNT-UUID>
    
    (Or edit the two siUUID / siAccount defaults near the top of main() in tucall.m and rebuild.)

Build & run

Build + sign (produces the dialing binary)

chmod +x sign-tucall.sh tucall.sh
./sign-tucall.sh                 # build + sign + verify entitlements

This is the only correct way to build the dialer. It compiles tucall.m, signs it ad-hoc with both entitlements, and verifies they're embedded. tucall.sh must not be used to build the dialer as it recompiles unsigned and strips the signature.

Place a call

./tucall +1XXXXXXXXXX            # dial with the signed binary
# or, build + sign + dial in one step:
./sign-tucall.sh +1XXXXXXXXXX

Watch the daemon (recommended while verifying)

In a second terminal:

log stream --style compact --predicate 'process == "callservicesd" OR process == "tucall"' --level debug

All flags

Flag Effect
+1XXXXXXXXXX Number to dial (10 digits assumes +1).
--dry-run Build the request + run preflight, but do not place the call yet.
--dump Print the TUCallCenter / TUDialRequest / TUHandle API surface.
--dump-si Print the sender-identity / provider API surface (diagnostics).
--si-uuid <U> Override the sender-identity UUID (see "Sender identity").
--si-account <U> Override the sender-identity account UUID.
--no-si Dial without a sender identity (will reproduce the Sending stall).
--watch <sec> How long to watch the call state (default 45).
--via-handle Force the -init + -setHandle: construction path instead of initWithURL:.
--register Force a registered call center via the shouldRegister: factory.

--dump, --dump-si, and --dry-run do not place a call and don't need the signature, so they can be run via ./tucall.sh <number> --dump. Anything that actually dials must use the signed ./tucall binary.


Verifying success

In the tucall output:

  • The --- sender identity --- block shows both UUIDs set and non-null.
  • The call state moves Sending -> ... -> Connected (or your phone simply rings).

In the callservicesd log:

  • entitlementCapabilities={( "access-calls", "modify-calls" )}
  • No lacks capability line.
  • A CXStartCallAction / CXTransaction is created and committed.

Troubleshooting (log signature -> cause)

Symptom Log signature Cause & fix
zsh: killed ./tucall (process dies before any output) AMFI is stripping the entitlement. SIP off and amfi_get_out_of_my_way=0x1 required. See "One-time machine setup".
Rejected connection entitlementCapabilities={( )} ... lacks the access-calls capability Binary unsigned or entitlements stripped. Re-run sign-tucall.sh; Don't build with tucall.sh.
Stalls at Sending, count stays 0 lacks capability 'modify-calls' Only access-calls was granted. Ensure the entitlements plist has both (it does in this sign-tucall.sh); re-sign.
Stalls at Sending, p=(null) svc=Unknown isProviderAvailable: NO, cloudCallingDevices: ( ) iPhone relay not live. Fix the iPhone relay settings; confirm a native call rings first.
Stalls at Sending, provider OK request shows localSenderIdentityUUID=(null) No sender identity attached (or wrong UUIDs for this machine). See "Sender identity".
Rings as FaceTime Audio / shows an email - The tel:/telephony provider wasn't used. Confirm provider ... identifier=com.apple.coretelephony in the request.

Outputs you can ignore: Retrieving active contexts ... Permission denied, com.apple.accounts Code=7, corerecents / contacts errors. These are tucall lacking unrelated permissions (contacts, recents).


Security posture & how to revert everything

This setup leaves the machine at Permissive Security with AMFI enforcement relaxed. To restore:

  1. Clear the boot-arg (from normal macOS):
    sudo nvram boot-args="" # Make sure to restore any previous boot-args.
    
  2. Reboot into recoveryOS (hold power -> Options), open Terminal:
    csrutil enable
    
    and in Startup Security Utility, set the volume back to Full Security.
  3. Reboot. Confirm csrutil status -> enabled and nvram boot-args -> empty (or default).

tucall will no longer run after this (by design). It depends on the relaxed posture.


Known limitations / notes

  • Private API. TelephonyUtilities is undocumented and can change across major macOS releases.
  • Machine-specific sender identity. Each machine needs its own UUIDs.
  • Security trade-off Permissive Security + AMFI boot-arg is not a per-app relaxation.
  • You need to have an iPhone No live iPhone relay -> no call, regardless of code.
  • Not a supported Apple interface. This is not official in any way shape and/or form.

About

Reverse engineering Apple Private API to place a real cellular call from a Mac

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages