Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ringoflow

ringo-flow is a declarative telephony scenario test runner for baresip. You write a scenario as a small JavaScript or TypeScript file — bring up SIP agents, place and answer calls, assert on call state, DTMF, audio and HTTP — and run it headlessly, e.g. in CI.

// @ts-check
const domain = env("SIP_DOMAIN");

const a = new Agent("A", { username: env("A_USER"), domain, password: env("A_PASS") });
const b = new Agent("B", { username: env("B_USER"), domain, password: env("B_PASS") });

a.register();
b.register();
await until(() => expect(b.registered).toBeTruthy(), "10s");

a.dial(b);
await until(() => expect(b.state).toBe(State.Ringing), "15s");
b.accept();
await until(() => expect(a.state).toBe(State.Established));
a.hangup();

Highlights

  • Headless — virtual audio, no devices needed; runs on a build server.
  • Typed, in your editor — the generated ringo-flow.d.ts types the whole DSL, so agent config keys, matchers and argument types are checked as you type. Author in plain .js with // @ts-check, or in real TypeScript.
  • Suitessetup / scenario / teardown, each scenario isolated with fresh agents. Parametrise with scenario.each, select with --scenario, tag with --tag / --exclude-tag, disable with skip, focus with only.
  • Audio — send tones / files and assert what the other side receives (Goertzel tone detection).
  • HTTP — call backend APIs mid-scenario, and stand up a built-in mock server to test webhook-driven call control.

Scenarios used to be written in Rhai. That frontend still runs .rhai files but is deprecated and will be removed — see Rhai frontend for the reasons and a migration table.

Next steps

The Rust library API is on docs.rs.