diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 39cbeaed030a224aaae5f340f1043f4a501c235d..d5f3ea5adff5fb44dfb9b6371ebb2c9890dd87ad 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -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()); diff --git a/src/c-wrapper/api/c-dial-plan.cpp b/src/c-wrapper/api/c-dial-plan.cpp index a3aad76fb722d971535625803e4061c065a9ed0e..af36ab06f8ee9f119d7d8a6fa94192de8722e3b7 100644 --- a/src/c-wrapper/api/c-dial-plan.cpp +++ b/src/c-wrapper/api/c-dial-plan.cpp @@ -29,14 +29,6 @@ using namespace std; L_DECLARE_C_CLONABLE_OBJECT_IMPL(DialPlan); -LinphoneDialPlan *linphone_dial_plan_ref (LinphoneDialPlan *dp) { - return reinterpret_cast(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 &dps = LinphonePrivate::DialPlan::getAllDialPlans(); + static const list &dps = LinphonePrivate::DialPlan::getAllDialPlans(); return L_GET_RESOLVED_C_LIST_FROM_CPP_LIST(dps); } diff --git a/src/dial-plan/dial-plan.cpp b/src/dial-plan/dial-plan.cpp index e05ec6fa10ed1d2b3b8c96f24eecbdd735d58cbe..f36fa2fbe86d445b73451427184e72e45ae3f28f 100644 --- a/src/dial-plan/dial-plan.cpp +++ b/src/dial-plan/dial-plan.cpp @@ -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)); } diff --git a/src/dial-plan/dial-plan.h b/src/dial-plan/dial-plan.h index b4be177df57e8fa06b0c3cd147dc6357c050c4bc..6e9be89ef2bdd740914c1903035a071a96f4a21d 100644 --- a/src/dial-plan/dial-plan.h +++ b/src/dial-plan/dial-plan.h @@ -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 &getAllDialPlans ();