sip/sip_message library

Minimal RFC 3261 message model — enough to talk to the dart-pbx server.

A SipMessage is either a request (has method + requestUri) or a response (has statusCode + reasonPhrase). Headers are kept as a list of (name, value) pairs because SIP allows duplicates (Via, Route, ...).

Classes

SipMessage

Functions

extractUri(String headerValue) String
Returns the URI from a name-addr or addr-spec header value (From, To, Contact). Strips display name and surrounding angle brackets and any header parameters after the URI.
parseAuthHeader(String value) Map<String, String>
Parses a comma-separated name=value parameter list (e.g. an Authorization or WWW-Authenticate header body, minus the scheme prefix).