linphone::LdapParams Class Reference

Object that is used to set the different parameters of a Ldap. More...

`#include <ldap_params.hh>`

Inheritance diagram for linphone::LdapParams:

## Public Member Functions

LINPHONECXX_PUBLIC | LdapParams (void *ptr, bool takeRef=true)
LINPHONECXX_PUBLIC _LinphoneLdapParams * | cPtr ()
LINPHONECXX_PUBLIC linphone::Ldap::AuthMethod | getAuthMethod () const
| Get the authentification method.
LINPHONECXX_PUBLIC void | setAuthMethod (linphone::Ldap::AuthMethod authMethod)
| Authentification method.
LINPHONECXX_PUBLIC std::string | getBaseObject () const
| Get the BaseObject.
LINPHONECXX_PUBLIC void | setBaseObject (const std::string &baseObject)
| BaseObject is a specification for LDAP Search Scopes that specifies that the Search Request should only be performed against the entry specified as the search base DN.
LINPHONECXX_PUBLIC std::string | getBindDn () const
| Get the Bind DN to use for bindings.
LINPHONECXX_PUBLIC void | setBindDn (const std::string &bindDn)
| Bind DN to use for bindings.
LINPHONECXX_PUBLIC linphone::Ldap::DebugLevel | getDebugLevel () const
| Return the debug verbosity level.
LINPHONECXX_PUBLIC void | setDebugLevel (linphone::Ldap::DebugLevel level)
| The debug verbosity level from internal LDAP API.
LINPHONECXX_PUBLIC int | getDelay () const
| Get the delay between each search in milliseconds.
LINPHONECXX_PUBLIC void | setDelay (int delay)
| Delay between each search in milliseconds Default value : 500.
LINPHONECXX_PUBLIC bool | getEnabled () const
| Return if the configuration is enabled.
LINPHONECXX_PUBLIC void | setEnabled (bool enable)
| If this config is enabled.
LINPHONECXX_PUBLIC std::string | getFilter () const
| Get the search is based on this filter to search contacts.
LINPHONECXX_PUBLIC void | setFilter (const std::string &filter)
| The search is based on this filter to search contacts.
LINPHONECXX_PUBLIC int | getMaxResults () const
| Get the max results when requesting searches.
LINPHONECXX_PUBLIC void | setMaxResults (int maxResults)
| The max results when requesting searches.
LINPHONECXX_PUBLIC int | getMinChars () const
| Get the minimum characters needed for doing a search on LDAP servers.
LINPHONECXX_PUBLIC void | setMinChars (int minChars)
| The minimum characters needed for doing a search on LDAP servers.
LINPHONECXX_PUBLIC std::string | getNameAttribute () const
| Get the attributes to build Name Friend, separated by a comma and the first is the highest priority.
LINPHONECXX_PUBLIC void | setNameAttribute (const std::string &nameAttribute)
| Check these attributes to build Name Friend, separated by a comma and the first is the highest priority.
LINPHONECXX_PUBLIC std::string | getPassword () const
| Get the password to pass to server when binding.
LINPHONECXX_PUBLIC void | setPassword (const std::string &password)
| The password to pass to server when binding.
LINPHONECXX_PUBLIC bool | salEnabled () const
| Return if the dns resolution is done by Linphone using Sal.
LINPHONECXX_PUBLIC void | enableSal (bool enable)
| The dns resolution is done by Linphone using Sal.
LINPHONECXX_PUBLIC std::string | getServer () const
| Get the LDAP Server.
LINPHONECXX_PUBLIC void | setServer (const std::string &server)
| LDAP Server.
LINPHONECXX_PUBLIC linphone::Ldap::CertVerificationMode | getServerCertificatesVerificationMode () const
| Return whether the tls server certificate must be verified when connecting to a LDAP server.
LINPHONECXX_PUBLIC void | setServerCertificatesVerificationMode (linphone::Ldap::CertVerificationMode verifyServerCertificates)
| Specify whether the tls server certificate must be verified when connecting to a LDAP server.
LINPHONECXX_PUBLIC std::string | getSipAttribute () const
| Get the attributes to build the SIP username in address of Friend.
LINPHONECXX_PUBLIC void | setSipAttribute (const std::string &sipAttribute)
| Check these attributes to build the SIP username in address of Friend.
LINPHONECXX_PUBLIC std::string | getSipDomain () const
| Get the domain to the sip address(sip:username@domain).
LINPHONECXX_PUBLIC void | setSipDomain (const std::string &sipDomain)
| Add the domain to the sip address(sip:username@domain).
LINPHONECXX_PUBLIC int | getTimeout () const
| Get the timeout for requests in seconds.
LINPHONECXX_PUBLIC void | setTimeout (int timeout)
| Timeout for requests in seconds.
LINPHONECXX_PUBLIC int | getTimeoutTlsMs () const
| Get the timeout for TLS connection in milliseconds.
LINPHONECXX_PUBLIC void | setTimeoutTlsMs (int timeout)
| Timeout for TLS connection in milliseconds.
LINPHONECXX_PUBLIC bool | tlsEnabled () const
| Return if transactions are encrypted by LDAP over TLS(StartTLS).
LINPHONECXX_PUBLIC void | enableTls (bool enable)
| Encrypt transactions by LDAP over TLS(StartTLS).
LINPHONECXX_PUBLIC int | check () const
| Check parameters and return what are wrong.
LINPHONECXX_PUBLIC std::shared_ptr< linphone::LdapParams > | clone () const
| Instantiate a new LdapParams with values from source.
LINPHONECXX_PUBLIC std::string | getCustomValue (const std::string &key) const
| Get the value from field.
LINPHONECXX_PUBLIC void | setCustomValue (const std::string &key, const std::string &value)
| Set custom field.

## Detailed Description

Object that is used to set the different parameters of a Ldap.

## Member Function Documentation

## check()

LINPHONECXX_PUBLIC int linphone::LdapParams::check | ( |  | ) | const

Check parameters and return what are wrong.

Returns
  The Ldap::Check values. LinphoneLdapCheckOk if everything is ok.

## clone()

LINPHONECXX_PUBLIC std::shared_ptr< linphone::LdapParams > linphone::LdapParams::clone | ( |  | ) | const

Instantiate a new LdapParams with values from source.

Returns
  The newly created LdapParams object.

## enableSal()

LINPHONECXX_PUBLIC void linphone::LdapParams::enableSal | ( | bool | enable | ) |

The dns resolution is done by Linphone using Sal.

It will pass an IP to LDAP. By doing that, the TLS negociation could not check the hostname. You may deactivate the verifications if wanted to force the connection. Default value : false.

Parameters

  enable | Enable or not the use of sal.

## enableTls()

LINPHONECXX_PUBLIC void linphone::LdapParams::enableTls | ( | bool | enable | ) |

Encrypt transactions by LDAP over TLS(StartTLS).

You must use 'ldap' scheme. 'ldaps' for LDAP over SSL is non-standardized and deprecated. StartTLS in an extension to the LDAP protocol which uses the TLS protocol to encrypt communication. It works by establishing a normal - i.e. unsecured - connection with the LDAP server before a handshake negotiation between the server and the web services is carried out. Here, the server sends its certificate to prove its identity before the secure connection is established. Default value : true.

Parameters

  enable | Enable or not the use of TLS.

## getAuthMethod()

LINPHONECXX_PUBLIC linphone::Ldap::AuthMethod linphone::LdapParams::getAuthMethod | ( |  | ) | const

Get the authentification method.

Check Ldap::AuthMethod for authentification values.

Returns
  The Ldap::AuthMethod.

## getBaseObject()

LINPHONECXX_PUBLIC std::string linphone::LdapParams::getBaseObject | ( |  | ) | const

Get the BaseObject.

It is a specification for LDAP Search Scopes that specifies that the Search Request should only be performed against the entry specified as the search base DN. No entries above it will be considered. This field is required.

Returns
  The specification.

## getBindDn()

LINPHONECXX_PUBLIC std::string linphone::LdapParams::getBindDn | ( |  | ) | const

Get the Bind DN to use for bindings.

The bindDN DN is the credential that is used to authenticate against an LDAP. If empty, the connection will be Anonymous. eg: cn=ausername,ou=people,dc=bc,dc=com

Returns
  The Bind DN to use for bindings.

## getCustomValue()

LINPHONECXX_PUBLIC std::string linphone::LdapParams::getCustomValue | ( | const std::string & | key | ) | const

Get the value from field.

Parameters

  key | The key string.

Returns
  The Value associated to the key.

## getDebugLevel()

LINPHONECXX_PUBLIC linphone::Ldap::DebugLevel linphone::LdapParams::getDebugLevel | ( |  | ) | const

Return the debug verbosity level.

Returns
  The Ldap::DebugLevel debug level.

## getDelay()

LINPHONECXX_PUBLIC int linphone::LdapParams::getDelay | ( |  | ) | const

Get the delay between each search in milliseconds.

Returns
  The delay in milliseconds.

## getEnabled()

LINPHONECXX_PUBLIC bool linphone::LdapParams::getEnabled | ( |  | ) | const

Return if the configuration is enabled.

Returns
  Enable or not the LDAP configuration.

## getFilter()

LINPHONECXX_PUBLIC std::string linphone::LdapParams::getFilter | ( |  | ) | const

Get the search is based on this filter to search contacts.

Returns
  The filter to use.

## getMaxResults()

LINPHONECXX_PUBLIC int linphone::LdapParams::getMaxResults | ( |  | ) | const

Get the max results when requesting searches.

Returns
  The max results when requesting searches.

## getMinChars()

LINPHONECXX_PUBLIC int linphone::LdapParams::getMinChars | ( |  | ) | const

Get the minimum characters needed for doing a search on LDAP servers.

Returns
  The minimum characters needed by a search.

## getNameAttribute()

LINPHONECXX_PUBLIC std::string linphone::LdapParams::getNameAttribute | ( |  | ) | const

Get the attributes to build Name Friend, separated by a comma and the first is the highest priority.

Returns
  The comma separated attributes for the search.

## getPassword()

LINPHONECXX_PUBLIC std::string linphone::LdapParams::getPassword | ( |  | ) | const

Get the password to pass to server when binding.

Returns
  The password to pass to server when binding.

## getServer()

LINPHONECXX_PUBLIC std::string linphone::LdapParams::getServer | ( |  | ) | const

Get the LDAP Server.

Returns
  LDAP Server address.

## getServerCertificatesVerificationMode()

LINPHONECXX_PUBLIC linphone::Ldap::CertVerificationMode linphone::LdapParams::getServerCertificatesVerificationMode | ( |  | ) | const

Return whether the tls server certificate must be verified when connecting to a LDAP server.

Returns
  The TLS verification mode from Ldap::CertVerificationMode

## getSipAttribute()

LINPHONECXX_PUBLIC std::string linphone::LdapParams::getSipAttribute | ( |  | ) | const

Get the attributes to build the SIP username in address of Friend.

Attributes are separated by a comma.

Returns
  The comma separated attributes for building Friend.

## getSipDomain()

LINPHONECXX_PUBLIC std::string linphone::LdapParams::getSipDomain | ( |  | ) | const

Get the domain to the sip address(sip:username@domain).

Returns
  The SIP domain for the friend.

## getTimeout()

LINPHONECXX_PUBLIC int linphone::LdapParams::getTimeout | ( |  | ) | const

Get the timeout for requests in seconds.

Returns
  The timeout in seconds.

## getTimeoutTlsMs()

LINPHONECXX_PUBLIC int linphone::LdapParams::getTimeoutTlsMs | ( |  | ) | const

Get the timeout for TLS connection in milliseconds.

Returns
  The timeout in milliseconds.

## salEnabled()

LINPHONECXX_PUBLIC bool linphone::LdapParams::salEnabled | ( |  | ) | const

Return if the dns resolution is done by Linphone using Sal.

It will pass an IP to LDAP. By doing that, the TLS negociation could not check the hostname. You may deactivate the verifications if wanted to force the connection.

Returns
  Enable or not the use of sal.

## setAuthMethod()

LINPHONECXX_PUBLIC void linphone::LdapParams::setAuthMethod | ( | linphone::Ldap::AuthMethod | authMethod | ) |

Authentification method.

Check Ldap::AuthMethod for authentification values. Default value : LinphoneLdapAuthMethodSimple

Parameters

  authMethod | The Ldap::AuthMethod.

## setBaseObject()

LINPHONECXX_PUBLIC void linphone::LdapParams::setBaseObject | ( | const std::string & | baseObject | ) |

BaseObject is a specification for LDAP Search Scopes that specifies that the Search Request should only be performed against the entry specified as the search base DN.

No entries above it will be considered. This field is required. Default value : "dc=example,dc=com"

Parameters

  baseObject | The specification.

## setBindDn()

LINPHONECXX_PUBLIC void linphone::LdapParams::setBindDn | ( | const std::string & | bindDn | ) |

Bind DN to use for bindings.

The bindDN DN is the credential that is used to authenticate against an LDAP. If empty, the connection will be Anonymous. eg: cn=ausername,ou=people,dc=bc,dc=com Default value : "".

Parameters

  bindDn | The Bind DN to use for bindings.

## setCustomValue()

LINPHONECXX_PUBLIC void linphone::LdapParams::setCustomValue | ( | const std::string & | key,
|  | const std::string & | value )

Set custom field.

Parameters

  key | The key string.
  value | The value string.

## setDebugLevel()

LINPHONECXX_PUBLIC void linphone::LdapParams::setDebugLevel | ( | linphone::Ldap::DebugLevel | level | ) |

The debug verbosity level from internal LDAP API.

Values are Ldap::DebugLevel Default value: LinphoneLdapDebugLevelOff

Parameters

  level | The Ldap::DebugLevel debug level.

## setDelay()

LINPHONECXX_PUBLIC void linphone::LdapParams::setDelay | ( | int | delay | ) |

Delay between each search in milliseconds Default value : 500.

Parameters

  delay | The timeout in milliseconds.

## setEnabled()

LINPHONECXX_PUBLIC void linphone::LdapParams::setEnabled | ( | bool | enable | ) |

If this config is enabled.

Default value : false.

Parameters

  enable | Enable or not the LDAP configuration.

## setFilter()

LINPHONECXX_PUBLIC void linphone::LdapParams::setFilter | ( | const std::string & | filter | ) |

The search is based on this filter to search contacts.

Default value : "(sn=*%s*)".

Parameters

  filter | The filter to use.

## setMaxResults()

LINPHONECXX_PUBLIC void linphone::LdapParams::setMaxResults | ( | int | maxResults | ) |

The max results when requesting searches.

Default value : 5. This value fit for standard cases where only first results are needed. Also, it avoids latency on each searchs.

Parameters

  maxResults | The max results when requesting searches.

## setMinChars()

LINPHONECXX_PUBLIC void linphone::LdapParams::setMinChars | ( | int | minChars | ) |

The minimum characters needed for doing a search on LDAP servers.

Default value : 0.

Parameters

  minChars | The minimum characters needed by a search.

## setNameAttribute()

LINPHONECXX_PUBLIC void linphone::LdapParams::setNameAttribute | ( | const std::string & | nameAttribute | ) |

Check these attributes to build Name Friend, separated by a comma and the first is the highest priority.

Default value : "sn".

Parameters

  nameAttribute | The comma separated attributes for the search.

## setPassword()

LINPHONECXX_PUBLIC void linphone::LdapParams::setPassword | ( | const std::string & | password | ) |

The password to pass to server when binding.

Default value : "".

Parameters

  password | The password to pass to server when binding.

## setServer()

LINPHONECXX_PUBLIC void linphone::LdapParams::setServer | ( | const std::string & | server | ) |

LDAP Server.

eg: ldap:/// for a localhost server or ldap://ldap.example.org/ Default value: "ldap:///". This field is required. You must use 'ldap' scheme. 'ldaps' for LDAP over SSL is non-standardized and deprecated.

Parameters

  server | LDAP Server address.

## setServerCertificatesVerificationMode()

LINPHONECXX_PUBLIC void linphone::LdapParams::setServerCertificatesVerificationMode | ( | linphone::Ldap::CertVerificationMode | verifyServerCertificates | ) |

Specify whether the tls server certificate must be verified when connecting to a LDAP server.

Values are Ldap::CertVerificationMode Default value : LinphoneLdapCertVerificationDefault (auto)

Parameters

  verifyServerCertificates | The TLS verification mode from Ldap::CertVerificationMode

## setSipAttribute()

LINPHONECXX_PUBLIC void linphone::LdapParams::setSipAttribute | ( | const std::string & | sipAttribute | ) |

Check these attributes to build the SIP username in address of Friend.

Attributes are separated by a comma. Default value : "mobile,telephoneNumber,homePhone,sn".

Parameters

  sipAttribute | The comma separated attributes for building Friend.

## setSipDomain()

LINPHONECXX_PUBLIC void linphone::LdapParams::setSipDomain | ( | const std::string & | sipDomain | ) |

Add the domain to the sip address(sip:username@domain).

By default or if it is empty, the domain will be specify while searching on the current proxy account. Default value : "".

Parameters

  sipDomain | The SIP domain for the friend.

## setTimeout()

LINPHONECXX_PUBLIC void linphone::LdapParams::setTimeout | ( | int | timeout | ) |

Timeout for requests in seconds.

It limits the time for searchs and the value is passed to Ldap with LDAP_OPT_NETWORK_TIMEOUT. Default value : 5.

Parameters

  timeout | The timeout in seconds.

## setTimeoutTlsMs()

LINPHONECXX_PUBLIC void linphone::LdapParams::setTimeoutTlsMs | ( | int | timeout | ) |

Timeout for TLS connection in milliseconds.

Default value : 1000.

Parameters

  timeout | The timeout in milliseconds.

## tlsEnabled()

LINPHONECXX_PUBLIC bool linphone::LdapParams::tlsEnabled | ( |  | ) | const

Return if transactions are encrypted by LDAP over TLS(StartTLS).

You must use \'ldap\' scheme. \'ldaps\' for LDAP over SSL is non-standardized and deprecated. StartTLS in an extension to the LDAP protocol which uses the TLS protocol to encrypt communication. It works by establishing a normal - i.e. unsecured - connection with the LDAP server before a handshake negotiation between the server and the web services is carried out. Here, the server sends its certificate to prove its identity before the secure connection is established.

Returns
  Enable or not the use of TLS.

The documentation for this class was generated from the following file:

- ldap_params.hh