Package org.linphone.core

# Interface DialPlan

public interface DialPlan
Represents a dial plan.

## Method Summary

Modifier and Type
Method
Description
`DialPlan`
`byCcc(String ccc)`
Find best match for given CCC.
`DialPlan`
`byCccAsInt(int ccc)`
Find best match for given CCC.
`String`
`formatPhoneNumber(String phoneNumber, boolean escapePlus)`
Formats a phone number using dial plan informations.
`DialPlan[]`
`getAllList()`
Returns a list of all known dial plans.
`String`
`getCountry()`
Returns the country name of the dialplan.
`String`
`getCountryCallingCode()`
Returns the country calling code of the dialplan.
`String`
`getFlag()`
Returns the flag of the teritory as unicode characters.
`String`
`getInternationalCallPrefix()`
Returns the international call prefix of the dialplan.
`String`
`getIsoCountryCode()`
Returns the iso country code of the dialplan.
`int`
`getNationalNumberLength()`
Returns the national number length of the dialplan.
`long`
`getNativePointer()`
Gets the native pointer used by this class to make native method calls.
`String`
`getTrunkPrefix()`
Returns the trunk prefix for this country.
`Object`
`getUserData()`
Gets the object stored in this object user's data
`boolean`
`isGeneric()`
Return if given plan is generic.
`int`
`lookupCccFromE164(String e164)`
Function to get call country code from an e164 number, ex: +33952650121 will
return 33.
`int`
`lookupCccFromIso(String iso)`
Function to get call country code from ISO 3166-1 alpha-2 code, ex: FR returns
33.
`void`
`setUserData(Object data)`
Sets the object to store in this object user's data
`String`
`toString()`

## Method Details

### getCountry

String getCountry()
Returns the country name of the dialplan.

Returns:
  the country name

### getCountryCallingCode

@NonNull String getCountryCallingCode()
Returns the country calling code of the dialplan.

Returns:
  the country calling code

### getFlag

@NonNull String getFlag()
Returns the flag of the teritory as unicode characters.

Returns:
  the flag as unicode characters

### getInternationalCallPrefix

@NonNull String getInternationalCallPrefix()
Returns the international call prefix of the dialplan.

Returns:
  the international call prefix

### isGeneric

boolean isGeneric()
Return if given plan is generic.

Returns:
  true if generic, false otherwise

### getIsoCountryCode

@NonNull String getIsoCountryCode()
Returns the iso country code of the dialplan.

Returns:
  the iso country code

### getNationalNumberLength

int getNationalNumberLength()
Returns the national number length of the dialplan.

Returns:
  the national number length

### getTrunkPrefix

@Nullable String getTrunkPrefix()
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, null otherwise

### formatPhoneNumber

@NonNull String formatPhoneNumber(@NonNull String phoneNumber, boolean escapePlus)
Formats a phone number using dial plan informations.

Parameters:
  `phoneNumber` - the phone number to format.
  `escapePlus` - whether 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.

### byCcc

@NonNull DialPlan byCcc(@NonNull String ccc)
Find best match for given CCC.

Parameters:
  `ccc` - The country calling code
Returns:
  the matching dial plan, or a generic one if none found

### byCccAsInt

@NonNull DialPlan byCccAsInt(@NonNull int ccc)
Find best match for given CCC.

Parameters:
  `ccc` - the country calling code
Returns:
  the matching dial plan, or a generic one if none found

### getAllList

@NonNull DialPlan[] getAllList()
Returns a list of all known dial plans.

Returns:
  The list of all known dial plans. A list of `DialPlan` objects.

### lookupCccFromE164

int lookupCccFromE164(@NonNull String e164)
Function to get call country code from an e164 number, ex: +33952650121 will
return 33.

Parameters:
  `e164` - phone number
Returns:
  call country code or -1 if not found

### lookupCccFromIso

int lookupCccFromIso(@NonNull String iso)
Function to get call country code from ISO 3166-1 alpha-2 code, ex: FR returns
33.

Parameters:
  `iso` - country code alpha2
Returns:
  call country code or -1 if not found

### setUserData

void setUserData(Object data)
Sets the object to store in this object user's data

Parameters:
  `data` - the object to store

### getUserData

Object getUserData()
Gets the object stored in this object user's data

Returns:
  the object store if any, null otherwise

### getNativePointer

long getNativePointer()
Gets the native pointer used by this class to make native method calls.

Returns:
  the nativer pointer, as long

### toString

String toString()

Overrides:
  `toString` in class `Object`