Documentation ¶
Index ¶
- Constants
- Variables
- type Direction
- type RequestCallback
- type Session
- func (s *Session) Accept(statusCode sip.StatusCode)
- func (s *Session) Bye() (sip.Response, error)
- func (s *Session) CallID() *sip.CallID
- func (s *Session) Contact() string
- func (s *Session) Direction() Direction
- func (s *Session) End() error
- func (s *Session) GetEarlyMedia() string
- func (s *Session) Info(content string, contentType string)
- func (s *Session) IsEnded() bool
- func (s *Session) IsEstablished() bool
- func (s *Session) IsInProgress() bool
- func (s *Session) LocalSdp() string
- func (s *Session) LocalURI() sip.Address
- func (s *Session) Log() log.Logger
- func (s *Session) ProvideAnswer(sdp string)
- func (s *Session) ProvideOffer(sdp string)
- func (s *Session) Provisional(statusCode sip.StatusCode, reason string)
- func (s *Session) ReInvite()
- func (s *Session) Redirect(target string, code sip.StatusCode)
- func (s *Session) Reject(statusCode sip.StatusCode, reason string)
- func (s *Session) RemoteSdp() string
- func (s *Session) RemoteURI() sip.Address
- func (s *Session) Request() sip.Request
- func (s *Session) Response() sip.Response
- func (s *Session) SetState(status Status)
- func (s *Session) Status() Status
- func (s *Session) StoreRequest(request sip.Request)
- func (s *Session) StoreResponse(response sip.Response)
- func (s *Session) StoreTransaction(tx sip.Transaction)
- func (s *Session) String() string
- type Status
Constants ¶
View Source
const ( AllowedMethods = "INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO" AcceptedBody = "application/sdp, application/dtmf-relay" MaxForwards = 69 SessionExpires = 90 MinSessionExpires = 60 )
Variables ¶
View Source
var ReasonPhrase = map[uint16]string{
100: "Trying",
180: "Ringing",
181: "Call Is Being Forwarded",
182: "Queued",
183: "Session Progress",
199: "Early Dialog Terminated",
200: "OK",
202: "Accepted",
204: "No Notification",
300: "Multiple Choices",
301: "Moved Permanently",
302: "Moved Temporarily",
305: "Use Proxy",
380: "Alternative Service",
400: "Bad Request",
401: "Unauthorized",
402: "Payment Required",
403: "Forbidden",
404: "Not Found",
405: "Method Not Allowed",
406: "Not Acceptable",
407: "Proxy Authentication Required",
408: "Request Timeout",
410: "Gone",
412: "Conditional Request Failed",
413: "Request Entity Too Large",
414: "Request-URI Too Long",
415: "Unsupported Media Type",
416: "Unsupported URI Scheme",
417: "Unknown Resource-Priority",
420: "Bad Extension",
421: "Extension Required",
422: "Session Interval Too Small",
423: "Interval Too Brief",
424: "Bad Location Information",
428: "Use Identity Header",
429: "Provide Referrer Identity",
430: "Flow Failed",
433: "Anonymity Disallowed",
436: "Bad Identity-Info",
437: "Unsupported Certificate",
438: "Invalid Identity Header",
439: "First Hop Lacks Outbound Support",
440: "Max-Breadth Exceeded",
469: "Bad Info Package",
470: "Consent Needed",
478: "Unresolvable Destination",
480: "Temporarily Unavailable",
481: "Call/Transaction Does Not Exist",
482: "Loop Detected",
483: "Too Many Hops",
484: "Address Incomplete",
485: "Ambiguous",
486: "Busy Here",
487: "Request Terminated",
488: "Not Acceptable Here",
489: "Bad Event",
491: "Request Pending",
493: "Undecipherable",
494: "Security Agreement Required",
500: "DartSIP Internal Error",
501: "Not Implemented",
502: "Bad Gateway",
503: "Service Unavailable",
504: "Server Time-out",
505: "Version Not Supported",
513: "Message Too Large",
580: "Precondition Failure",
600: "Busy Everywhere",
603: "Decline",
604: "Does Not Exist Anywhere",
606: "Not Acceptable",
}
ReasonPhrase .
Functions ¶
This section is empty.
Types ¶
type RequestCallback ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
session根据callId和branchId决定,和事务一一对应. 每个新事务都有新的Session. 记录
func NewInviteSession ¶
func NewInviteSession(reqcb RequestCallback, uaType string, contact *sip.ContactHeader, req sip.Request, cid sip.CallID, tx sip.Transaction, dir Direction, logger log.Logger) *Session
func (*Session) GetEarlyMedia ¶
GetEarlyMedia Get sdp for early media.
func (*Session) IsEstablished ¶
func (*Session) IsInProgress ¶
func (*Session) Provisional ¶
func (s *Session) Provisional(statusCode sip.StatusCode, reason string)
Provisional send a provisional code 100|180|183
func (*Session) Redirect ¶
func (s *Session) Redirect(target string, code sip.StatusCode)
Redirect send a 3xx
func (*Session) Reject ¶
func (s *Session) Reject(statusCode sip.StatusCode, reason string)
Reject Reject incoming call or for re-INVITE or UPDATE,
func (*Session) StoreRequest ¶
func (*Session) StoreResponse ¶
func (*Session) StoreTransaction ¶
func (s *Session) StoreTransaction(tx sip.Transaction)
type Status ¶
type Status string
const ( InviteSent Status = "InviteSent" /**< After INVITE s sent */ InviteReceived Status = "InviteReceived" /**< After INVITE s received. */ ReInviteReceived Status = "ReInviteReceived" /**< After re-INVITE/UPDATE s received */ //Answer Status = "Answer" /**< After response for re-INVITE/UPDATE. */ Provisional Status = "Provisional" /**< After response for 1XX. */ EarlyMedia Status = "EarlyMedia" /**< After response 1XX with sdp. */ WaitingForAnswer Status = "WaitingForAnswer" WaitingForACK Status = "WaitingForACK" /**< After 2xx s sent/received. */ Answered Status = "Answered" Canceled Status = "Canceled" Confirmed Status = "Confirmed" /**< After ACK s sent/received. */ Failure Status = "Failure" /**< Session s rejected or canceled. */ Terminated Status = "Terminated" /**< Session s terminated. */ )
Click to show internal directories.
Click to hide internal directories.