Class Address
Object that represents a parsed SIP address.
A SIP address is made of display name, username, domain name, port, and various
uri headers (such as tags). It looks like 'Alice
<sip:alice@example.net>'.
You can create an address using
Inherited Members
Namespace: Linphone
Assembly: cs.temp.dll.dll
Syntax
public class Address : LinphoneObject
Properties
DisplayName
Returns the display name.
Declaration
public string DisplayName { get; set; }
Property Value
Type | Description |
---|---|
System.String | the display name if any, null otherwise. |
Domain
Returns the domain name.
Declaration
public string Domain { get; set; }
Property Value
Type | Description |
---|---|
System.String | the domain name if any, null otherwise. |
IsSip
returns whether the address is a routable SIP address or not
Declaration
public bool IsSip { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if it is a routable SIP address, false otherwise |
IsValid
Returns if address is valid.
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
System.Boolean | the scheme if any, null otherwise. |
MethodParam
Get the value of the method parameter.
Declaration
public string MethodParam { get; set; }
Property Value
Type | Description |
---|---|
System.String | the value of the parameter or null. |
Password
Get the password encoded in the address.
It is used for basic authentication (not recommended).
Declaration
public string Password { get; set; }
Property Value
Type | Description |
---|---|
System.String | the password if any, null otherwise. |
Port
Get port number as an integer value, 0 if not present.
Declaration
public int Port { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | the port set in the address or 0 if not present. |
Scheme
Returns the address scheme, normally "sip".
Declaration
public string Scheme { get; }
Property Value
Type | Description |
---|---|
System.String | the scheme if any, null otherwise. |
Secure
Returns whether the address refers to a secure location (sips) or not.
Declaration
public bool Secure { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if address refers to a secure location, false otherwise |
Transport
Get the transport.
Declaration
public TransportType Transport { get; set; }
Property Value
Type | Description |
---|---|
TransportType | a TransportType, default value if not set is UDP. |
UriParams
Set the value of the parameters of the URI of the address.
Declaration
public string UriParams { set; }
Property Value
Type | Description |
---|---|
System.String |
Username
Returns the username.
Declaration
public string Username { get; set; }
Property Value
Type | Description |
---|---|
System.String | the username name if any, null otherwise. |
Methods
AsString()
Returns the address as a string.
The returned char * must be freed by the application. Use ms_free().
Declaration
public string AsString()
Returns
Type | Description |
---|---|
System.String | a string representation of the address. |
AsStringUriOnly()
Returns the SIP uri only as a string, that is display name is removed.
The returned char * must be freed by the application. Use ms_free().
Declaration
public string AsStringUriOnly()
Returns
Type | Description |
---|---|
System.String | a string representation of the address. |
Clean()
Removes address's tags and uri headers so that it is displayable to the user.
Declaration
public void Clean()
Clone()
Clones a Address object.
Declaration
public Address Clone()
Returns
Type | Description |
---|---|
Address | a new Address object. |
Equal(Address)
Compare two Address taking the tags and headers into account.
Declaration
public bool Equal(Address address2)
Parameters
Type | Name | Description |
---|---|---|
Address | address2 | Address object. |
Returns
Type | Description |
---|---|
System.Boolean | Boolean value telling if the Address objects are equal. |
Remarks
See :
GetHeader(String)
Get the header encoded in the address.
Declaration
public string GetHeader(string headerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | headerName | the header name. |
Returns
Type | Description |
---|---|
System.String | the header value or null if it doesn't exists. |
GetParam(String)
Get the value of a parameter of the address.
Declaration
public string GetParam(string paramName)
Parameters
Type | Name | Description |
---|---|---|
System.String | paramName | The name of the parameter. |
Returns
Type | Description |
---|---|
System.String | The value of the parameter or null if it doesn't exists. |
GetUriParam(String)
Get the value of a parameter of the URI of the address.
Declaration
public string GetUriParam(string uriParamName)
Parameters
Type | Name | Description |
---|---|---|
System.String | uriParamName | The name of the parameter. |
Returns
Type | Description |
---|---|
System.String | The value of the parameter or null if it doesn't exists. |
HasParam(String)
Tell whether a parameter is present in the address.
Declaration
public bool HasParam(string paramName)
Parameters
Type | Name | Description |
---|---|---|
System.String | paramName | The name of the parameter. |
Returns
Type | Description |
---|---|
System.Boolean | A boolean value telling whether the parameter is present in the address |
HasUriParam(String)
Tell whether a parameter is present in the URI of the address.
Declaration
public bool HasUriParam(string uriParamName)
Parameters
Type | Name | Description |
---|---|---|
System.String | uriParamName | The name of the parameter. |
Returns
Type | Description |
---|---|
System.Boolean | A boolean value telling whether the parameter is present in the URI of the address |
RemoveUriParam(String)
Removes the value of a parameter of the URI of the address.
Declaration
public void RemoveUriParam(string uriParamName)
Parameters
Type | Name | Description |
---|---|---|
System.String | uriParamName | The name of the parameter. |
SetHeader(String, String)
Set a header into the address.
Headers appear in the URI with '?', such as <sip:test@linphone.org?SomeHeader=SomeValue>.
Declaration
public void SetHeader(string headerName, string headerValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | headerName | the header name. |
System.String | headerValue | the header value. |
SetParam(String, String)
Set the value of a parameter of the address.
Declaration
public void SetParam(string paramName, string paramValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | paramName | The name of the parameter. |
System.String | paramValue | The new value of the parameter. |
SetUriParam(String, String)
Set the value of a parameter of the URI of the address.
Declaration
public void SetUriParam(string uriParamName, string uriParamValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | uriParamName | The name of the parameter. |
System.String | uriParamValue | The new value of the parameter. |
WeakEqual(Address)
Compare two Address ignoring tags and headers, basically just domain, username, and port.
Declaration
public bool WeakEqual(Address address2)
Parameters
Type | Name | Description |
---|---|---|
Address | address2 | Address object. |
Returns
Type | Description |
---|---|
System.Boolean | Boolean value telling if the Address objects are equal. |
Remarks
See :