Repository navigation
v0.1.4
Registration now recovers after outages, and hard registration failures stop cleanly. Also fixes to transfer, NOTIFY handling, and unregistering, plus PSTN target normalization. There was no separate v0.1.3; its changes are included here.
Registration (#13, #19, #22, #23)
- Recovers after an outage. Before, a failed refresh threw
SIPRegistrationUserAgent is already runningand the client stopped retrying; recovery came only from SIPSorcery's own retry, 300 s later. Each start now stops the old registration agent and starts a fresh one. - Default retry is unchanged. Up to 5 attempts at 2 s × n, then SIPSorcery's own retry stays armed.
IsRegisteredandstatus.registeredarefalsewhile registration is failing. Before, they stayedtruethrough an outage.- Optional extended retry, for always-on hosts:
SipConfig.RegistrationRetry.Extended, orsipbot serve --extended-retry/SIP_EXTENDED_RETRY=1. After a temporary failure it retries forever, the delay doubling from 30 s to at most 5 min. - Hard failures stop. A 401/407 after authentication, or a 402, 403, or 404, stops the agent. No further REGISTER is sent until
StartRegistration()is called again or the process restarts, so rejected credentials are not re-sent to the PBX. - New API:
SipClient.RegistrationStateandLastRegistrationError.StartRegistration()is safe to call again at any time.
Calls and messages
- Blind transfer hangs up the original leg once the transfer is accepted, as documented. It first waits up to 5 s for the final progress NOTIFY, so the PBX gets an answer (#14, #18, #24, #25).
sipbot serveemitsendedafter a successfultransfer. - Out-of-dialog NOTIFYs are answered with 200 OK. These are the unsolicited message-waiting notices the PBX sends after registration; the PBX used to retransmit them for ~32 s (#15, #17).
- Shutdown completes the unregister, waiting up to 3 s, so no stale contact stays on the PBX (#16, #20).
- PSTN targets:
tel:URIs and E.164 or punctuated numbers are normalized for dial and transfer. Targets with control characters, encoded CR/LF, or over 1024 characters are rejected.dial failedincludes the SIP status, for example(603 Decline)(#11, #12).
sipbot serve
- New flags
--extended-retryand--sip-trace(lab use: logs full SIP messages to stderr). Both are off by default.SIP_EXTENDED_RETRYandSIP_TRACEare read bysipbotonly. The startup line reports both settings. - JSONL event and field names are unchanged.
Compatibility
- Existing consumers keep the default retry schedule and recovery.
- A rejected account now stops registering instead of retrying, so restart after fixing credentials.
Dispose()can take up to 3 s longer when the registrar does not answer the unregister.BlindTransferAsynccan take up to 5 s longer when the transferee sends no progress NOTIFY.
Testing
- Unit tests: 98, including a scripted loopback registrar for the registration paths.
- Live tests against a VitalPBX (Asterisk 20.14) lab PBX:
- 60 s and 4-minute outages in default and extended retry, and three repeated cycles. Threads and file descriptors stayed flat. Registration returned within the pending retry wait (19–24 s in extended mode, 11.7 s in default).
- Dial and transfer targets, and the transfer, NOTIFY, and unregister fixes.
- The existing agent E2E suite, and the JSONL contract compared with v0.1.2.
- These release assets were re-tested after download.