mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 04:28:10 +00:00
JNI method to extract country code from e164 phone number
This commit is contained in:
parent
6653755997
commit
c7e98c7377
3 changed files with 17 additions and 0 deletions
|
|
@ -1132,6 +1132,12 @@ extern "C" jint Java_org_linphone_core_LinphoneProxyConfigImpl_lookupCCCFromIso(
|
|||
env->ReleaseStringUTFChars(jiso, iso);
|
||||
return (jint) prefix;
|
||||
}
|
||||
extern "C" jint Java_org_linphone_core_LinphoneProxyConfigImpl_lookupCCCFromE164(JNIEnv* env, jobject thiz, jlong proxyCfg, jstring je164) {
|
||||
const char* e164 = env->GetStringUTFChars(je164, NULL);
|
||||
int prefix = linphone_dial_plan_lookup_ccc_from_e164(e164);
|
||||
env->ReleaseStringUTFChars(je164, e164);
|
||||
return (jint) prefix;
|
||||
}
|
||||
extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getDomain(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong proxyCfg) {
|
||||
|
|
|
|||
|
|
@ -145,4 +145,10 @@ public interface LinphoneProxyConfig {
|
|||
* @param country iso code
|
||||
*/
|
||||
public int lookupCCCFromIso(String iso);
|
||||
|
||||
/**
|
||||
* Return the international prefix for the given country
|
||||
* @param e164 phone number
|
||||
*/
|
||||
public int lookupCCCFromE164(String e164);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
|
|||
private native void setContactParameters(long ptr, String params);
|
||||
|
||||
private native int lookupCCCFromIso(long nativePtr, String iso);
|
||||
private native int lookupCCCFromE164(long nativePtr, String e164);
|
||||
|
||||
public void enableRegister(boolean value) {
|
||||
enableRegister(nativePtr,value);
|
||||
|
|
@ -153,4 +154,8 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
|
|||
public int lookupCCCFromIso(String iso) {
|
||||
return lookupCCCFromIso(nativePtr, iso);
|
||||
}
|
||||
@Override
|
||||
public int lookupCCCFromE164(String e164) {
|
||||
return lookupCCCFromE164(nativePtr, e164);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue