Skip to content

v0.1.5

Choose a tag to compare

@github-actions github-actions released this 26 Sep 05:26
· 3 commits to master since this release

Adds an event for when an outbound call starts ringing, so a host can time the ring from that moment instead of from the INVITE.

SipClient.CallRinging (#27, #28)

  • What it is: event Action<SipClient, int> CallRinging. It is raised once per CallAsync, on the first 180 Ringing or 183 Session Progress, and carries that status code.
  • When it doesn't fire: after a second ringing response or after other provisional responses such as 181. It also doesn't fire when no ringing response arrives.
  • Why: before this, the first ringing response was reported only as StatusMessage text, which is not a contract. CallAsync's ringTimeoutSeconds counts from the INVITE, so authentication challenges, PBX routing, and carrier setup all used up ring time.
  • Usage: to time the ring from ringing, pass a larger ringTimeoutSeconds as an overall cap, start your own timer when CallRinging fires, and cancel the call through the CancellationToken.
  • Unchanged: the StatusMessage text ("Call ringing: 180 Ringing.") and the call_ringing metric.

What "ringing" means depends on the PBX. Some PBXs report ringing to the caller as soon as they start dialing an extension, whatever the handset does. VitalPBX is one: it dials extensions with Asterisk's Dial option r. On such a PBX the event marks "the PBX started dialing". On a trunk call, the carrier's ringing response is what reaches the caller.

Compatibility

  • Additive only. Existing events, StatusMessage text, and CallAsync behavior are unchanged.
  • sipbot serve does not expose the event, and its JSONL output is unchanged.

Testing

  • Unit tests: 106. The new tests use a scripted loopback callee to cover 180, 183, repeated and mixed ringing responses, 181, and no provisional response.
  • Live tests against a VitalPBX (Asterisk 20.14) lab PBX, extension to extension, with a scripted callee:
    • The event fired once per call, 258–380 ms after the INVITE.
    • A cancel timed from the event left 7004–7012 ms later.
  • The existing agent E2E suite passed, and the JSONL contract matched v0.1.4.
  • These release assets were re-tested after download.