Class JsSIP.IncomingMessage

An instance of JsSIP.IncomingMessage holds a received SIP request or response.

Instance Attributes

method

String indicating the method of the incoming SIP message.

from

JsSIP.NameAddrHeader instance respresenting the From header value of the incoming SIP message.

to

JsSIP.NameAddrHeader instance respresenting the To header value of the incoming SIP message.

body

String respresenting the SIP message body, null if no body is present.

Instance Methods

countHeader(name)

Counts the number of headers of the given header name. Returns the Number of headers present with the given name.

Parameters

name
String indicating the header name.

getHeader(name)

Gets the first value of the given header name. Returns a String with the value of the header, or null if the header doesn’t exist.

Parameters

name
String indicating the header name.

getHeaders(name)

Gets the header(s) of the given name. Returns an Array of Strings containing all the values for the given header name.

Parameters

name
String indicating the header name.

hasHeader(name)

Verifies the existence of the given header. Returns true if the header exists, false otherwise.

Parameters

name
String indicating the header name.

parseHeader(name, idx)

Parses the specified header at the given position. Returns the parsed header (an Object), undefined if the header is not present or in case of a parsing error.

Parameters

name
String indicating the header name.
idx
Header index (Number) to be parsed. Default value is 0 (First header).

toString()

Returns a String with the received SIP message.