C# Class SIPLib.SIP.Message

This class is used to represent a SIP message (both request and response messages).
Afficher le fichier Open project: richardspiers/C-Sharp-Sip-Lib Class Usage Examples

Méthodes publiques

Свойство Type Description
StatusCodeType StatusCodes
had_lr bool

Méthodes publiques

Méthode Description
CreateRequest ( string method, SIPURI uri, Dictionary
headers = null, string content = "" ) : Message

Creates a SIP request message based on the passed in parameters.

CreateResponse ( int responseCode, string responseText, Dictionary
headers = null, string content = "", Message originalRequest = null ) : Message

Creates a SIP response based on the passed in parameters.

Dup ( ) : Message

Creates a clone of this Header object.

First ( string name ) : SIPLib.SIP.Header

Helper function to return the first instance of a particular header.

InsertHeader ( SIPLib.SIP.Header header, string method = "replace" ) : void

Inserts a header into the SIP message by either replacing the existing header, appending it at the end of its own header list, or inserting at the front of its own header list depending on the method specified.

Is1XX ( ) : bool

Helper function to indicate type of SIP response message (Informational, Successful, ClientFailure etc.)

Is2XX ( ) : bool

Helper function to indicate type of SIP response message (Informational, Successful, ClientFailure etc.)

Is3XX ( ) : bool

Helper function to indicate type of SIP response message (Informational, Successful, ClientFailure etc.)

Is4XX ( ) : bool

Helper function to indicate type of SIP response message (Informational, Successful, ClientFailure etc.)

Is5XX ( ) : bool

Helper function to indicate type of SIP response message (Informational, Successful, ClientFailure etc.)

Is6XX ( ) : bool

Helper function to indicate type of SIP response message (Informational, Successful, ClientFailure etc.)

Is7XX ( ) : bool

Helper function to indicate type of SIP response message (Informational, Successful, ClientFailure etc.)

IsFinal ( ) : bool

Determines whether this instance is final (response code >= 200).

Message ( ) : System

Initializes a new, empty instance of the T:SIPLib.SIP.Message class.

Message ( string value ) : System

Initializes a new instance of the T:SIPLib.SIP.Message class based on a input string.

Parse ( string value ) : void

Parses the input string into a SIP message object.

PopulateMessage ( Message m, Dictionary
headers = null, string content = "" ) : Message

Populates the message - inserts the input list of headers into the message

ToString ( ) : string

Returns a System.String that represents this instance. For easy printing / reading.

Private Methods

Méthode Description
HandleVia ( List
headers ) : string

Creates the multi line representation of the via header list.

Init ( ) : void

Initilises the Message private variables.

Method Details

CreateRequest() public static méthode

Creates a SIP request message based on the passed in parameters.
public static CreateRequest ( string method, SIPURI uri, Dictionary
headers = null, string content = "" ) : Message
method string The SIP method to use.
uri SIPURI The destination URI used in the first line.
headers Dictionary
The SIP headers.
content string The SIP body content.
Résultat Message

CreateResponse() public static méthode

Creates a SIP response based on the passed in parameters.
public static CreateResponse ( int responseCode, string responseText, Dictionary
headers = null, string content = "", Message originalRequest = null ) : Message
responseCode int The response code (200 etc.)
responseText string The response text (OK etc.)
headers Dictionary
The SIP headers.
content string The SIP body content.
originalRequest Message The original request.
Résultat Message

Dup() public méthode

Creates a clone of this Header object.
public Dup ( ) : Message
Résultat Message

First() public méthode

Helper function to return the first instance of a particular header.
public First ( string name ) : SIPLib.SIP.Header
name string The name.
Résultat SIPLib.SIP.Header

InsertHeader() public méthode

Inserts a header into the SIP message by either replacing the existing header, appending it at the end of its own header list, or inserting at the front of its own header list depending on the method specified.
public InsertHeader ( SIPLib.SIP.Header header, string method = "replace" ) : void
header SIPLib.SIP.Header The header to insert.
method string The method - "replace", "append" or "insert". "replace" is the default.
Résultat void

Is1XX() public méthode

Helper function to indicate type of SIP response message (Informational, Successful, ClientFailure etc.)
public Is1XX ( ) : bool
Résultat bool

Is2XX() public méthode

Helper function to indicate type of SIP response message (Informational, Successful, ClientFailure etc.)
public Is2XX ( ) : bool
Résultat bool

Is3XX() public méthode

Helper function to indicate type of SIP response message (Informational, Successful, ClientFailure etc.)
public Is3XX ( ) : bool
Résultat bool

Is4XX() public méthode

Helper function to indicate type of SIP response message (Informational, Successful, ClientFailure etc.)
public Is4XX ( ) : bool
Résultat bool

Is5XX() public méthode

Helper function to indicate type of SIP response message (Informational, Successful, ClientFailure etc.)
public Is5XX ( ) : bool
Résultat bool

Is6XX() public méthode

Helper function to indicate type of SIP response message (Informational, Successful, ClientFailure etc.)
public Is6XX ( ) : bool
Résultat bool

Is7XX() public méthode

Helper function to indicate type of SIP response message (Informational, Successful, ClientFailure etc.)
public Is7XX ( ) : bool
Résultat bool

IsFinal() public méthode

Determines whether this instance is final (response code >= 200).
public IsFinal ( ) : bool
Résultat bool

Message() public méthode

Initializes a new, empty instance of the T:SIPLib.SIP.Message class.
public Message ( ) : System
Résultat System

Message() public méthode

Initializes a new instance of the T:SIPLib.SIP.Message class based on a input string.
public Message ( string value ) : System
value string The SIP message as a string.
Résultat System

Parse() public méthode

Parses the input string into a SIP message object.
public Parse ( string value ) : void
value string The value.
Résultat void

PopulateMessage() public static méthode

Populates the message - inserts the input list of headers into the message
public static PopulateMessage ( Message m, Dictionary
headers = null, string content = "" ) : Message
m Message The message being populated.
headers Dictionary
The headers to insert.
content string The SIP body content.
Résultat Message

ToString() public méthode

Returns a System.String that represents this instance. For easy printing / reading.
public ToString ( ) : string
Résultat string

Property Details

StatusCodeType public_oe property

The status code type (Informational, Successful, ClientFailure etc.)
public StatusCodes StatusCodeType
Résultat StatusCodes

had_lr public_oe property

Indication of loose routing.
public bool had_lr
Résultat bool