Documentation ¶
Index ¶
- Constants
- func CheckConnError(err error)
- func GenerateBranch() string
- func GenerateCallID() string
- func GenerateTag() string
- func ParseFirstLine(incomingFirstLine string) (string, []string, error)
- func StartSIP(lAddr string, rAddr string, transport string) (chan SipMessage, chan SipMessage)
- func StartTCPClient(lAddr string, rAddr string) (chan SipMessage, chan SipMessage)
- func StartUDP(lAddr string, rAddr string) (chan SipMessage, chan SipMessage)
- func TransactionLayerHandler(outboundT chan SipMessage, outbound chan SipMessage, inboundT chan SipMessage, ...)
- type ActiveClientTransactions
- func (act *ActiveClientTransactions) DeleteTransaction(id string)
- func (act *ActiveClientTransactions) GetState(id string) InviteClientState
- func (act *ActiveClientTransactions) NewTransaction(id string, outgoingMessage SipMessage)
- func (act *ActiveClientTransactions) UpdateState(id string, newState InviteClientState)
- type ClientTransaction
- type Dialog
- type InviteClientState
- type MessageType
- type Packet
- type Request
- type Response
- func (res Response) AddHeader(name string, value string)
- func (res Response) GetBody() string
- func (res Response) GetFirstLine() string
- func (res Response) GetHeaders() map[string]string
- func (res Response) Serialize() []byte
- func (res Response) SetBody(b string)
- func (res Response) Type() MessageType
- type SipMessage
- func DeserializeSipMessage(payload []byte, streamed bool) (SipMessage, error)
- func NewDialog(fromUri string, toUri string, transport string) SipMessage
- func PrepareInDialogRequest(method string, cseq string, sipHeaders map[string]string) SipMessage
- func PrepareResponse(sipHeaders map[string]string, code int, reasonPhrase string) SipMessage
Constants ¶
const ( REQUEST = "request" RESPONSE = "response" )
REQUEST is used for processing SIP requests RESPONSE is used for processing SIP responses
Variables ¶
This section is empty.
Functions ¶
func CheckConnError ¶
func CheckConnError(err error)
CheckConnError is used to check for errors encountered during connection establishment
func StartSIP ¶
func StartSIP(lAddr string, rAddr string, transport string) (chan SipMessage, chan SipMessage)
func StartTCPClient ¶
func StartTCPClient(lAddr string, rAddr string) (chan SipMessage, chan SipMessage)
StartTCPClient prepares TCP connection and returns inbound/outbound channels
func StartUDP ¶
func StartUDP(lAddr string, rAddr string) (chan SipMessage, chan SipMessage)
StartUDP prepares and returns UDP connection
func TransactionLayerHandler ¶
func TransactionLayerHandler(outboundT chan SipMessage, outbound chan SipMessage, inboundT chan SipMessage, inbound chan SipMessage)
Types ¶
type ActiveClientTransactions ¶
type ActiveClientTransactions struct {
// contains filtered or unexported fields
}
func (*ActiveClientTransactions) DeleteTransaction ¶
func (act *ActiveClientTransactions) DeleteTransaction(id string)
func (*ActiveClientTransactions) GetState ¶
func (act *ActiveClientTransactions) GetState(id string) InviteClientState
func (*ActiveClientTransactions) NewTransaction ¶
func (act *ActiveClientTransactions) NewTransaction(id string, outgoingMessage SipMessage)
func (*ActiveClientTransactions) UpdateState ¶
func (act *ActiveClientTransactions) UpdateState(id string, newState InviteClientState)
type ClientTransaction ¶
type ClientTransaction struct {
// contains filtered or unexported fields
}
ClientTransaction describes client transaction
type InviteClientState ¶
type InviteClientState uint8
const ( InviteClientCalling InviteClientState = iota + 1 InviteClientProceeding InviteClientCompleted InviteClientTerminated )
FSM states for Invite Client Transactions
type Packet ¶
type Packet struct {
// contains filtered or unexported fields
}
Packet stores UDP connection data and payload
type Request ¶
type Request struct { Method string RUri string SipVersion string Headers map[string]string Body string }
func (Request) GetFirstLine ¶
func (Request) GetHeaders ¶
func (Request) Type ¶
func (req Request) Type() MessageType
type Response ¶
type Response struct { SipVersion string StatusCode int ReasonPhrase string Headers map[string]string Body string }
func (Response) GetFirstLine ¶
func (Response) GetHeaders ¶
func (Response) Type ¶
func (res Response) Type() MessageType
type SipMessage ¶
type SipMessage interface { Type() MessageType GetBody() string GetHeaders() map[string]string GetFirstLine() string SetBody(string) AddHeader(string, string) Serialize() []byte }
func DeserializeSipMessage ¶
func DeserializeSipMessage(payload []byte, streamed bool) (SipMessage, error)
DeserializeSipMessage transforms bytes comprising a sip message into SIP message
func NewDialog ¶
func NewDialog(fromUri string, toUri string, transport string) SipMessage
NewDialog prepares INVITE for initiation of a new dialog
func PrepareInDialogRequest ¶
func PrepareInDialogRequest(method string, cseq string, sipHeaders map[string]string) SipMessage
PrepareInDialogRequest prepares in-dialog requests
func PrepareResponse ¶
func PrepareResponse(sipHeaders map[string]string, code int, reasonPhrase string) SipMessage
PrepareResponse builds basic structure for a response to an incoming request