Skip to content

feat(ops): M7 CP4 — migrate bin/call.sh to an AMI operational command (M-k)#160

Merged
ryanmurf merged 1 commit into
masterfrom
feat/m7-cp4-call-sh-ami-migration
Jul 17, 2026
Merged

feat(ops): M7 CP4 — migrate bin/call.sh to an AMI operational command (M-k)#160
ryanmurf merged 1 commit into
masterfrom
feat/m7-cp4-call-sh-ami-migration

Conversation

@ryanmurf

Copy link
Copy Markdown
Owner

M7 CP4 (M-k) — migrate bin/call.sh to an AMI operational command

The FreeSWITCH/ESL bin/call.sh (gateway preflight + originate + unconditional
hupall over ESL) is replaced by an AMI-native operational command.

  • bin/call.sh — AMI-native (Action: Originate / CoreShowChannels /
    Hangup); reads its AMI secret from a mounted k8s Secret file (never argv);
    refuses a duplicate concurrent call to the same destination; and turns the
    old hupall foot-gun into an explicit, doubly-guarded operation —
    --hangup-all and --force are both required. --hangup-all alone
    refuses; a bare --hangup DEST targets only that destination.
  • bin/ami_call.py — the low-level AMI transport (list / originate /
    hangup), secret read from --secret-file.

Receiver-side proof (isolated offline-carrier harness)

tests/cp4-call-command/run.sh drives the command against the offline carrier:

A --dry-run places no call:                        PASS
B real call reaches carrier (1 INVITE):            PASS
C duplicate-call guard refuses 2nd identical call: PASS
D --hangup-all without --force REFUSES (guarded):  PASS  (rc=3)
E --hangup-all --force performs guarded hupall:    PASS

Captured REDs (defeat each guard in the script)

  • A dry-run branch defeated → it places a real call → A FAIL.
  • C duplicate guard defeated → the carrier sees two INVITEs → C FAIL.
  • D --force guard defeated → --hangup-all fires unconfirmed (rc=0), the
    live call is torn down → D FAIL (the foot-gun).

No Rust changes; cargo test/clippy --workspace --exclude pjsip-shim unaffected
(green). Tested only against the offline carrier — never live qa-sip.

… (M-k)

The FreeSWITCH/ESL bin/call.sh is replaced by an AMI-native operational command:

- bin/call.sh — AMI-native (Action: Originate / CoreShowChannels / Hangup),
  reads its AMI secret from a mounted k8s Secret FILE (never argv), refuses to
  stack a duplicate concurrent call to the same destination, and turns the old
  unconditional `hupall` foot-gun into an EXPLICIT, DOUBLY-GUARDED operation:
  --hangup-all AND --force are BOTH required; --hangup-all alone refuses, and a
  bare --hangup targets only the named destination.
- bin/ami_call.py — the low-level AMI transport (list / originate / hangup),
  reading the secret from --secret-file.

Proven against the OFFLINE carrier (tests/cp4-call-command), receiver-side:
  A --dry-run places NO call (carrier sees no INVITE);
  B a real call reaches the carrier (one INVITE);
  C the duplicate-call guard refuses a second concurrent identical call;
  D --hangup-all WITHOUT --force refuses (rc=3; the live call is untouched);
  E --hangup-all --force performs the guarded hupall (carrier sees the BYE).
Captured REDs (defeat each guard in the script): dry-run then places a call (A
FAIL); duplicate guard off -> two INVITEs (C FAIL); --force guard off ->
--hangup-all fires unconfirmed (D FAIL).
@ryanmurf
ryanmurf merged commit 0251a24 into master Jul 17, 2026
3 checks passed
@ryanmurf
ryanmurf deleted the feat/m7-cp4-call-sh-ami-migration branch July 17, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant