Commit 795fc66a authored by Ronan's avatar Ronan

fix(DialPlan): remove unused wrapped functions and clean code

parent 474bce2b
......@@ -660,7 +660,7 @@ char* linphone_proxy_config_normalize_phone_number(LinphoneProxyConfig *proxy, c
ccc = DialPlan::lookupCccFromE164(flatten);
if (ccc>-1) { /*e164 like phone number*/
dialplan = DialPlan::findByCccAsInt(ccc);
dialplan = DialPlan::findByCcc(ccc);
nationnal_significant_number = strstr(flatten, dialplan.getCountryCallingCode().c_str());
if (nationnal_significant_number) {
nationnal_significant_number +=strlen(dialplan.getCountryCallingCode().c_str());
......@@ -679,7 +679,7 @@ char* linphone_proxy_config_normalize_phone_number(LinphoneProxyConfig *proxy, c
//probably generic dialplan, preserving proxy dial prefix
dialplan.setCountryCallingCode(tmpproxy->dial_prefix);
}
/*it does not make sens to try replace icp with + if we are not sure from the country we are (I.E tmpproxy->dial_prefix==NULL)*/
if (strstr(flatten, dialplan.getInternationalCallPrefix().c_str()) == flatten) {
char *e164 = replace_icp_with_plus(flatten, dialplan.getInternationalCallPrefix().c_str());
......
......@@ -29,14 +29,6 @@ using namespace std;
L_DECLARE_C_CLONABLE_OBJECT_IMPL(DialPlan);
LinphoneDialPlan *linphone_dial_plan_ref (LinphoneDialPlan *dp) {
return reinterpret_cast<LinphoneDialPlan *>(belle_sip_object_ref(dp));
}
void linphone_dial_plan_unref (LinphoneDialPlan *dp) {
belle_sip_object_unref(dp);
}
const char *linphone_dial_plan_get_country (const LinphoneDialPlan *dp) {
return L_STRING_TO_C(L_GET_CPP_PTR_FROM_C_OBJECT(dp)->getCountry());
}
......@@ -66,21 +58,17 @@ int linphone_dial_plan_lookup_ccc_from_iso (const char *iso) {
}
const LinphoneDialPlan *linphone_dial_plan_by_ccc_as_int (int ccc) {
const LinphonePrivate::DialPlan &dp = LinphonePrivate::DialPlan::findByCccAsInt(ccc);
static const LinphonePrivate::DialPlan &dp = LinphonePrivate::DialPlan::findByCcc(ccc);
return L_GET_C_BACK_PTR(&dp);
}
const LinphoneDialPlan *linphone_dial_plan_by_ccc (const char *ccc) {
const LinphonePrivate::DialPlan &dp = LinphonePrivate::DialPlan::findByCcc(L_C_TO_STRING(ccc));
static const LinphonePrivate::DialPlan &dp = LinphonePrivate::DialPlan::findByCcc(L_C_TO_STRING(ccc));
return L_GET_C_BACK_PTR(&dp);
}
const LinphoneDialPlan *linphone_dial_plan_get_all () {
return nullptr;
}
const bctbx_list_t *linphone_dial_plan_get_all_list () {
const list<LinphonePrivate::DialPlan> &dps = LinphonePrivate::DialPlan::getAllDialPlans();
static const list<LinphonePrivate::DialPlan> &dps = LinphonePrivate::DialPlan::getAllDialPlans();
return L_GET_RESOLVED_C_LIST_FROM_CPP_LIST(dps);
}
......
......@@ -379,7 +379,7 @@ int DialPlan::lookupCccFromIso (const string &iso) {
return -1;
}
const DialPlan &DialPlan::findByCccAsInt (int ccc) {
const DialPlan &DialPlan::findByCcc (int ccc) {
return DialPlan::findByCcc(Utils::toString(ccc));
}
......
......@@ -55,7 +55,7 @@ public:
static int lookupCccFromE164 (const std::string &e164);
static int lookupCccFromIso (const std::string &iso);
static const DialPlan &findByCccAsInt (int ccc);
static const DialPlan &findByCcc (int ccc);
static const DialPlan &findByCcc (const std::string &ccc);
static const std::list<DialPlan> &getAllDialPlans ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment