Liblinphone  5.5.0
Public Member Functions | Static Public Member Functions | List of all members
linphone::DialPlan Class Reference

Represents a dial plan. More...

#include <dial_plan.hh>

Inheritance diagram for linphone::DialPlan:

Public Member Functions

LINPHONECXX_PUBLIC DialPlan (void *ptr, bool takeRef=true)
 
LINPHONECXX_PUBLIC _LinphoneDialPlan * cPtr ()
 
LINPHONECXX_PUBLIC std::string getCountry () const
 Returns the country name of the dialplan. More...
 
LINPHONECXX_PUBLIC std::string getCountryCallingCode () const
 Returns the country calling code of the dialplan. More...
 
LINPHONECXX_PUBLIC std::string getFlag () const
 Returns the flag of the teritory as unicode characters. More...
 
LINPHONECXX_PUBLIC std::string getInternationalCallPrefix () const
 Returns the international call prefix of the dialplan. More...
 
LINPHONECXX_PUBLIC bool isGeneric () const
 Return if given plan is generic. More...
 
LINPHONECXX_PUBLIC std::string getIsoCountryCode () const
 Returns the iso country code of the dialplan. More...
 
LINPHONECXX_PUBLIC int getNationalNumberLength () const
 Returns the national number length of the dialplan. More...
 
LINPHONECXX_PUBLIC std::string getTrunkPrefix () const
 Returns the trunk prefix for this country. More...
 
LINPHONECXX_PUBLIC std::string formatPhoneNumber (const std::string &phoneNumber, bool escapePlus) const
 Formats a phone number using dial plan informations. More...
 

Static Public Member Functions

static LINPHONECXX_PUBLIC std::shared_ptr< const linphone::DialPlanbyCcc (const std::string &ccc)
 Find best match for given CCC. More...
 
static LINPHONECXX_PUBLIC std::shared_ptr< const linphone::DialPlanbyCccAsInt (int ccc)
 Find best match for given CCC. More...
 
static LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::DialPlan > > getAllList ()
 Returns a list of all known dial plans. More...
 
static LINPHONECXX_PUBLIC int lookupCccFromE164 (const std::string &e164)
 Function to get call country code from an e164 number, ex: +33952650121 will return 33. More...
 
static LINPHONECXX_PUBLIC int lookupCccFromIso (const std::string &iso)
 Function to get call country code from ISO 3166-1 alpha-2 code, ex: FR returns 33. More...
 

Detailed Description

Represents a dial plan.

Member Function Documentation

◆ byCcc()

static LINPHONECXX_PUBLIC std::shared_ptr<const linphone::DialPlan> linphone::DialPlan::byCcc ( const std::string &  ccc)
static

Find best match for given CCC.

Parameters
cccThe country calling code
Returns
the matching dial plan, or a generic one if none found

◆ byCccAsInt()

static LINPHONECXX_PUBLIC std::shared_ptr<const linphone::DialPlan> linphone::DialPlan::byCccAsInt ( int  ccc)
static

Find best match for given CCC.

Parameters
cccthe country calling code
Returns
the matching dial plan, or a generic one if none found

◆ formatPhoneNumber()

LINPHONECXX_PUBLIC std::string linphone::DialPlan::formatPhoneNumber ( const std::string &  phoneNumber,
bool  escapePlus 
) const

Formats a phone number using dial plan informations.

Parameters
phoneNumberthe phone number to format.
escapePluswhether or not to use + or international calling prefix
Returns
the formatted phone number, or the original phone number if couldn't be formatted for some reason.

◆ getAllList()

static LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::DialPlan> > linphone::DialPlan::getAllList ( )
static

Returns a list of all known dial plans.

Returns
The list of all known dial plans.

◆ getCountry()

LINPHONECXX_PUBLIC std::string linphone::DialPlan::getCountry ( ) const

Returns the country name of the dialplan.

Returns
the country name

◆ getCountryCallingCode()

LINPHONECXX_PUBLIC std::string linphone::DialPlan::getCountryCallingCode ( ) const

Returns the country calling code of the dialplan.

Returns
the country calling code

◆ getFlag()

LINPHONECXX_PUBLIC std::string linphone::DialPlan::getFlag ( ) const

Returns the flag of the teritory as unicode characters.

Returns
the flag as unicode characters

◆ getInternationalCallPrefix()

LINPHONECXX_PUBLIC std::string linphone::DialPlan::getInternationalCallPrefix ( ) const

Returns the international call prefix of the dialplan.

Returns
the international call prefix

◆ getIsoCountryCode()

LINPHONECXX_PUBLIC std::string linphone::DialPlan::getIsoCountryCode ( ) const

Returns the iso country code of the dialplan.

Returns
the iso country code

◆ getNationalNumberLength()

LINPHONECXX_PUBLIC int linphone::DialPlan::getNationalNumberLength ( ) const

Returns the national number length of the dialplan.

Returns
the national number length

◆ getTrunkPrefix()

LINPHONECXX_PUBLIC std::string linphone::DialPlan::getTrunkPrefix ( ) const

Returns the trunk prefix for this country.

Trunk prefix will be removed from the start of flattened phone number before adding international prefix.

Returns
the trunk prefix if any, nullptr otherwise

◆ isGeneric()

LINPHONECXX_PUBLIC bool linphone::DialPlan::isGeneric ( ) const

Return if given plan is generic.

Returns
true if generic, false otherwise

◆ lookupCccFromE164()

static LINPHONECXX_PUBLIC int linphone::DialPlan::lookupCccFromE164 ( const std::string &  e164)
static

Function to get call country code from an e164 number, ex: +33952650121 will return 33.

Parameters
e164phone number
Returns
call country code or -1 if not found

◆ lookupCccFromIso()

static LINPHONECXX_PUBLIC int linphone::DialPlan::lookupCccFromIso ( const std::string &  iso)
static

Function to get call country code from ISO 3166-1 alpha-2 code, ex: FR returns 33.

Parameters
isocountry code alpha2
Returns
call country code or -1 if not found

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