Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadRequest = NewError(BadRequest, "bad request") ErrForbidden = NewError(Forbidden, "forbidden") ErrMethodNotAllowed = NewError(MethodNotAllowed, "method not allowed") ErrNotAcceptable = NewError(NotAcceptable, "not acceptable") ErrProxyAuthenticationRequired = NewError(ProxyAuthenticationRequired, "proxy authentication required") ErrGone = NewError(Gone, "gone") ErrRequestEntityTooLarge = NewError(RequestEntityTooLarge, "request entity too large") ErrRequestURITooLong = NewError(RequestURITooLong, "request URI too long") ErrUnsupportedMediaType = NewError(UnsupportedMediaType, "unsupported media type") ErrUnsupportedURIScheme = NewError(UnsupportedURIScheme, "bad unsupported URI scheme") ErrExtensionRequired = NewError(ExtensionRequired, "extension required") ErrIntervalTooBrief = NewError(IntervalTooBrief, "interval too brief") ErrCallTransactionDoesNotExist = NewError(CallTransactionDoesNotExist, "call/transaction does not exist") ErrLoopDetected = NewError(LoopDetected, "loop detected") ErrTooManyHops = NewError(TooManyHops, "too many hops") ErrAddressIncomplete = NewError(AddressIncomplete, "address incomplete") ErrAmbiguous = NewError(Ambiguous, "ambiguous") ErrBusyHere = NewError(BusyHere, "busy here") ErrRequestTerminated = NewError(RequestTerminated, "request terminated") ErrNotAcceptableHere = NewError(NotAcceptableHere, "not acceptable here") ErrRequestPending = NewError(RequestPending, "request pending") ErrUndecipherable = NewError(Undecipherable, "undecipherable") ErrServerInternalError = NewError(ServerInternalError, "server internal error") ErrNotImplemented = NewError(NotImplemented, "not implemented") ErrBadGateway = NewError(BadGateway, "bad gateway") ErrServerTimeout = NewError(ServerTimeout, "server timeout") ErrVersionNotSupported = NewError(VersionNotSupported, "version not supported") ErrMessageTooLarge = NewError(MessageTooLarge, "message too large") ErrMethodNotImplemented = NewError(MethodNotImplemented, "method not implemented") ErrURITooLong = NewError(URITooLong, "URI too long") ErrURIDecoding = NewError(URIDecoding, "URI decoding failed") ErrUnsupportedProtocol = NewError(UnsupportedProtocol, "unsupported protocol") ErrTooManyHeaders = NewError(TooManyHeaders, "too many headers") ErrHeaderFieldsTooLarge = NewError(HeaderFieldsTooLarge, "header fields too large") ErrBusyEverywhere = NewError(BusyEverywhere, "busy everywhere") ErrDecline = NewError(Decline, "decline") ErrDoesNotExistAnywhere = NewError(DoesNotExistAnywhere, "does not exist anywhere") ErrGlobalNotAcceptable = NewError(GlobalNotAcceptable, "not acceptable") )
Functions ¶
func CodeStatus ¶
CodeStatus returns a pre-defined line with code and status text (including terminating CRLF sequence) in case code is known to server, otherwise empty line is returned
Types ¶
type Code ¶
type Code uint16
const ( // Provisional 1xx codes Trying Code = 100 // RFC 3261 21.1.1 Ringing Code = 180 // RFC 3261 21.1.2 CallIsBeingForwarded Code = 181 // RFC 3261 21.1.3 Queued Code = 182 // RFC 3261 21.1.4 SessionProgress Code = 183 // RFC 3261 21.1.5 // Successful 2xx codes OK Code = 200 // RFC 3261 21.2.1 Accepted Code = 201 // Not show in RFC but recently used as de-facto standard code // Redirection 3xx codes MultipleChoices Code = 300 // RFC 3261 21.3.1 MovedPermanently Code = 301 // RFC 3261 21.3.2 MovedTemporarily Code = 302 // RFC 3261 21.3.3 UseProxy Code = 305 // RFC 3261 21.3.4 AlternativeService Code = 380 // RFC 3261 21.3.5 // Request Failure 4xx codes BadRequest Code = 400 // RFC 3261 21.4.1 PaymentRequired Code = 402 // RFC 3261 21.4.3 Forbidden Code = 403 // RFC 3261 21.4.4 NotFound Code = 404 // RFC 3261 21.4.5 MethodNotAllowed Code = 405 // RFC 3261 21.4.6 NotAcceptable Code = 406 // RFC 3261 21.4.7 ProxyAuthenticationRequired Code = 407 // RFC 3261 21.4.8 RequestTimeout Code = 408 // RFC 3261 21.4.9 Gone Code = 410 // RFC 3261 21.4.10 RequestEntityTooLarge Code = 413 // RFC 3261 21.4.11 RequestURITooLong Code = 414 // RFC 3261 21.4.12 UnsupportedMediaType Code = 415 // RFC 3261 21.4.13 UnsupportedURIScheme Code = 416 // RFC 3261 21.4.14 BadExtension Code = 420 // RFC 3261 21.4.15 ExtensionRequired Code = 421 // RFC 3261 21.4.16 IntervalTooBrief Code = 423 // RFC 3261 21.4.17 CallTransactionDoesNotExist Code = 481 // RFC 3261 21.4.19 LoopDetected Code = 482 // RFC 3261 21.4.20 TooManyHops Code = 483 // RFC 3261 21.4.21 AddressIncomplete Code = 484 // RFC 3261 21.4.22 Ambiguous Code = 485 // RFC 3261 21.4.23 BusyHere Code = 486 // RFC 3261 21.4.24 RequestTerminated Code = 487 // RFC 3261 21.4.25 NotAcceptableHere Code = 488 // RFC 3261 21.4.26 RequestPending Code = 491 // RFC 3261 21.4.27 Undecipherable Code = 493 // RFC 3261 21.4.28 // Server Failure 5xx codes ServerInternalError Code = 500 // RFC 3261 21.5.1 NotImplemented Code = 501 // RFC 3261 21.5.2 BadGateway Code = 502 // RFC 3261 21.5.3 ServerTimeout Code = 504 // RFC 3261 21.5.5 VersionNotSupported Code = 505 // RFC 3261 21.5.6 MessageTooLarge Code = 513 // RFC 3261 21.5.7 URITooLong Code = 520 // Custom 52x code URIDecoding Code = 521 // Custom 52x code UnsupportedProtocol Code = 522 // Custom 52x code TooManyHeaders Code = 523 // Custom 52x code HeaderFieldsTooLarge Code = 524 // Custom 52x code MethodNotImplemented Code = 525 // Custom 52x code // Global Failures 6xx codes BusyEverywhere Code = 600 // RFC 3261 21.6.1 Decline Code = 603 // RFC 3261 21.6.2 DoesNotExistAnywhere Code = 604 // RFC 3261 21.6.3 GlobalNotAcceptable Code = 606 // RFC 3261 21.6.4 )
SIP status codes as registered RFC 3261 See: https://www.rfc-editor.org/rfc/rfc3261
type Request ¶
type Request struct { Method string URI URI Proto Protocol Headers header.Headers ContentLength int Body []byte }
func NewRequest ¶
func NewRequest() *Request
Click to show internal directories.
Click to hide internal directories.