Documentation ¶
Index ¶
- func GenerateBranchID() string
- func GenerateNewCallID() string
- func MessageDetails(data *SipMsg) string
- func ParseSipAuth(v []byte, out *SipAuth)
- func ParseSipContact(v []byte, out *SipContact)
- func ParseSipCseq(v []byte, out *SipCseq)
- func ParseSipFrom(v []byte, out *SipFrom)
- func ParseSipReq(v []byte, out *SipReq)
- func ParseSipTo(v []byte, out *SipTo)
- func ParseSipVia(v []byte, out *SipVia)
- type SipAuth
- func (sa *SipAuth) GetAlgorithm() string
- func (sa *SipAuth) GetCNonce() string
- func (sa *SipAuth) GetNc() string
- func (sa *SipAuth) GetNonce() string
- func (sa *SipAuth) GetQoP() string
- func (sa *SipAuth) GetRealm() string
- func (sa *SipAuth) GetResponse() string
- func (sa *SipAuth) GetURI() string
- func (sa *SipAuth) GetUsername() string
- func (sa *SipAuth) SetAlgorithm(value string)
- func (sa *SipAuth) SetCNonce(value string)
- func (sa *SipAuth) SetNc(value string)
- func (sa *SipAuth) SetNonce(value string)
- func (sa *SipAuth) SetQoP(value string)
- func (sa *SipAuth) SetRealm(value string)
- func (sa *SipAuth) SetResponse(value string)
- func (sa *SipAuth) SetURI(value string)
- func (sa *SipAuth) SetUsername(value string)
- func (sa *SipAuth) String() string
- type SipContact
- type SipCseq
- type SipFrom
- type SipMsg
- type SipReq
- func (sr *SipReq) SetHost(host string)
- func (sr *SipReq) SetMethod(method string)
- func (sr *SipReq) SetPort(port string)
- func (sr *SipReq) SetStatusCode(code int)
- func (sr *SipReq) SetStatusDesc(desc string)
- func (sr *SipReq) SetUriType(uriType string)
- func (sr *SipReq) SetUser(user string)
- func (sr *SipReq) SetUserType(userType string)
- func (sr *SipReq) String() string
- type SipTo
- type SipVal
- type SipVia
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MessageDetails ¶
MessageDetails prints all we know about the struct in a readable format
func ParseSipAuth ¶
ParseSipAuth parse's WWW-Authenticate/Authorization headers
func ParseSipContact ¶
func ParseSipContact(v []byte, out *SipContact)
ParseSipContact parses SIP contact header
func ParseSipFrom ¶
ParseSipFrom parser for SIP from Header
Types ¶
type SipAuth ¶
type SipAuth struct { Username []byte Realm []byte Nonce []byte CNonce []byte QoP []byte Algorithm []byte Nc []byte URI []byte Response []byte Src []byte }
SipAuth SIP Authorization Header
func (*SipAuth) GetAlgorithm ¶
GetAlgorithm returns algorithm
func (*SipAuth) SetAlgorithm ¶
SetAlgorithm sets algorithm
func (*SipAuth) SetResponse ¶
SetResponse sets response
func (*SipAuth) SetUsername ¶
SetUsername sets username
type SipContact ¶
type SipContact struct { UriType string // Type of URI sip, sips, tel etc Name []byte // Named portion of URI User []byte // User part Host []byte // Host part Port []byte // Port number Tran []byte // Transport Qval []byte // Q Value Expires []byte // Expires Src []byte // Full source if needed }
SipContact SIP Contact Header
func NewContactHeader ¶
func NewContactHeader(uriType string, user string, host string) *SipContact
NewContactHeader creates new Contact Header
func (*SipContact) SetHost ¶
func (sc *SipContact) SetHost(host string)
SetHost sets host part of uri
func (*SipContact) SetName ¶
func (sc *SipContact) SetName(name string)
SetName stes name portion of header
func (*SipContact) SetUriType ¶
func (sc *SipContact) SetUriType(uriType string)
SetUriType sets the uri type e.g. sip , sips
func (*SipContact) SetUser ¶
func (sc *SipContact) SetUser(user string)
SetUser sets user part of the uri
type SipCseq ¶
type SipCseq struct { ID []byte // Cseq ID Method []byte // Cseq Method Src []byte // Full source if needed }
SipCseq SIP CSeq Header
type SipFrom ¶
type SipFrom struct { UriType string // Type of URI sip, sips, tel etc Name []byte // Named portion of URI User []byte // User part Host []byte // Host part Port []byte // Port number Tag []byte // Tag UserType []byte // User Type Src []byte // Full source if needed }
SipFrom SIP From Header
func NewFromHeader ¶
NewFromHeader creates new From header
func (*SipFrom) SetUriType ¶
SetUriType sets the uri type e.g. sip , sips
func (*SipFrom) SetUserType ¶
SetUserType sets UserType
type SipMsg ¶
type SipMsg struct { Req SipReq From SipFrom To SipTo Contact SipContact Via []SipVia Cseq SipCseq Auth SipAuth Ua SipVal Exp SipVal MaxFwd SipVal CallID SipVal ContType SipVal ContLen SipVal Src []byte Body []byte Sdp sdp.SdpMsg }
SipMsg is a representation of a SIP message
func NewRequest ¶
func NewRequest(request *SipReq, via *SipVia, to *SipTo, from *SipFrom, contact *SipContact, callID *SipVal, cseq *SipCseq, maxfor *SipVal, contlen *SipVal) *SipMsg
NewRequest creates new SIP request
func NewResponse ¶
func NewResponse(request SipReq, via []SipVia, to SipTo, from SipFrom, callID SipVal, maxfor SipVal) *SipMsg
NewResponse creates new SIP Response
func (*SipMsg) CopyHeaders ¶
CopyHeaders copys headers from one SIP message to another
func (*SipMsg) GetStatusCode ¶
GetStatusCode returns responses status code
func (*SipMsg) SetAuthHeader ¶
SetAuthHeader sets auth header
type SipReq ¶
type SipReq struct { Method []byte // Sip Method eg INVITE etc UriType string // Type of URI sip, sips, tel etc StatusCode []byte // Status Code eg 100 StatusDesc []byte // Status Code Description eg trying User []byte // User part Host []byte // Host part Port []byte // Port number UserType []byte // User Type Src []byte // Full source if needed }
SipReq is the initial line of a SIP message
func NewRequestLine ¶
NewRequestLine creates new request line
func NewResponseLine ¶
NewResponseLine creates new request line
func (*SipReq) SetStatusCode ¶
SetStatusCode gives the ability to set SIP status codes e.g. 200, 100, 302
func (*SipReq) SetStatusDesc ¶
SetStatusDesc gives the ability to set status descriptions e.g. OK, Trying, Moved Temporarily
func (*SipReq) SetUriType ¶
SetUriType gives the ability to set URI type e.g. sip:, sips:
func (*SipReq) SetUserType ¶
SetUserType sets user type
type SipTo ¶
type SipTo struct { UriType string // Type of URI sip, sips, tel etc Name []byte // Named portion of URI User []byte // User part Host []byte // Host part Port []byte // Port number Tag []byte // Tag UserType []byte // User Type Src []byte // Full source if needed }
SipTo SIP To Header
func NewToHeader ¶
NewToHeader creates new To header
func (*SipTo) SetUriType ¶
SetUriType gives the ability to set URI type e.g. sip:, sips:
func (*SipTo) SetUserType ¶
SetUserType sets user type
type SipVal ¶
SipVal is the value of a simple SIP Header e.g. Max Forwards
func NewContentLength ¶
NewContentLength creates new Content Length Header
func NewMaxForwards ¶
NewMaxForwards creates new Max Forwards header
type SipVia ¶
type SipVia struct { Trans string // Type of Transport udp, tcp, tls, sctp etc Host []byte // Host part Port []byte // Port number Branch []byte // Rport []byte // Maddr []byte // Ttl []byte // Rcvd []byte // Src []byte // Full source if needed }
SipVia SIP Via Header
func NewViaHeader ¶
NewViaHeader creates new Via Header
func (*SipVia) SetTransport ¶
SetTransport sets transport in via header