# README
SIP stack in GO
This SIP stack for RFC:
https://datatracker.ietf.org/doc/html/rfc3261
Stack:
- Encoding/Decoding with
Parser
optimized for fast parsing - Transport Layer and support for different protocols
- Transaction Layer with transaction sessions managing and state machine
Parser
Parser by default parses set of headers that are mostly present in messages. From,To,Via,Cseq,Content-Type,Content-Length...
This headers are accessible via fast reference msg.Via()
, msg.From()
...
This can be configured using WithHeadersParsers
and reducing this to increase performance.
SIP stack in case needed will use fast reference and lazy parsing.
# Functions
ASCIIToLower is faster than go version.
No description provided by the author
Copy all headers of one type from one message to another.
No description provided by the author
No description provided by the author
DefaultHeadersParser returns minimal version header parser.
DefaultPort returns transport default port by network.
GenerateBranch returns random unique branch ID.
GenerateBranchN returns random unique branch ID in format MagicCookie.<n chars>.
No description provided by the author
HeaderClone is generic function for cloning header.
HeaderToLower is fast ASCII lower string.
No description provided by the author
MakeClientTxKey creates client key for matching responses - RFC 3261 17.1.3.
No description provided by the author
MakeDialogIDFromMessage creates dialog ID of message.
MakeDialogIDFromResponse creates dialog ID of message.
MakeServerTxKey creates server key for matching retransmitting requests - RFC 3261 17.2.3.
MessageShortString dumps short version of msg.
NetworkToLower is faster function converting UDP, TCP to udp, tcp.
NewAckRequest creates ACK request for 2xx INVITE https://tools.ietf.org/html/rfc3261#section-13.2.2.4 NOTE: it does not copy Via header.
No description provided by the author
No description provided by the author
NewHeader creates generic type of header.
Create an empty set of parameters.
Create a new Parser.
NewRequest creates base for building sip Request A Request-Line contains a method name, a Request-URI, and the SIP/2.0 as version No headers are added.
NewResponse creates base structure of response.
RFC 3261 - 8.2.6.
NewSDPResponseFromRequest is wrapper for 200 response with SDP body.
No description provided by the author
No description provided by the author
NewLayer creates transport layer.
No description provided by the author
No description provided by the author
ParseAddressValue parses an address - such as from a From, To, or Contact header.
No description provided by the author
ParseUri converts a string representation of a URI into a Uri object.
https://github.com/kpbird/golang_random_string.
https://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-go.
ResolveInterfaceIP will check current interfaces and resolve to IP Using targetIP it will try to match interface with same subnet network can be "ip" "ip4" "ip6" by default it avoids loopack IP unless targetIP is loopback.
ResolveSelfIP returns first non loopback IP
Deprecated use ResolveInterfacesIP.
No description provided by the author
Splits the given string into sections, separated by one or more characters from c_ABNF_WS.
UACReadRequestDialogID creates dialog ID of message if receiver has UAC role.
UASReadRequestDialogID creates dialog ID of message if receiver has UAS role.
No description provided by the author
Check uri is SIP fast.
No description provided by the author
WithHeadersParsers allows customizing parser headers parsers Consider performance when adding custom parser.
WithServerLogger allows customizing parser logger.
# Constants
method names are defined here as constants for convenience.
method names are defined here as constants for convenience.
method names are defined here as constants for convenience.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Dialog received ACK.
Dialog received BYE.
Dialog received 200 response.
FSM Inputs.
method names are defined here as constants for convenience.
method names are defined here as constants for convenience.
method names are defined here as constants for convenience.
No description provided by the author
method names are defined here as constants for convenience.
method names are defined here as constants for convenience.
method names are defined here as constants for convenience.
method names are defined here as constants for convenience.
method names are defined here as constants for convenience.
method names are defined here as constants for convenience.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
https://datatracker.ietf.org/doc/html/rfc3261#section-21.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
method names are defined here as constants for convenience.
TransportFixedLengthMessage sets message size limit for parsing and avoids stream parsing.
No description provided by the author
No description provided by the author
Transport for different sip messages.
No description provided by the author
No description provided by the author
method names are defined here as constants for convenience.
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Stream parse errors.
No description provided by the author
Transaction Layer Errors can be detected and handled with different response on caller side https://www.rfc-editor.org/rfc/rfc3261#section-8.1.3.1.
No description provided by the author
Errors.
No description provided by the author
IdleConnection will keep connections idle even after transaction terminate -1 - single response or request will close 0 - close connection immediatelly after transaction terminate 1 - keep connection idle after transaction termination.
No description provided by the author
SIP timers are exposed for manipulation but best approach is using SetTimers where all timers get populated based on T1: Round-trip time (RTT) estimate, Default 500ms.
SIP timers are exposed for manipulation but best approach is using SetTimers where all timers get populated based on T1: Round-trip time (RTT) estimate, Default 500ms.
SIP timers are exposed for manipulation but best approach is using SetTimers where all timers get populated based on T1: Round-trip time (RTT) estimate, Default 500ms.
No description provided by the author
SIP timers are exposed for manipulation but best approach is using SetTimers where all timers get populated based on T1: Round-trip time (RTT) estimate, Default 500ms.
SIP timers are exposed for manipulation but best approach is using SetTimers where all timers get populated based on T1: Round-trip time (RTT) estimate, Default 500ms.
SIP timers are exposed for manipulation but best approach is using SetTimers where all timers get populated based on T1: Round-trip time (RTT) estimate, Default 500ms.
SIP timers are exposed for manipulation but best approach is using SetTimers where all timers get populated based on T1: Round-trip time (RTT) estimate, Default 500ms.
SIP timers are exposed for manipulation but best approach is using SetTimers where all timers get populated based on T1: Round-trip time (RTT) estimate, Default 500ms.
SIP timers are exposed for manipulation but best approach is using SetTimers where all timers get populated based on T1: Round-trip time (RTT) estimate, Default 500ms.
SIP timers are exposed for manipulation but best approach is using SetTimers where all timers get populated based on T1: Round-trip time (RTT) estimate, Default 500ms.
SIP timers are exposed for manipulation but best approach is using SetTimers where all timers get populated based on T1: Round-trip time (RTT) estimate, Default 500ms.
SIP timers are exposed for manipulation but best approach is using SetTimers where all timers get populated based on T1: Round-trip time (RTT) estimate, Default 500ms.
SIP timers are exposed for manipulation but best approach is using SetTimers where all timers get populated based on T1: Round-trip time (RTT) estimate, Default 500ms.
SIP timers are exposed for manipulation but best approach is using SetTimers where all timers get populated based on T1: Round-trip time (RTT) estimate, Default 500ms.
SIP timers are exposed for manipulation but best approach is using SetTimers where all timers get populated based on T1: Round-trip time (RTT) estimate, Default 500ms.
No description provided by the author
No description provided by the author
No description provided by the author
WebSocketProtocols is used in setting websocket header By default clients must accept protocol sip.
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
ContactHeader is Contact header representation.
CSeq is CSeq header.
No description provided by the author
No description provided by the author
No description provided by the author
Parser is implementation of SIPParser It is optimized with faster header parsing.
No description provided by the author
RecordRouteHeader is Record-Route header representation.
Request RFC 3261 - 7.1.
Response RFC 3261 - 7.2.
RouteHeader is Route header representation.
No description provided by the author
No description provided by the author
ToHeader introduces SIP 'To' header.
No description provided by the author
TransportLayer implementation.
No description provided by the author
Uri is parsed form of sip:user:password@host:port;uri-parameters?headers In case of `sips:“ Encrypted is set to true.
ViaHeader is Via header representation.
No description provided by the author
# Interfaces
No description provided by the author
No description provided by the author
CopyHeader is internal interface for cloning headers.
Header is a single SIP header.
No description provided by the author
No description provided by the author
No description provided by the author
Protocol implements network specific features.
# Type aliases
CallIDHeader is a Call-ID header presentation.
ContentLengthHeader is Content-Length header representation.
ContentTypeHeader is Content-Type header representation.
No description provided by the author
No description provided by the author
ExpiresHeader is Expires header representation.
No description provided by the author
HeaderParams are key value params.
A HeaderParser is any function that turns raw header data into one or more Header objects.
MaxForwardsHeader is Max-Forwards header representation.
No description provided by the author
ParserOption are addition option for NewParser.
No description provided by the author
No description provided by the author
StatusCode - response status code: 1xx - 6xx.
No description provided by the author