pstn

command
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Command pstn is a tiny "fake PSTN" service useful for exercising upstream SBCs / dialers. For every inbound SIP call it:

  1. Randomly chooses between sending 180 Ringing or 183 Session Progress as the provisional response. With the default SIP_AUTO_RINGING=false on the VoiceBlender side, VB only emits 100 Trying until something explicitly asks for 180 or 183.
  2. Holds the call in the resulting state (ringing or early_media) for RING_DURATION (default 3s).
  3. Answers the call (sends 200 OK).
  4. Keeps the call up for ANSWERED_DURATION (default 15s).
  5. Hangs up.

At any point a caller-side disconnect is detected and the goroutine exits cleanly without a redundant hangup.

Configuration (env):

VOICEBLENDER_URL   default http://localhost:8080/v1
RING_DURATION      default 3s  — how long to ring before answering
ANSWERED_DURATION  default 15s — how long to keep the call up after answer

Like the other examples, pstn uses the WebSocket VSI feed for events; no HTTP webhook server is required.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL