The live softphone call session (provides the encoder, RTP counters, and sendPacket).
The injected werift-rtp constructors (RtpHeader / RtpPacket).
Appends one outbound PCM16 frame (the model's voice, already at the codec rate) to the send queue.
Barge-in: drop all queued (not-yet-sent) audio so the agent goes silent immediately. The softphone has no internal outbound buffer to clear — once tick has sent a frame it's on the wire — so dropping the local queue is the whole flush.
Starts the 20 ms send clock (idempotent). No-op frames are skipped when the queue is short.
Stops the clock and drops any queued audio. Called on hangup / call end.
Sends exactly one frame if a whole packetSize chunk is queued and the call is live; otherwise a
no-op (silence is simply the absence of packets — RTP needs no filler). Public so tests drive the
clock deterministically.
An appendable, self-paced RTP audio sender over a live SoftphoneCallSession. Construct one per call (after the session is live), start it, feed the agent's PCM via enqueue, flush on barge-in, and stop on hangup.