reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
The reSIProcate Utility Library (rutil)

rutil holds the general-purpose code that the SIP stack, the Dialog Usage Manager and the other reSIProcate libraries are built on.

Very little of it is SIP-specific; for SIP, see The reSIProcate SIP Stack library (resip) and The Dialog Usage Manager library (dum).

Strings and Parsing

  • resip::Data is reSIProcate's string and byte-buffer class, used in place of std::string throughout the libraries. It can share or borrow buffers instead of copying them, and has helpers for hex, base64, URL and XML encoding, and number conversion.
  • resip::ParseBuffer is a bounds-checked cursor over a buffer, used by all of the parsers.
  • resip::Inserter streams any container whose elements have operator<<.

Threads and Queues

Sockets and Event Loops

DNS

The asynchronous DNS resolver used by the SIP stack lives in rutil/dns. resip::DnsStub caches results and runs queries for A, AAAA, SRV, NAPTR and CNAME records; it talks to the network through the resip::ExternalDns interface, which resip::AresDns implements using either c-ares or the bundled copy of ares.

Logging

resip::Log is configured with resip::Log::initialize(), which can log to the console, syslog, a file or an application-supplied resip::ExternalLogger, with per-thread and per-subsystem levels. Code logs through the StackLog, DebugLog, InfoLog, WarningLog, ErrLog and CritLog macros in Logger.hxx, each tagged with a resip::Subsystem.

Other Utilities

  • resip::Timer: millisecond and microsecond clocks and the SIP T1, T2 and T4 timer values.
  • resip::Random: pseudo-random and cryptographically secure random values, in raw, hex and base64 form.
  • resip::ConfigParse: reads the command line and name = value configuration files used by repro, reTurn and the other servers.
  • resip::ServerProcess: daemonizing, PID files, signal handling and dropping privileges for those servers.
  • resip::DigestStream: computes MD5 and SHA digests through a std::ostream.
  • resip::OpenSSLInit: one-time OpenSSL setup, when built with OpenSSL.
  • resip::HepAgent: sends copies of SIP and RTCP traffic to a HEP (Homer) capture server.