diff --git a/wrappers/java/classes/LinphoneUtils.java b/wrappers/java/classes/LinphoneUtils.java new file mode 100644 index 000000000..c60ebb440 --- /dev/null +++ b/wrappers/java/classes/LinphoneUtils.java @@ -0,0 +1,34 @@ +/* +LinphoneUtils.java +Copyright (C) 2010-2017 Belledonne Communications, Grenoble, France + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +package org.linphone.core; + +public class LinphoneUtils { + public static int getPrefixFromE164(String e164) { + DialPlan[] dialPlans = Factory.instance().getDialPlans(); + DialPlan dialPlan = dialPlans[0]; + return dialPlan.lookupCccFromE164(e164); + } + + public static int getCccFromIso(String countryIso) { + DialPlan[] dialPlans = Factory.instance().getDialPlans(); + DialPlan dialPlan = dialPlans[0]; + return dialPlan.lookupCccFromIso(countryIso); + } +} diff --git a/wrappers/java/migration.sh b/wrappers/java/migration.sh index 00324baa8..2cef09ff8 100644 --- a/wrappers/java/migration.sh +++ b/wrappers/java/migration.sh @@ -229,6 +229,8 @@ eval "$SED_START 's/mLc.destroy()/mLc = null/g' $SED_END" eval "$SED_START 's/getAllDialPlan()/getDialPlans()/g' $SED_END" eval "$SED_START 's/getCountryName()/getCountry()/g' $SED_END" eval "$SED_START 's/getMSFactory()/getMediastreamerFactory()/g' $SED_END" +eval "$SED_START 's/accountCreator.getPrefix(/LinphoneUtils::getPrefixFromE164(/g' $SED_END" +eval "$SED_START 's/proxyConfig.lookupCCCFromIso(/LinphoneUtils::getCccFromIso(/g' $SED_END" #Changes in library required #Tunnel @@ -261,8 +263,6 @@ eval "$SED_START 's/getMSFactory()/getMediastreamerFactory()/g' $SED_END" #Core.enableSpeaker / isSpeakerEnabled() => mAudioManager.setSpeakerphoneOn(speakerOn); #Core.enableVideo(true, true) => Core.enableVideoCapture(bool) & Core.enableVideoDisplay(bool) #Core.setCpuCount() => Not needed anymore, can be removed -#AccountCreator.getPrefix => linphone_dial_plan_lookup_ccc_from_e164 -#ProxyConfig.lookupCCCFromIso=> linphone_dial_plan_lookup_ccc_from_iso #Factory.instance().setLogCollectionPath(getFilesDir().getAbsolutePath()); => Core.setLogCollectionPath #Factory.instance().enableLogCollection(isDebugEnabled); => COre.enableLogCollection #Factory.instance().setDebugMode(isDebugEnabled, getString(R.string.app_name)); => Core.setLogLevelMask