Documentation ¶
Index ¶
- Constants
- func GetQuotedString(str string) string
- func ReduceString(input string) string
- func ToHexString(b []byte) string
- type Message
- type Request
- type Response
- type Router
- type SIPMessage
- func (this *SIPMessage) AddHeader(sipHeader header.Header)
- func (this *SIPMessage) AddUnparsed(unparsed string)
- func (this *SIPMessage) AttachHeader(h header.Header) (IllegalArgumentException error)
- func (this *SIPMessage) AttachHeader2(h header.Header, replaceflag bool)
- func (this *SIPMessage) AttachHeader3(h header.Header, replaceFlag, top bool) error
- func (this *SIPMessage) EncodeAsBytes() []byte
- func (this *SIPMessage) GetAuthorization() *header.Authorization
- func (this *SIPMessage) GetCSeq() header.CSeqHeader
- func (this *SIPMessage) GetCSeqNumber() int
- func (this *SIPMessage) GetCallId() header.CallIdHeader
- func (this *SIPMessage) GetCallIdentifier() string
- func (this *SIPMessage) GetContactHeaders() *header.ContactList
- func (this *SIPMessage) GetContent() string
- func (this *SIPMessage) GetContentDisposition() header.ContentDispositionHeader
- func (this *SIPMessage) GetContentEncoding() header.ContentEncodingHeader
- func (this *SIPMessage) GetContentLanguage() header.ContentLanguageHeader
- func (this *SIPMessage) GetContentLength() header.ContentLengthHeader
- func (this *SIPMessage) GetContentTypeHeader() header.ContentTypeHeader
- func (this *SIPMessage) GetErrorInfoHeaders() *header.ErrorInfoList
- func (this *SIPMessage) GetExpires() header.ExpiresHeader
- func (this *SIPMessage) GetFrom() header.FromHeader
- func (this *SIPMessage) GetFromTag() string
- func (this *SIPMessage) GetHeader(headerName string) header.Header
- func (this *SIPMessage) GetHeaderList(headerName string) header.Lister
- func (this *SIPMessage) GetHeaderNames() *list.List
- func (this *SIPMessage) GetHeaders(headerName string) header.Lister
- func (this *SIPMessage) GetMaxForwards() header.MaxForwardsHeader
- func (this *SIPMessage) GetMessageAsEncodedStrings() *list.List
- func (this *SIPMessage) GetMessageContent() string
- func (this *SIPMessage) GetMinExpires() *header.MinExpires
- func (this *SIPMessage) GetOrganizationHeader() *header.Organization
- func (this *SIPMessage) GetPriorityHeader() *header.Priority
- func (this *SIPMessage) GetProxyAuthorizationHeader() *header.ProxyAuthorization
- func (this *SIPMessage) GetRecordRouteHeaders() *header.RecordRouteList
- func (this *SIPMessage) GetRouteHeaders() *header.RouteList
- func (this *SIPMessage) GetSIPHeaderList(headerName string) header.SIPHeaderLister
- func (this *SIPMessage) GetTo() header.ToHeader
- func (this *SIPMessage) GetToTag() string
- func (this *SIPMessage) GetTopmostVia() *header.Via
- func (this *SIPMessage) GetTransactionId() string
- func (this *SIPMessage) GetUnrecognizedHeaders() *list.List
- func (this *SIPMessage) GetViaHeaders() *header.ViaList
- func (this *SIPMessage) HasContent() bool
- func (this *SIPMessage) HasFromTag() bool
- func (this *SIPMessage) HasHeader(headerName string) bool
- func (this *SIPMessage) HasToTag() bool
- func (this *SIPMessage) IsRequestHeader(sipHeader header.Header) bool
- func (this *SIPMessage) IsResponseHeader(sipHeader header.Header) bool
- func (this *SIPMessage) RemoveContent()
- func (this *SIPMessage) RemoveHeader(headerName string)
- func (this *SIPMessage) RemoveHeader2(headerName string, top bool)
- func (this *SIPMessage) SetCSeq(cseqHeader header.CSeqHeader)
- func (this *SIPMessage) SetCallId(callId header.CallIdHeader)
- func (this *SIPMessage) SetCallIdFromString(callId string)
- func (this *SIPMessage) SetContent(content interface{}, contentTypeHeader header.ContentTypeHeader)
- func (this *SIPMessage) SetContentDisposition(contentDispositionHeader header.ContentDispositionHeader)
- func (this *SIPMessage) SetContentEncoding(contentEncodingHeader header.ContentEncodingHeader)
- func (this *SIPMessage) SetContentLanguage(contentLanguageHeader header.ContentLanguageHeader)
- func (this *SIPMessage) SetContentLength(contentLength header.ContentLengthHeader)
- func (this *SIPMessage) SetExpires(expiresHeader header.ExpiresHeader)
- func (this *SIPMessage) SetFrom(from header.FromHeader)
- func (this *SIPMessage) SetFromTag(tag string)
- func (this *SIPMessage) SetHeader(h header.Header) (IllegalArgumentException error)
- func (this *SIPMessage) SetHeaderFromSIPHeaderList(sipHeaderList header.SIPHeaderLister)
- func (this *SIPMessage) SetHeaders(headers *list.List)
- func (this *SIPMessage) SetMaxForwards(maxForwards header.MaxForwardsHeader)
- func (this *SIPMessage) SetMessageContent(content string)
- func (this *SIPMessage) SetMessageContent3(t string, subType string, messageContent []byte)
- func (this *SIPMessage) SetMessageContentFromByte(content []byte)
- func (this *SIPMessage) SetMessageContentFromString(t string, subType string, messageContent string)
- func (this *SIPMessage) SetMinExpiresHeader(minExpires header.MinExpiresHeader)
- func (this *SIPMessage) SetTo(to header.ToHeader)
- func (this *SIPMessage) SetToTag(tag string)
- func (this *SIPMessage) SetVia(viaList *header.ViaList)
- func (this *SIPMessage) String() string
- type SIPRequest
- func (this *SIPRequest) CheckHeaders() (ParseException error)
- func (this *SIPRequest) CreateACKRequest() *SIPRequest
- func (this *SIPRequest) CreateAckRequest(responseToHeader *header.To) *SIPRequest
- func (this *SIPRequest) CreateBYERequest(switchHeaders bool) *SIPRequest
- func (this *SIPRequest) CreateCancelRequest() *SIPRequest
- func (this *SIPRequest) CreateResponse(statusCode int) *SIPResponse
- func (this *SIPRequest) CreateResponse2(statusCode int, reasonPhrase string) *SIPResponse
- func (this *SIPRequest) CreateSIPRequest(requestLine *header.RequestLine, switchHeaders bool) *SIPRequest
- func (this *SIPRequest) EncodeAsBytes() []byte
- func (this *SIPRequest) GetDialogId(isServer bool) string
- func (this *SIPRequest) GetDialogId2(isServer bool, toTag string) string
- func (this *SIPRequest) GetFirstLine() string
- func (this *SIPRequest) GetMessageAsEncodedStrings() *list.List
- func (this *SIPRequest) GetMethod() string
- func (this *SIPRequest) GetRequestLine() *header.RequestLine
- func (this *SIPRequest) GetRequestURI() address.URI
- func (this *SIPRequest) GetSIPVersion() string
- func (this *SIPRequest) GetViaHost() string
- func (this *SIPRequest) GetViaPort() int
- func (this *SIPRequest) SetDefaults()
- func (this *SIPRequest) SetMethod(method string)
- func (this *SIPRequest) SetRequestLine(requestLine *header.RequestLine)
- func (this *SIPRequest) SetRequestLineDefaults()
- func (this *SIPRequest) SetRequestURI(uri address.URI)
- func (this *SIPRequest) SetSIPVersion(sipVersion string)
- func (this *SIPRequest) String() string
- type SIPResponse
- func (this *SIPResponse) CheckHeaders() (ParseException error)
- func (this *SIPResponse) CreateRequest(requestURI address.SipURI, via *header.Via, cseq *header.CSeq) *SIPRequest
- func (this *SIPResponse) EncodeAsBytes() []byte
- func (this *SIPResponse) GetDialogId(isServer bool) string
- func (this *SIPResponse) GetDialogId2(isServer bool, toTag string) string
- func (this *SIPResponse) GetFirstLine() string
- func (this *SIPResponse) GetMessageAsEncodedStrings() *list.List
- func (this *SIPResponse) GetReasonPhrase() string
- func (this *SIPResponse) GetReasonPhraseFromInt(rc int) string
- func (this *SIPResponse) GetSIPVersion() string
- func (this *SIPResponse) GetStatusCode() int
- func (this *SIPResponse) GetStatusLine() *header.StatusLine
- func (this *SIPResponse) IsFinalResponse() bool
- func (this *SIPResponse) IsFinalResponseFromInt(rc int) bool
- func (this *SIPResponse) SetReasonPhrase(reasonPhrase string)
- func (this *SIPResponse) SetSIPVersion(sipVersion string)
- func (this *SIPResponse) SetStatusCode(statusCode int)
- func (this *SIPResponse) SetStatusLine(sl *header.StatusLine)
- func (this *SIPResponse) String() string
Constants ¶
const ACCEPTED = 202
*
- The Acceptable extension response code signifies that the request has
- been accepted for processing, but the processing has not been completed.
- The request might or might not eventually be acted upon, as it might be
- disallowed when processing actually takes place. There is no facility
- for re-sending a status code from an asynchronous operation such as this.
- The 202 response is intentionally non-committal. Its purpose is to allow
- a server to accept a request for some other process (perhaps a
- batch-oriented process that is only run once per day) without requiring
- that the user agent's connection to the server persist until the process
- is completed. The entity returned with this response SHOULD include an
- indication of the request's current status and either a pointer to a
- status monitor or some estimate of when the user can expect the request
- to be fulfilled. This response code is specific to the event notification
- framework. * *
const ACK = "ACK"
*
- An ACK is used to acknowledge the successful receipt
- of a message in a transaction. It is also used to illustrate the
- successful setup of a dialog via the a three-way handshake between an
- UAC and an UAS for an Invite transaction.
const ADDRESS_INCOMPLETE = 484
*
- The server received a request with a Request-URI that was incomplete.
- Additional information SHOULD be provided in the reason phrase. This
- status code allows overlapped dialing. With overlapped dialing, the
- client does not know the length of the dialing string. It sends strings
- of increasing lengths, prompting the user for more input, until it no
- longer receives a 484 (Address Incomplete) status response.
const ALTERNATIVE_SERVICE = 380
*
- The call was not successful, but alternative services are possible. The
- alternative services are described in the message body of the response.
- Formats for such bodies are not defined here, and may be the subject of
- future standardization.
const AMBIGUOUS = 485
*
- The Request-URI was ambiguous. The response MAY contain a listing of
- possible unambiguous addresses in Contact header fields. Revealing
- alternatives can infringe on privacy of the user or the organization.
- It MUST be possible to configure a server to respond with status 404
- (Not Found) or to suppress the listing of possible choices for ambiguous
- Request-URIs. Some email and voice mail systems provide this
- functionality. A status code separate from 3xx is used since the
- semantics are different: for 300, it is assumed that the same person or
- service will be reached by the choices provided. While an automated
- choice or sequential search makes sense for a 3xx response, user
- intervention is required for a 485 (Ambiguous) response.
const BAD_EVENT = 489
*
- The Bad Event extension response code is used to indicate that the
- server did not understand the event package specified in a "Event"
- header field. This response code is specific to the event notification
- framework. * *
const BAD_EXTENSION = 420
*
- The server did not understand the protocol extension specified in a
- Proxy-Require or Require header field. The server MUST include a list of
- the unsupported extensions in an Unsupported header field in the response.
const BAD_GATEWAY = 502
*
- The server, while acting as a gateway or proxy, received an invalid
- response from the downstream server it accessed in attempting to
- fulfill the request.
const BAD_REQUEST = 400
*
- The request could not be understood due to malformed syntax. The
- Reason-Phrase SHOULD identify the syntax problem in more detail, for
- example, "Missing Call-ID header field".
const BUSY_EVERYWHERE = 600
*
- The callee's end system was contacted successfully but the callee is
- busy and does not wish to take the call at this time. The response
- MAY indicate a better time to call in the Retry-After header field.
- If the callee does not wish to reveal the reason for declining the call,
- the callee uses status code 603 (Decline) instead. This status response
- is returned only if the client knows that no other end point (such as a
- voice mail system) will answer the request. Otherwise, 486 (Busy Here)
- should be returned.
const BUSY_HERE = 486
*
- The callee's end system was contacted successfully, but the callee is
- currently not willing or able to take additional calls at this end
- system. The response MAY indicate a better time to call in the Retry-After
- header field. The user could also be available elsewhere, such as
- through a voice mail service. Status 600 (Busy Everywhere) SHOULD be
- used if the client knows that no other end system will be able to accept
- this call.
const BYE = "BYE"
*
- The BYE request is used to terminate a specific
- session or attempted session. When a BYE is received on a dialog, any
- session associated with that dialog SHOULD terminate. A User Agent MUST
- NOT send a BYE outside of a dialog. The caller's User Agent MAY send a
- BYE for either confirmed or early dialogs, and the callee's User Agent
- MAY send a BYE on confirmed dialogs, but MUST NOT send a BYE on early
- dialogs. However, the callee's User Agent MUST NOT send a BYE on a
- confirmed dialog until it has received an ACK for its 2xx response or
- until the server transaction times out. If no SIP extensions have defined
- other application layer states associated with the dialog, the BYE also
- terminates the dialog.
const CALL_IS_BEING_FORWARDED = 181
*
- A server MAY use this status code to indicate that the call is being
- forwarded to a different set of destinations.
const CALL_OR_TRANSACTION_DOES_NOT_EXIST = 481
*
- This status indicates that the UAS received a request that does not
- match any existing dialog or transaction.
const CANCEL = "CANCEL"
*
- The CANCEL request is used to cancel a previous
- request sent by a client. Specifically, it asks the UAS to cease
- processing the request and to generate an error response to that request.
- CANCEL has no effect on a request to which a UAS has already given a
- final response. Because of this, it is most useful to CANCEL requests to
- which it can take a server long time to respond. For this reason, CANCEL
- is best for INVITE requests, which can take a long time to generate a
- response.
const DECLINE = 603
*
- The callee's machine was successfully contacted but the user explicitly
- does not wish to or cannot participate. The response MAY indicate a
- better time to call in the Retry-After header field. This status
- response is returned only if the client knows that no other end point
- will answer the request.
const DEFAULT_METHOD = INVITE
const DEFAULT_TRANSPORT = "udp"
const DEFAULT_TTL = 1
const DEFAULT_USER = "ip"
const DOES_NOT_EXIST_ANYWHERE = 604
*
- The server has authoritative information that the user indicated in the
- Request-URI does not exist anywhere.
const EXTENSION_REQUIRED = 421
*
- The UAS needs a particular extension to process the request, but this
- extension is not listed in a Supported header field in the request.
- Responses with this status code MUST contain a Require header field
- listing the required extensions.
- <p>
- A UAS SHOULD NOT use this response unless it truly cannot provide any
- useful service to the client. Instead, if a desirable extension is not
- listed in the Supported header field, servers SHOULD process the request
- using baseline SIP capabilities and any extensions supported by the
- client. * *
const FORBIDDEN = 403
*
- The server understood the request, but is refusing to fulfill it.
- Authorization will not help, and the request SHOULD NOT be repeated.
const GONE = 410
*
- The requested resource is no longer available at the server and no
- forwarding address is known. This condition is expected to be considered
- permanent. If the server does not know, or has no facility to determine,
- whether or not the condition is permanent, the status code 404
- (Not Found) SHOULD be used instead.
const INFO = "INFO"
*
- INFO is an extension method which allows for the carrying of session
- related control information that is generated during a session. One
- example of such session control information is ISUP and ISDN signaling
- messages used to control telephony call services. The purpose of the INFO
- message is to carry application level information along the SIP signaling
- path. The signaling path for the INFO method is the signaling path
- established as a result of the call setup. This can be either direct
- signaling between the calling and called user agents or a signaling path
- involving SIP proxy servers that were involved in the call setup and added
- themselves to the Record-Route header on the initial INVITE message.
- <p>
- The INFO method is used for communicating mid-session signaling
- information, it is not used to change the state of SIP calls, nor does it
- change the state of sessions initiated by SIP. Rather, it provides
- additional optional information which can further enhance the application
- using SIP. The mid-session information can be communicated in either an
- INFO message header or as part of a message body. There are no specific
- semantics associated with INFO. The semantics are derived from the body
- or new headers defined for usage in INFO. JAIN SIP provides the
- facility to send {@link javax.sip.header.ExtensionHeader} in messages.
- The INFO request MAY contain a message body. Bodies which imply a change
- in the SIP call state or the sessions initiated by SIP MUST NOT be sent
- in an INFO message. * *
const INTERVAL_TOO_BRIEF = 423
*
- The server is rejecting the request because the expiration time of the
- resource refreshed by the request is too short. This response can be
- used by a registrar to reject a registration whose Contact header field
- expiration time was too small. * *
const INVITE = "INVITE"
*
- The INVITE method is used by an user agent client that desires to
- initiate a session, session examples include, audio, video, or a game. The
- INVITE request asks a server to establish a session. This request may be
- forwarded by proxies, eventually arriving at one or more UAS's that can
- potentially accept the invitation. These UAS's will frequently need to
- query the user about whether to accept the invitation. After some time,
- those UAS's can accept the invitation (meaning the session is to be
- established) by sending a 2xx response. If the invitation is not
- accepted, a 3xx, 4xx, 5xx or 6xx response is sent, depending on the
- reason for the rejection. Before sending a final response, the UAS can
- also send provisional responses (1xx) to advise the UAC of progress in
- contacting the called user.
const LOOP_DETECTED = 482
*
- The server has detected a loop.
const MESSAGE = "MESSAGE"
*
- Message is an extension method that allows the transfer of Instant Messages.
- The MESSAGE request inherits all the request routing and security
- features of SIP. MESSAGE requests carry the content in the form of MIME
- body parts. The actual communication between participants happens in the
- media sessions, not in the SIP requests themselves. The MESSAGE method
- changes this assumption.
- <p>
- MESSAGE requests do not themselves initiate a SIP dialog; under
- normal usage each Instant Message stands alone, much like pager
- messages, that is there are no explicit association between messages.
- MESSAGE requests may be sent in the context of a dialog initiated by some
- other SIP request. If a MESSAGE request is sent within a dialog, it is
- "associated" with any media session or sessions associated with that dialog.
- <p>
- When a user wishes to send an instant message to another, the sender
- formulates and issues a Message request. The Request-URI of this request
- will normally be the "address of record" for the recipient of the instant
- message, but it may be a device address in situations where the client
- has current information about the recipient's location. The body of the
- request will contain the message to be delivered.
- <p>
- Provisional and final responses to the request will be returned to the
- sender as with any other SIP request. Normally, a 200 OK response will be
- generated by the user agent of the request's final recipient. Note that
- this indicates that the user agent accepted the message, not that the
- user has seen it.
- <p>
- The UAC MAY add an Expires header field to limit the validity of the message
- content. If the UAC adds an Expires header field with a non-zero value, it
- SHOULD also add a Date header field containing the time the message is sent.
- Most SIP requests are used to setup and modify communication sessions. * *
const MESSAGE_TOO_LARGE = 513
*
- The server was unable to process the request since the message length
- exceeded its capabilities. * *
const METHOD_NOT_ALLOWED = 405
*
- The method specified in the Request-Line is understood, but not allowed
- for the address identified by the Request-URI. The response MUST include
- an Allow header field containing a list of valid methods for the
- indicated address
const MOVED_PERMANENTLY = 301
*
- The user can no longer be found at the address in the Request-URI, and
- the requesting client SHOULD retry at the new address given by the
- Contact header field. The requestor SHOULD update any local directories,
- address books, and user location caches with this new value and redirect
- future requests to the address(es) listed.
const MOVED_TEMPORARILY = 302
*
- The requesting client SHOULD retry the request at the new address(es)
- given by the Contact header field. The Request-URI of the new request
- uses the value of the Contact header field in the response.
- <p>
- The duration of the validity of the Contact URI can be indicated through
- an Expires header field or an expires parameter in the Contact header
- field. Both proxies and User Agents MAY cache this URI for the duration
- of the expiration time. If there is no explicit expiration time, the
- address is only valid once for recursing, and MUST NOT be cached for
- future transactions.
- <p>
- If the URI cached from the Contact header field fails, the Request-URI
- from the redirected request MAY be tried again a single time. The
- temporary URI may have become out-of-date sooner than the expiration
- time, and a new temporary URI may be available.
const MULTIPLE_CHOICES = 300
*
- The address in the request resolved to several choices, each with its
- own specific location, and the user (or UA) can select a preferred
- communication end point and redirect its request to that location.
- <p>
- The response MAY include a message body containing a list of resource
- characteristics and location(s) from which the user or UA can choose
- the one most appropriate, if allowed by the Accept request header field.
- However, no MIME types have been defined for this message body.
- <p>
- The choices SHOULD also be listed as Contact fields. Unlike HTTP, the
- SIP response MAY contain several Contact fields or a list of addresses
- in a Contact field. User Agents MAY use the Contact header field value
- for automatic redirection or MAY ask the user to confirm a choice.
- However, this specification does not define any standard for such
- automatic selection.
- <p>
- This status response is appropriate if the callee can be reached at
- several different locations and the server cannot or prefers not to
- proxy the request.
const NOTIFY = "NOTIFY"
*
- Notify is an extension method that informs subscribers of changes in state
- to which the subscriber has a subscription. Subscriptions are typically
- put in place using the SUBSCRIBE method; however, it is possible that
- other means have been used.
- <p>
- When a SUBSCRIBE request is answered with a 200-class response, the
- notifier MUST immediately construct and send a NOTIFY request to the
- subscriber. When a change in the subscribed state occurs, the notifier
- SHOULD immediately construct and send a NOTIFY request, subject to
- authorization, local policy, and throttling considerations.
- <p>
- A NOTIFY does not terminate its corresponding subscription. i.e. a single
- SUBSCRIBE request may trigger several NOTIFY requests. NOTIFY requests
- MUST contain a "Subscription-State" header with a value of "active",
- "pending", or "terminated". As in SUBSCRIBE requests, NOTIFY "Event"
- headers will contain a single event package name for which a notification
- is being generated. The package name in the "Event" header MUST match
- the "Event" header in the corresponding SUBSCRIBE message. If an "id"
- parameter was present in the SUBSCRIBE message, that "id" parameter MUST
- also be present in the corresponding NOTIFY messages.
- <p>
- Event packages may define semantics associated with the body of their
- NOTIFY requests; if they do so, those semantics apply. NOTIFY bodies
- are expected to provide additional details about the nature of the event
- which has occurred and the resultant resource state. When present, the
- body of the NOTIFY request MUST be formatted into one of the body formats
- specified in the "Accept" header of the corresponding SUBSCRIBE request.
- This body will contain either the state of the subscribed resource or a
- pointer to such state in the form of a URI
- <p>
- A NOTIFY request is considered failed if the response times out, or a
- non-200 class response code is received which has no "Retry-After"
- header and no implied further action which can be taken to retry the
- request. If a NOTIFY request receives a 481 response, the notifier MUST
- remove the corresponding subscription even if such subscription was
- installed by non-SUBSCRIBE means.
- <p>
- If necessary, clients may probe for the support of NOTIFY using the
- OPTIONS. The presence of the "Allow-Events" header in a message is
- sufficient to indicate support for NOTIFY. The "methods" parameter for
- Contact may also be used to specifically announce support for NOTIFY
- messages when registering. * *
const NOT_ACCEPTABLE = 406
*
- The resource identified by the request is only capable of generating
- response entities that have content characteristics not acceptable
- according to the Accept header field sent in the request.
const NOT_ACCEPTABLE_HERE = 488
*
- The response has the same meaning as 606 (Not Acceptable), but only
- applies to the specific resource addressed by the Request-URI and the
- request may succeed elsewhere. A message body containing a description
- of media capabilities MAY be present in the response, which is formatted
- according to the Accept header field in the INVITE (or application/sdp
- if not present), the same as a message body in a 200 (OK) response to
- an OPTIONS request. * *
const NOT_FOUND = 404
*
- The server has definitive information that the user does not exist at
- the domain specified in the Request-URI. This status is also returned
- if the domain in the Request-URI does not match any of the domains
- handled by the recipient of the request.
const NOT_IMPLEMENTED = 501
*
- The server does not support the functionality required to fulfill the
- request. This is the appropriate response when a UAS does not recognize
- the request method and is not capable of supporting it for any user.
- Proxies forward all requests regardless of method. Note that a 405
- (Method Not Allowed) is sent when the server recognizes the request
- method, but that method is not allowed or supported.
const OK = 200
*
- The request has succeeded. The information returned with the response
- depends on the method used in the request.
const OPTIONS = "OPTIONS"
*
- The OPTIONS method allows a User Agent to query
- another User Agent or a proxy server as to its capabilities. This allows
- a client to discover information about the supported methods, content
- types, extensions, codecs, etc. without "ringing" the other party. For
- example, before a client inserts a Require header field into an INVITE
- listing an option that it is not certain the destination UAS supports,
- the client can query the destination UAS with an OPTIONS to see if this
- option is returned in a Supported header field. All User Agents MUST
- support the OPTIONS method.
const PAYMENT_REQUIRED = 402
*
- Reserved for future use.
const PRACK = "PRACK"
*
- PRACK is an extension method that plays the same role as ACK, but for
- provisional responses. PRACK is a normal SIP message, like BYE. As such,
- its own reliability is ensured hop-by-hop through each stateful
- proxy. Also like BYE, but unlike ACK, PRACK has its own response.
- In order to achieve reliability of provisional responses, in a similiar
- manner to 2xx final responses to INVITE, reliable provisional responses
- are retransmitted with an exponential backoff, which cease when a PRACK
- message is received. The PRACK messages contain an RAck header field,
- which indicates the sequence number of the provisional response that is
- being acknowledged.
- <p>
- PRACK is like any other request within a dialog, and is treated likewise.
- In particular, a UAC SHOULD NOT retransmit the PRACK request when it
- receives a retransmission of the provisional response being acknowledged,
- although doing so does not create a protocol error. A matching PRACK is
- defined as one within the same dialog as the response, and whose
- method, CSeq-num, and RSeq-num in the RAck header field match,
- respectively, the method and sequence number from the CSeq and the
- sequence number from the RSeq header of the reliable provisional response.
- PRACK requests MAY contain bodies, which are interpreted according to
- their type and disposition. * *
const PROXY_AUTHENTICATION_REQUIRED = 407
*
- This code is similar to 401 (Unauthorized), but indicates that the client
- MUST first authenticate itself with the proxy. This status code can be
- used for applications where access to the communication channel (for
- example, a telephony gateway) rather than the callee requires
- authentication.
const QUEUED = 182
*
- The called party is temporarily unavailable, but the server has decided
- to queue the call rather than reject it. When the callee becomes
- available, it will return the appropriate final status response. The
- reason phrase MAY give further details about the status of the call,
- for example, "5 calls queued; expected waiting time is 15 minutes". The
- server MAY issue several 182 (Queued) responses to update the caller
- about the status of the queued call.
const REFER = "REFER"
*
- Refer is an extension method that requests that the recipient REFER to a
- resource provided in the request, this can be used to enable many
- applications such as Call Transfer. The REFER method indicates that
- the recipient (identified by the Request-URI) should contact a third
- party using the contact information provided in the request. A REFER
- request MUST contain exactly one Refer-To header field value and MAY
- contain a body. A receiving agent may choose to process the body
- according to its Content-Type.
- <p>
- A User Agent accepting a well-formed REFER request SHOULD request
- approval from the user to proceed. If approval is granted, the User
- Agent MUST contact the resource identified by the URI. SIP proxies do
- not require modification to support the REFER method. A proxy should
- process a REFER request the same way it processes an OPTIONS request.
- <p>
- A REFER request implicitly establishes a subscription to the "refer"
- event. The agent issuing the REFER can terminate this subscription
- prematurely by unsubscribing. A REFER request MAY be placed outside
- the scope of a dialog created with an INVITE. REFER creates a dialog,
- and MAY be Record-Routed, hence MUST contain a single Contact header
- field value. REFERs occurring inside an existing dialog MUST follow
- the Route/Record-Route logic of that dialog. The NOTIFY mechanism MUST
- be used to inform the agent sending the REFER of the status of the
- reference. The dialog identifiers of each NOTIFY must match those of
- the REFER as they would if the REFER had been a SUBSCRIBE request. If
- more than one REFER is issued in the same dialog, the dialog
- identifiers do not provide enough information to associate the
- resulting NOTIFYs with the proper REFER. Therefore it MUST include an
- "id" parameter in the Event header field of each NOTIFY containing the
- sequence number of the REFER this NOTIFY is associated with. A REFER
- sent within the scope of an existing dialog will not fork. A REFER
- sent outside the context of a dialog MAY fork, and if it is accepted
- by multiple agents, MAY create multiple subscriptions. * *
const REGISTER = "REGISTER"
*
- The REGISTER method requests the addition,
- removal, and query of bindings. A REGISTER request can add a new binding
- between an address-of-record and one or more contact addresses.
- Registration on behalf of a particular address-of-record can be performed
- by a suitably authorized third party. A client can also remove previous
- bindings or query to determine which bindings are currently in place for
- an address-of-record. A REGISTER request does not establish a dialog.
- Registration entails sending a REGISTER request to a special type of UAS
- known as a registrar. A registrar acts as the front end to the location
- service for a domain, reading and writing mappings based on the contents
- of REGISTER requests. This location service is then typically consulted
- by a proxy server that is responsible for routing requests for that domain.
const REQUEST_ENTITY_TOO_LARGE = 413
*
- The server is refusing to process a request because the request
- entity-body is larger than the server is willing or able to process. The
- server MAY close the connection to prevent the client from continuing
- the request. If the condition is temporary, the server SHOULD include a
- Retry-After header field to indicate that it is temporary and after what
- time the client MAY try again. * *
const REQUEST_PENDING = 491
*
- The request was received by a UAS that had a pending request within
- the same dialog. * *
const REQUEST_TERMINATED = 487
*
- The request was terminated by a BYE or CANCEL request. This response is
- never returned for a CANCEL request itself. * *
const REQUEST_TIMEOUT = 408
*
- The server could not produce a response within a suitable amount of
- time, for example, if it could not determine the location of the user
- in time. The client MAY repeat the request without modifications at
- any later time.
const REQUEST_URI_TOO_LONG = 414
*
- The server is refusing to service the request because the Request-URI
- is longer than the server is willing to interpret. * *
const RINGING = 180
*
- The User Agent receiving the INVITE is trying to alert the user. This
- response MAY be used to initiate local ringback.
const SERVER_INTERNAL_ERROR = 500
*
- The server encountered an unexpected condition that prevented it from
- fulfilling the request. The client MAY display the specific error
- condition and MAY retry the request after several seconds. If the
- condition is temporary, the server MAY indicate when the client may
- retry the request using the Retry-After header field.
const SERVER_TIMEOUT = 504
*
- The server did not receive a timely response from an external server
- it accessed in attempting to process the request. 408 (Request Timeout)
- should be used instead if there was no response within the
- period specified in the Expires header field from the upstream server.
const SERVICE_UNAVAILABLE = 503
*
- The server is temporarily unable to process the request due to a
- temporary overloading or maintenance of the server. The server MAY
- indicate when the client should retry the request in a Retry-After
- header field. If no Retry-After is given, the client MUST act as if it
- had received a 500 (Server Internal Error) response.
- <p>
- A client (proxy or UAC) receiving a 503 (Service Unavailable) SHOULD
- attempt to forward the request to an alternate server. It SHOULD NOT
- forward any other requests to that server for the duration specified
- in the Retry-After header field, if present.
- <p>
- Servers MAY refuse the connection or drop the request instead of
- responding with 503 (Service Unavailable). * *
const SESSION_NOT_ACCEPTABLE = 606
*
- The user's agent was contacted successfully but some aspects of the
- session description such as the requested media, bandwidth, or addressing
- style were not acceptable. A 606 (Not Acceptable) response means that
- the user wishes to communicate, but cannot adequately support the
- session described. The 606 (Not Acceptable) response MAY contain a list
- of reasons in a Warning header field describing why the session described
- cannot be supported.
- <p>
- A message body containing a description of media capabilities MAY be
- present in the response, which is formatted according to the Accept
- header field in the INVITE (or application/sdp if not present), the same
- as a message body in a 200 (OK) response to an OPTIONS request.
- <p>
- It is hoped that negotiation will not frequently be needed, and when a
- new user is being invited to join an already existing conference,
- negotiation may not be possible. It is up to the invitation initiator to
- decide whether or not to act on a 606 (Not Acceptable) response.
- <p>
- This status response is returned only if the client knows that no other
- end point will answer the request. This specification renames this
- status code from NOT_ACCEPTABLE as in RFC3261 to SESSION_NOT_ACCEPTABLE
- due to it conflict with 406 (Not Acceptable) defined in this interface.
const SESSION_PROGRESS = 183
*
- The 183 (Session Progress) response is used to convey information about
- the progress of the call that is not otherwise classified. The
- Reason-Phrase, header fields, or message body MAY be used to convey more
- details about the call progress. * *
const SUBSCRIBE = "SUBSCRIBE"
*
- Subscribe is an extension method that is used to request current state
- and state updates from a remote node. SUBSCRIBE requests SHOULD contain
- an "Expires" header, which indicates the duration of the subscription.
- In order to keep subscriptions effective beyond the duration communicated
- in the "Expires" header, subscribers need to refresh subscriptions on a
- periodic basis using a new SUBSCRIBE message on the same dialog. If no
- "Expires" header is present in a SUBSCRIBE request, the implied default
- is defined by the event package being used.
- <p>
- 200-class responses to a SUBSCRIBE request indicate that the subscription
- has been accepted, and that a NOTIFY will be sent immediately. If the
- subscription resource has no meaningful state at the time that the SUBSCRIBE
- message is processed, this NOTIFY message MAY contain an empty or neutral body.
- 200-class responses to SUBSCRIBE requests also MUST contain an "Expires"
- header. The period of time in the response MAY be shorter but MUST NOT be
- longer than specified in the request. The period of time in the response
- is the one which defines the duration of the subscription. An "expires"
- parameter on the "Contact" header has no semantics for SUBSCRIBE and is
- explicitly not equivalent to an "Expires" header in a SUBSCRIBE request
- or response.
- <p>
- The Request URI of a SUBSCRIBE request, contains enough information to
- route the request to the appropriate entity. It also contains enough
- information to identify the resource for which event notification is
- desired, but not necessarily enough information to uniquely identify the
- nature of the event. Therefore Subscribers MUST include exactly one
- "Event" header in SUBSCRIBE requests, indicating to which event or class
- of events they are subscribing. The "Event" header will contain a token
- which indicates the type of state for which a subscription is being
- requested.
- <p>
- As SUBSCRIBE requests create a dialog, they MAY contain an "Accept"
- header. This header, if present, indicates the body formats allowed in
- subsequent NOTIFY requests. Event packages MUST define the behavior for
- SUBSCRIBE requests without "Accept" headers. If an initial SUBSCRIBE is
- sent on a pre-existing dialog, a matching 200-class response or successful
- NOTIFY request merely creates a new subscription associated with that
- dialog. Multiple subscriptions can be associated with a single dialog.
- <p>
- Unsubscribing is handled in the same way as refreshing of a subscription,
- with the "Expires" header set to "0". Note that a successful unsubscription
- will also trigger a final NOTIFY message.
- <p>
- If necessary, clients may probe for the support of SUBSCRIBE using the
- OPTIONS. The presence of the "Allow-Events" header in a message is
- sufficient to indicate support for SUBSCRIBE. The "methods" parameter for
- Contact may also be used to specifically announce support for SUBSCRIBE
- messages when registering. * *
const TEMPORARILY_UNAVAILABLE = 480
*
- The callee's end system was contacted successfully but the callee is
- currently unavailable (for example, is not logged in, logged in but in a
- state that precludes communication with the callee, or has activated the
- "do not disturb" feature). The response MAY indicate a better time to
- call in the Retry-After header field. The user could also be available
- elsewhere (unbeknownst to this server). The reason phrase SHOULD indicate
- a more precise cause as to why the callee is unavailable. This value
- SHOULD be settable by the UA. Status 486 (Busy Here) MAY be used to more
- precisely indicate a particular reason for the call failure.
- <p>
- This status is also returned by a redirect or proxy server that
- recognizes the user identified by the Request-URI, but does not currently
- have a valid forwarding location for that user. * *
const TOO_MANY_HOPS = 483
*
- The server received a request that contains a Max-Forwards header field
- with the value zero.
const TRYING = 100
*
- This response indicates that the request has been received by the
- next-hop server and that some unspecified action is being taken on
- behalf of this call (for example, a database is being consulted). This
- response, like all other provisional responses, stops retransmissions of
- an INVITE by a UAC. The 100 (Trying) response is different from other
- provisional responses, in that it is never forwarded upstream by a
- stateful proxy.
const UNAUTHORIZED = 401
*
- The request requires user authentication. This response is issued by
- UASs and registrars, while 407 (Proxy Authentication Required) is used
- by proxy servers.
const UNDECIPHERABLE = 493
*
- The request was received by a UAS that contained an encrypted MIME body
- for which the recipient does not possess or will not provide an
- appropriate decryption key. This response MAY have a single body
- containing an appropriate public key that should be used to encrypt MIME
- bodies sent to this UA. * *
const UNSUPPORTED_MEDIA_TYPE = 415
*
- The server is refusing to service the request because the message body
- of the request is in a format not supported by the server for the
- requested method. The server MUST return a list of acceptable formats
- using the Accept, Accept-Encoding, or Accept-Language header field,
- depending on the specific problem with the content.
const UNSUPPORTED_URI_SCHEME = 416
*
- The server cannot process the request because the scheme of the URI in
- the Request-URI is unknown to the server. * *
const UPDATE = "UPDATE"
*
- UPDATE is an extension method that allows a client to update parameters
- of a session (such as the set of media streams and their codecs) but has
- no impact on the state of a dialog. In that sense, it is like a re-INVITE,
- but unlike re-INVITE, it can be sent before the initial INVITE has been
- completed. This makes it very useful for updating session parameters
- within early dialogs. Operation of this extension is straightforward, the
- caller begins with an INVITE transaction, which proceeds normally. Once a
- dialog is established, the caller can generate an UPDATE method that
- contains an SDP offer for the purposes of updating the session. The
- response to the UPDATE method contains the answer. The Allow header
- field is used to indicate support for the UPDATE method. There are
- additional constraints on when UPDATE can be used, based on the
- restrictions of the offer/answer model. Although UPDATE can be used on
- confirmed dialogs, it is RECOMMENDED that a re-INVITE be used instead.
- This is because an UPDATE needs to be answered immediately, ruling out
- the possibility of user approval. Such approval will frequently be needed,
- and is possible with a re-INVITE. * *
const USE_PROXY = 305
*
- The requested resource MUST be accessed through the proxy given by the
- Contact field. The Contact field gives the URI of the proxy. The
- recipient is expected to repeat this single request via the proxy.
- 305 (Use Proxy) responses MUST only be generated by UASs.
const VERSION_NOT_SUPPORTED = 505
*
- The server does not support, or refuses to support, the SIP protocol
- version that was used in the request. The server is indicating that
- it is unable or unwilling to complete the request using the same major
- version as the client, other than with this error message.
Variables ¶
This section is empty.
Functions ¶
func GetQuotedString ¶
*
- Put quotes around a string and return it. *
- @return a quoted string
- @param str string to be quoted
func ReduceString ¶
*
- Squeeze out all white space from a string and return the reduced string. *
- @param input input string to sqeeze.
- @return String a reduced string.
func ToHexString ¶
Types ¶
type Message ¶
type Message interface { /** * Adds the new Header to the existing list of Headers contained in this * Message. The Header is added to the end of the List and will appear in * that order in the SIP Message. * <p> * Required Headers that are singletons should not be added to the message * as they already exist in the message and therefore should be changed using * the {@link Message#setHeader(Header)} method. * <p> * This method should be used to support the special case of adding * required ViaHeaders to a message. When adding a ViaHeader using this * method the implementation will add the ViaHeader to the top of the * ViaHeader list, and not the end like all other Headers. * * @param header the new Header to be added to the existing Headers List. */ AddHeader(h header.Header) /** * Removes the Header of the supplied name from the list of headers in * this Message. If multiple headers exist then they are all removed from * the header list. If no headers exist then this method returns silently. * This method should not be used to remove required Headers, required * Headers should be replaced using the {@link Message#setHeader(Header)}. * * @param headername the new string value name of the Header to be * removed. */ RemoveHeader(headerName string) /** * Gets a ListIterator over all the header names in this Message. Note * that the order of the Header Names in the ListIterator is same as the * order in which they appear in the SIP Message. * * @return the ListIterator over all the Header Names in the Message. */ GetHeaderNames() *list.List //ListIterator; /** * Gets a ListIterator over all the Headers of the newly specified name * in this Message. Note that order of the Headers in ListIterator is the * same as the order in which they appear in the SIP Message. * * @param headerName the new string name of Header types requested. * @return the ListIterator over all the Headers of the specified name in * the Message, this method returns an empty ListIterator if no Headers * exist of this header type. */ GetHeaders(headerName string) header.Lister //*list.List //ListIterator; /** * Gets the Header of the specified name in this Message. If multiple * Headers of this header name exist in the message, the first header * in the message is returned. * * @param headerName the new string name of Header type requested. * @return the Header of the specified name in the Message, this method * returns null if the Header does not exist. */ GetHeader(headerName string) header.Header /** * Gets a ListIterator over all the UnrecognizedHeaders in this * Message. Note the order of the UnrecognizedHeaders in the ListIterator is * the same as order in which they appeared in the SIP Message. * UnrecognizedHeaders are headers that the underlying implementation does * not recognize, if a header is recognized but is badly formatted it will * be dropped by the underlying implementation and will not be included in * this list. A Proxy should not delete UnrecognizedHeaders and should * add these Headers to the end of the header list of the Message that is * being forwarded. A User Agent may display these unrecognized headers to * the user. * * @return the ListIterator over all the UnrecognizedHeaders in the Message * represented as Strings, this method returns an empty ListIterator if no * UnrecognizedHeaders exist. */ GetUnrecognizedHeaders() *list.List //ListIterator; /** * Sets the new Header to replace existings Header of that type in * the message. If the SIP message contains more than one Header of * the new Header type it should replace the first occurance of this * Header and removes all other Headers of this type. If no Header of this * type exists this header is added to the end of the SIP Message. * This method should be used to change required Headers and overwrite * optional Headers. * * @param header the new Header to replace any existing Headers of that * type. */ SetHeader(h header.Header) error /** * Set the ContentLengthHeader of this Message. * The actual content length for the outgoing message will be computed from * the content assigned. If the content is speficied as an object it will * be converted to a String before the message is sent out and the content * length computed from the length of the string. If the message content is * specified in bytes, the length of the byte array specified will be used * to determine the content length header, that is in both cases, the length * of the content overrides any value specified in the content-length * header. * * @param contentLength the new ContentLengthHeader object containing the * content length value of this Message. * */ SetContentLength(contentLength header.ContentLengthHeader) /** * Gets the ContentLengthHeader of the body content of this Message. This is * the same as <code>this.getHeader(Content-Length);</code> * * @return the ContentLengthHeader of the message body. */ GetContentLength() header.ContentLengthHeader /** * Sets the ContentLanguageHeader of this Message. This overrides the * ContentLanguageHeader set using the setHeaders method. If no * ContentLanguageHeader exists in this message this ContentLanguageHeader * is added to the end of the Header List. * * @param contentLanguage the new ContentLanguageHeader object containing the * content language value of this Message. */ SetContentLanguage(contentLanguage header.ContentLanguageHeader) /** * Gets the ContentLanguageHeader of this Message. This is the same as * <code>this.getHeader(Content-Langauge);</code> * * @return the ContentLanguageHeader of the message body. */ GetContentLanguage() header.ContentLanguageHeader /** * Sets the ContentEncodingHeader of this Message. This overrides the * ContentEncodingHeader set using the setHeaders method. If no * ContentEncodingHeader exists in this message this ContentEncodingHeader * is added to the end of the Header List. * * @param contentEncoding the new ContentEncodingHeader object containing the * content encoding values of this Message. */ SetContentEncoding(contentEncoding header.ContentEncodingHeader) /** * Gets the ContentEncodingHeader of this Message. This is the same as * <code>this.getHeader(Content-Encoding);</code> * * @return the ContentEncodingHeader of the message body. */ GetContentEncoding() header.ContentEncodingHeader /** * Sets the ContentDispositionHeader of this Message. This overrides the * ContentDispositionHeader set using the setHeaders method. If no * ContentDispositionHeader exists in this message this ContentDispositionHeader * is added to the end of the Header List. * * @param contentDisposition the new ContentDispositionHeader object * containing the content disposition value of this Message. */ SetContentDisposition(contentDisposition header.ContentDispositionHeader) /** * Gets the ContentDispositionHeader of this Message. This is the same as * <code>this.getHeader(Content-Disposition);</code> * * @return the ContentDispositionHeader of the message body. */ GetContentDisposition() header.ContentDispositionHeader /** * Sets the body of this Message, with the ContentType defined by the new * ContentTypeHeader object and the string value of the content. * * @param content the new Object value of the content of the Message. * @param contentTypeHeader the new ContentTypeHeader object that defines * the content type value. * @throws ParseException which signals that an error has been reached * unexpectedly while parsing the body. */ SetContent(content interface{}, contentTypeHeader header.ContentTypeHeader) //(ParseException error) /** * Gets the body content of the Message as an Object. * * @return the body content of the Message as an Object, this method * returns null if a body does not exist. */ GetContent() string /** * Removes the body content from this Message and all associated entity * headers, if a body exists, this method returns sliently if no body exists. */ RemoveContent() /** * Sets the ExpiresHeader of this Message. This overrides the ExpiresHeader * set using the setHeaders method. If no ExpiresHeader exists in this * message this ExpiresHeader is added to the end of the Header List. * * @param expires the new ExpiresHeader object containing the expires * values of this Message. */ SetExpires(expires header.ExpiresHeader) /** * Gets the ExpiresHeader of this Message. This is the same as * <code>this.getHeader(Expires);</code> * * @return the ExpiresHeader of the message body. */ GetExpires() header.ExpiresHeader /** * Sets the protocol version of SIP being used by this Message. * * @param version the new String object containing the version of the SIP * Protocol of this Message. * @throws ParseException which signals that an error has been reached * unexpectedly while parsing the version argument. */ SetSIPVersion(version string) //(ParseException error) /** * Gets the protocol version of SIP being used by this Message. * * @return the protocol version of the SIP protocol of this message. */ GetSIPVersion() string /** * Gets string representation of Message * @return string representation of Message */ String() string SetMessageContentFromByte(content []byte) }
type Request ¶
type Request interface { Message /** * Gets method string of this Request message. * * @return the method of this Request message. */ GetMethod() string /** * Sets the method of Request to the newly supplied value. The standard * RFC3261 methods are REGISTER for registering contact information, INVITE, * ACK, and CANCEL for setting up sessions, BYE for terminating sessions, and * OPTIONS for querying servers about their capabilities. * * @param method - the new string value of the method of Request * @throws ParseException which signals that an error has been reached * unexpectedly while parsing the method value. */ SetMethod(method string) (ParseException error) /** * Gets the URI Object identifying the request URI of this Request, which * indicates the user or service to which this request is addressed. * * @return Request URI of Request */ GetRequestURI() address.URI /** * Sets the RequestURI of Request. The Request-URI is a SIP or SIPS URI * or a general URI. It indicates the user or service to which this request * is being addressed. SIP elements MAY support Request-URIs with schemes * other than "sip" and "sips", for example the "tel" URI scheme. SIP * elements MAY translate non-SIP URIs using any mechanism at their disposal, * resulting in SIP URI, SIPS URI, or some other scheme. * * @param requestURI - the new Request URI of this request message */ SetRequestURI(requestURI address.URI) }
type Response ¶
type Response interface { Message /** * Sets the status-code of Response. The status-code is a 3-digit integer * result code that indicates the outcome of an attempt to understand and * satisfy a request. The Status-Code is intended for use by automata. * * @param statusCode the new integer value of the status code. * @throws ParseException which signals that an error has been reached * unexpectedly while parsing the statusCode value. */ SetStatusCode(statusCode int) (ParseException error) /** * Gets the integer value of the status code of Response, which identifies * the outcome of the request to which this response is related. * * @return the integer status-code of this Response message. */ GetStatusCode() int /** * Sets reason phrase of Response. The reason-phrase is intended to give a * short textual description of the status-code. The reason-phrase is * intended for the human user. A client is not required to examine or * display the reason-phrase. While RFC3261 suggests specific wording for * the reason phrase, implementations MAY choose other text. * * @param reasonPhrase the new string value of the reason phrase. * @throws ParseException which signals that an error has been reached * unexpectedly while parsing the reasonPhrase value. */ SetReasonPhrase(reasonPhrase string) (ParseException error) /** * Gets the reason phrase of this Response message. * * @return the string value of the reason phrase of this Response message. */ GetReasonPhrase() string }
type Router ¶
type Router interface { /** * Gets the Outbound Proxy parameter of this Router, this method may return * null if no outbound proxy is defined. * * @return the Outbound Proxy of this Router. * @see Hop */ GetOutboundProxy() address.Hop /** * Gets the ListIterator of the hops of the default Route. This method may * return null if a default route is not defined. * * @param request - the Request message that determines the default route. * @return the ListIterator over all the hops of this Router. * @see Hop */ GetNextHops(request Request) *list.List //ListIterator }
type SIPMessage ¶
type SIPMessage struct {
// contains filtered or unexported fields
}
*
- This is the main SIP Message structure. *
- @see StringMsgParser
- @see PipelinedMsgParser
func NewSIPMessage ¶
func NewSIPMessage() *SIPMessage
*
* * Constructor: Initializes lists and list headers. * All the headers for which there can be multiple occurances in * a message are derived from the SIPHeaderListClass. All singleton * headers are derived from SIPHeader class. *
func (*SIPMessage) AddHeader ¶
func (this *SIPMessage) AddHeader(sipHeader header.Header)
- Add a SIP header. *@param sipHeader -- sip header to add.
func (*SIPMessage) AddUnparsed ¶
func (this *SIPMessage) AddUnparsed(unparsed string)
- Add a header to the unparsed list of headers. * *@param unparsed -- unparsed header to add to the list.
func (*SIPMessage) AttachHeader ¶
func (this *SIPMessage) AttachHeader(h header.Header) (IllegalArgumentException error)
*
- Attach a header and die if you Get a duplicate header exception.
- @param h SIPHeader to attach.
func (*SIPMessage) AttachHeader2 ¶
func (this *SIPMessage) AttachHeader2(h header.Header, replaceflag bool)
*
- Attach a header to the end of the existing headers in
- this SIPMessage structure.
- This is equivalent to the attachHeader(SIPHeader,replaceflag,false);
- which is the normal way in which headers are attached.
- This was added in support of JAIN-SIP. *
- @param h header to attach.
- @param replaceflag if true then replace a header if it exists.
- @throws SIPDuplicateHeaderException If replaceFlag is false and
- only a singleton header is allowed (fpr example CSeq).
func (*SIPMessage) AttachHeader3 ¶
func (this *SIPMessage) AttachHeader3(h header.Header, replaceFlag, top bool) error
*
- Attach the header to the SIP Message structure at a specified
- position in its list of headers. *
- @param header Header to attach.
- @param replaceFlag If true then replace the existing header.
- @param index Location in the header list to insert the header.
- @exception SIPDuplicateHeaderException if the header is of a type
- that cannot tolerate duplicates and one of this type already exists
- (e.g. CSeq header).
- @throws IndexOutOfBoundsException If the index specified is
- greater than the number of headers that are in this message.
func (*SIPMessage) EncodeAsBytes ¶
func (this *SIPMessage) EncodeAsBytes() []byte
*
- Encode the message as a byte array.
- Use this when the message payload is a binary byte array. *
- @return The Canonical byte array representation of the message
- (including the canonical byte array representation of
- the SDP payload if it exists all in one contiguous byte array). *
func (*SIPMessage) GetAuthorization ¶
func (this *SIPMessage) GetAuthorization() *header.Authorization
*
- Get the Authorization header (nil if one does not exist).
- @return Authorization header.
func (*SIPMessage) GetCSeq ¶
func (this *SIPMessage) GetCSeq() header.CSeqHeader
*
- Get the CSeq list of header (nil if one does not exist).
- @return CSeq header
func (*SIPMessage) GetCSeqNumber ¶
func (this *SIPMessage) GetCSeqNumber() int
* Get the sequence number.
- @return the sequence number.
func (*SIPMessage) GetCallId ¶
func (this *SIPMessage) GetCallId() header.CallIdHeader
- Get the CallID header (nil if one does not exist) *
- @return Call-ID header .
func (*SIPMessage) GetCallIdentifier ¶
func (this *SIPMessage) GetCallIdentifier() string
*
- Get the call ID string.
- A conveniance function that returns the stuff following
- the header name for the call id header. * *@return the call identifier. *
func (*SIPMessage) GetContactHeaders ¶
func (this *SIPMessage) GetContactHeaders() *header.ContactList
*
- Get the Contact list of headers (nil if one does not exist).
- @return List containing Contact headers.
func (*SIPMessage) GetContent ¶
func (this *SIPMessage) GetContent() string
- Get the content of the header. * *@return the content of the sip message.
func (*SIPMessage) GetContentDisposition ¶
func (this *SIPMessage) GetContentDisposition() header.ContentDispositionHeader
- Get content disposition header or nil if no such header exists. *
- @return the contentDisposition header
func (*SIPMessage) GetContentEncoding ¶
func (this *SIPMessage) GetContentEncoding() header.ContentEncodingHeader
- Get the content encoding header. * *@return the contentEncoding header.
func (*SIPMessage) GetContentLanguage ¶
func (this *SIPMessage) GetContentLanguage() header.ContentLanguageHeader
- Get the contentLanguage header. * *@return the content language header.
func (*SIPMessage) GetContentLength ¶
func (this *SIPMessage) GetContentLength() header.ContentLengthHeader
*
- Get the ContentLength header (nil if one does not exist). *
- @return content-length header.
func (*SIPMessage) GetContentTypeHeader ¶
func (this *SIPMessage) GetContentTypeHeader() header.ContentTypeHeader
*
- Get the contentType header (nil if one does not exist). *@return contentType header
func (*SIPMessage) GetErrorInfoHeaders ¶
func (this *SIPMessage) GetErrorInfoHeaders() *header.ErrorInfoList
*
- Get the ErrorInfo list of headers (nil if one does not exist).
- @return List containing ErrorInfo headers.
func (*SIPMessage) GetExpires ¶
func (this *SIPMessage) GetExpires() header.ExpiresHeader
- Get the exipres header. * *@return the expires header or nil if one does not exist.
func (*SIPMessage) GetFrom ¶
func (this *SIPMessage) GetFrom() header.FromHeader
- Get the from header. *@return -- the from header.
func (*SIPMessage) GetFromTag ¶
func (this *SIPMessage) GetFromTag() string
*
- Return the from tag. * *@return the tag from the from header. *
func (*SIPMessage) GetHeader ¶
func (this *SIPMessage) GetHeader(headerName string) header.Header
- Get the first header of the given name. * *@return header -- the first header of the given name.
func (*SIPMessage) GetHeaderList ¶
func (this *SIPMessage) GetHeaderList(headerName string) header.Lister
func (*SIPMessage) GetHeaderNames ¶
func (this *SIPMessage) GetHeaderNames() *list.List
- Get the header names. * *@return a list iterator to a list of header names. These are ordered
- in the same order as are present in the message.
func (*SIPMessage) GetHeaders ¶
func (this *SIPMessage) GetHeaders(headerName string) header.Lister
- Get a SIP header or Header list given its name. *@param headerName is the name of the header to Get. *@return a header or header list that contians the retrieved header.
func (*SIPMessage) GetMaxForwards ¶
func (this *SIPMessage) GetMaxForwards() header.MaxForwardsHeader
*
- Get the MaxForwards header (nil if one does not exist).
- @return Max-Forwards header
func (*SIPMessage) GetMessageAsEncodedStrings ¶
func (this *SIPMessage) GetMessageAsEncodedStrings() *list.List
- Get the headers as a linked list of encoded Strings *@return a linked list with each element of the list containing a
- string encoded header in canonical form.
func (*SIPMessage) GetMessageContent ¶
func (this *SIPMessage) GetMessageContent() string
*
- Get the message body as a string.
- If the message contains a content type header with a specified
- charSet, and if the payload has been read as a byte array, then
- it is returned encoded into this charSet. *
- @return Message body (as a string)
- @throws UnsupportedEncodingException if the platform does not
- support the charSet specified in the content type header. *
func (*SIPMessage) GetMinExpires ¶
func (this *SIPMessage) GetMinExpires() *header.MinExpires
*
- Get the MinExpires header.
- @return Min-Expires header
func (*SIPMessage) GetOrganizationHeader ¶
func (this *SIPMessage) GetOrganizationHeader() *header.Organization
*
- Get the Organization header (nil if one does not exist).
- @return Orgnaization header.
func (*SIPMessage) GetPriorityHeader ¶
func (this *SIPMessage) GetPriorityHeader() *header.Priority
*
- Get the Priority header (nil if one does not exist).
- @return Priority header
func (*SIPMessage) GetProxyAuthorizationHeader ¶
func (this *SIPMessage) GetProxyAuthorizationHeader() *header.ProxyAuthorization
*
- Get the ProxyAuthorization header (nil if one does not exist).
- @return List containing Proxy-Authorization headers.
func (*SIPMessage) GetRecordRouteHeaders ¶
func (this *SIPMessage) GetRecordRouteHeaders() *header.RecordRouteList
*
- Get the RecordRoute header list (nil if one does not exist). *
- @return Record-Route header
func (*SIPMessage) GetRouteHeaders ¶
func (this *SIPMessage) GetRouteHeaders() *header.RouteList
*
- Get the Route List of headers (nil if one does not exist).
- @return List containing Route headers
func (*SIPMessage) GetSIPHeaderList ¶
func (this *SIPMessage) GetSIPHeaderList(headerName string) header.SIPHeaderLister
func (*SIPMessage) GetTo ¶
func (this *SIPMessage) GetTo() header.ToHeader
*
- Get the To header (nil if one does not exist).
- @return To header
func (*SIPMessage) GetTopmostVia ¶
func (this *SIPMessage) GetTopmostVia() *header.Via
- Get the topmost via header. *@return the top most via header if one exists or nil if none exists.
func (*SIPMessage) GetTransactionId ¶
func (this *SIPMessage) GetTransactionId() string
*
- Generate (compute) a transaction ID for this SIP message.
- @return A string containing the concatenation of various
- portions of the From,To,Via and RequestURI portions
- of this message as specified in RFC 2543:
- All responses to a request contain the same values in
- the Call-ID, CSeq, To, and From fields
- (with the possible addition of a tag in the To field
- (section 10.43)). This allows responses to be matched with requests.
- Incorporates a bug fix for a bug sent in by Gordon Ledgard of
- IPera for generating transactionIDs when no port is present in the
- via header.
- Incorporates a bug fix for a bug report sent in by Chris Mills
- of Nortel Networks (converts to lower case when returning the
- transaction identifier). * *@return a string that can be used as a transaction identifier
- for this message. This can be used for matching responses and
- requests (i.e. an outgoing request and its matching response have
- the same computed transaction identifier).
func (*SIPMessage) GetUnrecognizedHeaders ¶
func (this *SIPMessage) GetUnrecognizedHeaders() *list.List
- Get a list containing the unrecognized headers. *@return a linked list containing unrecongnized headers.
func (*SIPMessage) GetViaHeaders ¶
func (this *SIPMessage) GetViaHeaders() *header.ViaList
*
- Get the Via list of headers (nil if one does not exist).
- @return List containing Via headers.
func (*SIPMessage) HasContent ¶
func (this *SIPMessage) HasContent() bool
* Return true if this message has a body.
func (*SIPMessage) HasFromTag ¶
func (this *SIPMessage) HasFromTag() bool
*
- Return true if the message has a From header tag. * *@return true if the message has a from header and that header has
- a tag.
func (*SIPMessage) HasHeader ¶
func (this *SIPMessage) HasHeader(headerName string) bool
*
- Return true if the SIPMessage has a header of the given name. * *@param headerName is the header name for which we are testing. *@return true if the header is present in the message
func (*SIPMessage) HasToTag ¶
func (this *SIPMessage) HasToTag() bool
*
- Return true if the message has a To header tag. * *@return true if the message has a to header and that header has
- a tag.
func (*SIPMessage) IsRequestHeader ¶
func (this *SIPMessage) IsRequestHeader(sipHeader header.Header) bool
- Return true if the header belongs only in a Request. * *@param sipHeader is the header to test.
func (*SIPMessage) IsResponseHeader ¶
func (this *SIPMessage) IsResponseHeader(sipHeader header.Header) bool
- Return true if the header belongs only in a response. * *@param sipHeader is the header to test.
func (*SIPMessage) RemoveContent ¶
func (this *SIPMessage) RemoveContent()
- Remove the message content if it exists. *
func (*SIPMessage) RemoveHeader ¶
func (this *SIPMessage) RemoveHeader(headerName string)
- Remove all headers given its name. * *@param headerName is the name of the header to remove.
func (*SIPMessage) RemoveHeader2 ¶
func (this *SIPMessage) RemoveHeader2(headerName string, top bool)
* Remove a header given its name. If multiple headers of a given name
- are present then the top flag determines which end to remove headers
- from. * *@param headerName is the name of the header to remove. *@param top -- flag that indicates which end of header list to process.
func (*SIPMessage) SetCSeq ¶
func (this *SIPMessage) SetCSeq(cseqHeader header.CSeqHeader)
- Set the CSeq header. * *@param cseqHeader -- CSeq Header.
func (*SIPMessage) SetCallId ¶
func (this *SIPMessage) SetCallId(callId header.CallIdHeader)
- Set the call id header. * *@param callid -- call idHeader (what else could it be?)
func (*SIPMessage) SetCallIdFromString ¶
func (this *SIPMessage) SetCallIdFromString(callId string)
- Get the CallID header (nil if one does not exist) * *@param callId -- the call identifier to be assigned to the call id header
func (*SIPMessage) SetContent ¶
func (this *SIPMessage) SetContent(content interface{}, contentTypeHeader header.ContentTypeHeader)
* Set the message content after converting the given object to a
- String. * *@param content -- content to Set. *@param contentTypeHeader -- content type header corresponding to
- content.
func (*SIPMessage) SetContentDisposition ¶
func (this *SIPMessage) SetContentDisposition(contentDispositionHeader header.ContentDispositionHeader)
- Set the content disposition header. * *@param contentDispositionHeader -- content disposition header.
func (*SIPMessage) SetContentEncoding ¶
func (this *SIPMessage) SetContentEncoding(contentEncodingHeader header.ContentEncodingHeader)
func (*SIPMessage) SetContentLanguage ¶
func (this *SIPMessage) SetContentLanguage(contentLanguageHeader header.ContentLanguageHeader)
func (*SIPMessage) SetContentLength ¶
func (this *SIPMessage) SetContentLength(contentLength header.ContentLengthHeader)
- Set the content length header. * *@param contentLength -- content length header.
func (*SIPMessage) SetExpires ¶
func (this *SIPMessage) SetExpires(expiresHeader header.ExpiresHeader)
- Set the expiresHeader * *@param expiresHeader -- the expires header to Set.
func (*SIPMessage) SetFrom ¶
func (this *SIPMessage) SetFrom(from header.FromHeader)
func (*SIPMessage) SetFromTag ¶
func (this *SIPMessage) SetFromTag(tag string)
- Set the From Tag. * *@param tag -- tag to Set in the from header.
func (*SIPMessage) SetHeader ¶
func (this *SIPMessage) SetHeader(h header.Header) (IllegalArgumentException error)
*
- Attach a header (replacing the original header).
- @param header SIPHeader that replaces a header of the same type.
func (*SIPMessage) SetHeaderFromSIPHeaderList ¶
func (this *SIPMessage) SetHeaderFromSIPHeaderList(sipHeaderList header.SIPHeaderLister)
- Set the header given a list of headers. * *@param headerList a headerList to Set
func (*SIPMessage) SetHeaders ¶
func (this *SIPMessage) SetHeaders(headers *list.List)
- Set a header from a linked list of headers. * *@param headers -- a list of headers to Set.
func (*SIPMessage) SetMaxForwards ¶
func (this *SIPMessage) SetMaxForwards(maxForwards header.MaxForwardsHeader)
- Set the max forwards header. *@param -- maxForwards is the MaxForwardsHeader to Set.
func (*SIPMessage) SetMessageContent ¶
func (this *SIPMessage) SetMessageContent(content string)
*
- Set the message content for this message. *
- @param content Message body as a string.
func (*SIPMessage) SetMessageContent3 ¶
func (this *SIPMessage) SetMessageContent3(t string, subType string, messageContent []byte)
- Set the message content for a given type and subtype. * *@param type is the messge type. *@param subType is the message subType. *@param messageContent is the message content as a byte array.
func (*SIPMessage) SetMessageContentFromByte ¶
func (this *SIPMessage) SetMessageContentFromByte(content []byte)
- Set the message content as an array of bytes. * *@param content is the content of the message as an array of bytes.
func (*SIPMessage) SetMessageContentFromString ¶
func (this *SIPMessage) SetMessageContentFromString(t string, subType string, messageContent string)
- Set the message content given type and subtype. * *@param type is the message type (eg. application) *@param subType is the message sybtype (eg. sdp) *@param messageContent is the messge content as a string.
func (*SIPMessage) SetMinExpiresHeader ¶
func (this *SIPMessage) SetMinExpiresHeader(minExpires header.MinExpiresHeader)
- Set the min expires header. * *@return the Min-Expires header.
func (*SIPMessage) SetTo ¶
func (this *SIPMessage) SetTo(to header.ToHeader)
func (*SIPMessage) SetToTag ¶
func (this *SIPMessage) SetToTag(tag string)
- Set the to tag. * *@param tag -- tag to Set.
func (*SIPMessage) SetVia ¶
func (this *SIPMessage) SetVia(viaList *header.ViaList)
- Set A list of via headers. *@param - a list of via headers to add.
func (*SIPMessage) String ¶
func (this *SIPMessage) String() string
*
- Encode this message as a string. This is more efficient when
- the payload is a string (rather than a binary array of bytes).
- If the payload cannot be encoded as a UTF-8 string then it is
- simply ignored (will not appear in the encoded message).
- @return The Canonical String representation of the message
- (including the canonical string representation of
- the SDP payload if it exists).
type SIPRequest ¶
type SIPRequest struct { SIPMessage // contains filtered or unexported fields }
* * The SIP Request structure-- this belongs to the parser who fills it up. * Acknowledgements: Mark Bednarek made a few fixes to this code. * Jeff Keyser added two methods that create responses and generate * cancel requests from incoming orignial requests without * the additional overhead of encoding and decoding messages.
func (*SIPRequest) CheckHeaders ¶
func (this *SIPRequest) CheckHeaders() (ParseException error)
/** * Check header for constraints. * (1) Invite options and bye requests can only have SIP URIs in the * contact headers. * (2) Request must have cseq, to and from and via headers. * (3) Method in request URI must match that in CSEQ. */
func (*SIPRequest) CreateACKRequest ¶
func (this *SIPRequest) CreateACKRequest() *SIPRequest
* Create an ACK request from this request. This is suitable for * generating an ACK for an INVITE client transaction. * *@return an ACK request that is generated from this request. *
func (*SIPRequest) CreateAckRequest ¶
func (this *SIPRequest) CreateAckRequest(responseToHeader *header.To) *SIPRequest
/** Creates a default ACK SIPRequest message for this original request. * Note that the defaultACK SIPRequest does not include the * content of the original SIPRequest. If responSetoHeader * is nil then the toHeader of this request is used to * construct the ACK. Note that tag fields are just copied * from the original SIP Request. Added by Jeff Keyser. * *@param responSetoHeader To header to use for this request. * *@return A SIPRequest with an ACK method. */
func (*SIPRequest) CreateBYERequest ¶
func (this *SIPRequest) CreateBYERequest(switchHeaders bool) *SIPRequest
- Create a BYE request from this request. * *@param switchHeaders is a boolean flag that causes from and
- isServerTransaction to headers to be swapped. Set this
- to true if you are the server of the dialog and are generating
- a BYE request for the dialog. *@return a new default BYE request.
func (*SIPRequest) CreateCancelRequest ¶
func (this *SIPRequest) CreateCancelRequest() *SIPRequest
func (*SIPRequest) CreateResponse ¶
func (this *SIPRequest) CreateResponse(statusCode int) *SIPResponse
func (*SIPRequest) CreateResponse2 ¶
func (this *SIPRequest) CreateResponse2(statusCode int, reasonPhrase string) *SIPResponse
func (*SIPRequest) CreateSIPRequest ¶
func (this *SIPRequest) CreateSIPRequest(requestLine *header.RequestLine, switchHeaders bool) *SIPRequest
/** Create a new default SIPRequest from the original request. Warning: * the newly created SIPRequest, shares the headers of * this request but we generate any new headers that we need to modify * so the original request is umodified. However, if you modify the * shared headers after this request is created, then the newly * created request will also be modified. * If you want to modify the original request * without affecting the returned Request * make sure you clone it before calling this method. * * Only required headers are copied. * <ul> * <li> * Contact headers are not included in the newly created request. * Setting the appropriate sequence number is the responsibility of * the caller. </li> * <li> RouteList is not copied for ACK and CANCEL </li> * <li> Note that we DO NOT copy the body of the * argument into the returned header. We do not copy the content * type header from the original request either. These have to be * added seperately and the content length has to be correctly Set * if necessary the content length is Set to 0 in the returned header. * </li> * <li>Contact List is not copied from the original request.</li> * <li>RecordRoute List is not included from original request. </li> * <li>Via header is not included from the original request. </li> * </ul> * *@param requestLine is the new request line. * *@param switchHeaders is a boolean flag that causes to and from * headers to switch (Set this to true if you are the * server of the transaction and are generating a BYE * request). If the headers are switched, we generate * new From and To headers otherwise we just use the * incoming headers. * *@return a new Default SIP Request which has the requestLine specified. * */
func (*SIPRequest) EncodeAsBytes ¶
func (this *SIPRequest) EncodeAsBytes() []byte
func (*SIPRequest) GetDialogId ¶
func (this *SIPRequest) GetDialogId(isServer bool) string
/** Get a dialog identifier.
- Generates a string that can be used as a dialog identifier. *
*@param isServer is Set to true if this is the UAS * and Set to false if this is the UAC */
func (*SIPRequest) GetDialogId2 ¶
func (this *SIPRequest) GetDialogId2(isServer bool, toTag string) string
/** Get a dialog id given the remote tag. */
func (*SIPRequest) GetFirstLine ¶
func (this *SIPRequest) GetFirstLine() string
* * Get the first line encoded. * *@return a string containing the encoded request line.
func (*SIPRequest) GetMessageAsEncodedStrings ¶
func (this *SIPRequest) GetMessageAsEncodedStrings() *list.List
/** * Get the message as a linked list of strings. * Use this if you want to iterate through the message. * *@return a linked list containing the request line and * headers encoded as strings. */
func (*SIPRequest) GetMethod ¶
func (this *SIPRequest) GetMethod() string
/** Get the method from the request line. *@return the method from the request line if the method exits and * nil if the request line or the method does not exist. */
func (*SIPRequest) GetRequestLine ¶
func (this *SIPRequest) GetRequestLine() *header.RequestLine
func (*SIPRequest) GetRequestURI ¶
func (this *SIPRequest) GetRequestURI() address.URI
/** * A conveniance function to access the Request URI. *@return the requestURI if it exists. */
func (*SIPRequest) GetSIPVersion ¶
func (this *SIPRequest) GetSIPVersion() string
* Get the SIP version. * *@return the SIP version from the request line.
func (*SIPRequest) GetViaHost ¶
func (this *SIPRequest) GetViaHost() string
* * Get the host from the topmost via header. * *@return the string representation of the host from the topmost via * header.
func (*SIPRequest) GetViaPort ¶
func (this *SIPRequest) GetViaPort() int
* * Get the port from the topmost via header. * *@return the port from the topmost via header (5060 if there is * no port indicated).
func (*SIPRequest) SetDefaults ¶
func (this *SIPRequest) SetDefaults()
/** * Set the default values in the request URI if necessary. */
func (*SIPRequest) SetMethod ¶
func (this *SIPRequest) SetMethod(method string)
/** Set the method. *@param method is the method to Set. *@throws IllegalArgumentException if the method is nil */
func (*SIPRequest) SetRequestLine ¶
func (this *SIPRequest) SetRequestLine(requestLine *header.RequestLine)
func (*SIPRequest) SetRequestLineDefaults ¶
func (this *SIPRequest) SetRequestLineDefaults()
/** * Patch up the request line as necessary. */
func (*SIPRequest) SetRequestURI ¶
func (this *SIPRequest) SetRequestURI(uri address.URI)
/** Sets the RequestURI of Request. The Request-URI is a SIP or
- SIPS URI or a general URI. It indicates the user or service to which
- this request is being addressed. SIP elements MAY support
- Request-URIs with schemes other than "sip" and "sips", for
- example the "tel" URI scheme. SIP elements MAY translate
- non-SIP URIs using any mechanism at their disposal, resulting
- in SIP URI, SIPS URI, or some other scheme. *
- @param requestURI - the new Request URI of this request message */
func (*SIPRequest) SetSIPVersion ¶
func (this *SIPRequest) SetSIPVersion(sipVersion string)
func (*SIPRequest) String ¶
func (this *SIPRequest) String() string
type SIPResponse ¶
type SIPResponse struct { SIPMessage // contains filtered or unexported fields }
func (*SIPResponse) CheckHeaders ¶
func (this *SIPResponse) CheckHeaders() (ParseException error)
/**
- Check the response structure. Must have from, to CSEQ and VIA
- headers. */
func (*SIPResponse) CreateRequest ¶
func (this *SIPResponse) CreateRequest(requestURI address.SipURI, via *header.Via, cseq *header.CSeq) *SIPRequest
func (*SIPResponse) EncodeAsBytes ¶
func (this *SIPResponse) EncodeAsBytes() []byte
func (*SIPResponse) GetDialogId ¶
func (this *SIPResponse) GetDialogId(isServer bool) string
/** Get a dialog identifier.
- Generates a string that can be used as a dialog identifier. *
- @param isServer is Set to true if this is the UAS
- and Set to false if this is the UAC */
func (*SIPResponse) GetDialogId2 ¶
func (this *SIPResponse) GetDialogId2(isServer bool, toTag string) string
func (*SIPResponse) GetFirstLine ¶
func (this *SIPResponse) GetFirstLine() string
/**
- Get the encoded first line. * *@return the status line encoded. * */
func (*SIPResponse) GetMessageAsEncodedStrings ¶
func (this *SIPResponse) GetMessageAsEncodedStrings() *list.List
func (*SIPResponse) GetReasonPhrase ¶
func (this *SIPResponse) GetReasonPhrase() string
/** Get the reason phrase.
*@return the reason phrase. */
func (*SIPResponse) GetReasonPhraseFromInt ¶
func (this *SIPResponse) GetReasonPhraseFromInt(rc int) string
func (*SIPResponse) GetSIPVersion ¶
func (this *SIPResponse) GetSIPVersion() string
func (*SIPResponse) GetStatusCode ¶
func (this *SIPResponse) GetStatusCode() int
/** Get the staus code (conveniance function).
*@return the status code of the status line. */
func (*SIPResponse) GetStatusLine ¶
func (this *SIPResponse) GetStatusLine() *header.StatusLine
/**
- Get the status line of the response. *@return StatusLine */
func (*SIPResponse) IsFinalResponse ¶
func (this *SIPResponse) IsFinalResponse() bool
/** Is this a final response?
*@return true if this is a final response. */
func (*SIPResponse) IsFinalResponseFromInt ¶
func (this *SIPResponse) IsFinalResponseFromInt(rc int) bool
/** Return true if the response is a final response.
*@param rc is the return code. *@return true if the parameter is between the range 200 and 700. */
func (*SIPResponse) SetReasonPhrase ¶
func (this *SIPResponse) SetReasonPhrase(reasonPhrase string)
/** Set the reason phrase.
*@param reasonPhrase the reason phrase. *@throws IllegalArgumentException if nil string */
func (*SIPResponse) SetSIPVersion ¶
func (this *SIPResponse) SetSIPVersion(sipVersion string)
func (*SIPResponse) SetStatusCode ¶
func (this *SIPResponse) SetStatusCode(statusCode int)
/** Set the status code.
*@param statusCode is the status code to Set. *@throws IlegalArgumentException if invalid status code. */
func (*SIPResponse) SetStatusLine ¶
func (this *SIPResponse) SetStatusLine(sl *header.StatusLine)
/**
- Set the status line field. *@param sl Status line to Set. */
func (*SIPResponse) String ¶
func (this *SIPResponse) String() string