Repository navigation
v0.1.5
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 perCallAsync, on the first180 Ringingor183 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
StatusMessagetext, which is not a contract.CallAsync'sringTimeoutSecondscounts 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
ringTimeoutSecondsas an overall cap, start your own timer whenCallRingingfires, and cancel the call through theCancellationToken. - Unchanged: the
StatusMessagetext ("Call ringing: 180 Ringing.") and thecall_ringingmetric.
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,
StatusMessagetext, andCallAsyncbehavior are unchanged. sipbot servedoes 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.