diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index b5c555733..189be5a93 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -4843,7 +4843,7 @@ int linphone_call_send_dtmf(LinphoneCall *call,char dtmf){ return 0; } -int linphone_call_send_dtmfs(LinphoneCall *call,char *dtmfs) { +int linphone_call_send_dtmfs(LinphoneCall *call,const char *dtmfs) { if (call==NULL){ ms_warning("linphone_call_send_dtmfs(): invalid call, canceling DTMF sequence."); return -1; diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 90f6e62b9..01db030da 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -870,7 +870,7 @@ LINPHONE_PUBLIC int linphone_call_send_dtmf(LinphoneCall *call,char dtmf); * @return -2 if there is already a DTMF sequence, -1 if call is not ready, 0 otherwise. * @ingroup call_control **/ -LINPHONE_PUBLIC int linphone_call_send_dtmfs(LinphoneCall *call,char *dtmfs); +LINPHONE_PUBLIC int linphone_call_send_dtmfs(LinphoneCall *call,const char *dtmfs); /** * Stop current DTMF sequence sending. diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 32ed49fda..88c3f3743 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1946,6 +1946,16 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_interpretUrl( JNIEnv* ReleaseStringUTFChars(env, jurl, url); return result; } +extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_sendDtmfs( JNIEnv* env + ,jobject thiz + ,jlong lc + ,jstring dtmf) { + int result; + const char* dtmfs = GetStringUTFChars(env, dtmf); + result = linphone_call_send_dtmfs(linphone_core_get_current_call((LinphoneCore*)lc),dtmfs); + ReleaseStringUTFChars(env, dtmf, dtmfs); + return result; +} extern "C" void Java_org_linphone_core_LinphoneCoreImpl_sendDtmf( JNIEnv* env ,jobject thiz ,jlong lc @@ -8172,4 +8182,4 @@ extern "C" jobject Java_org_linphone_core_LinphoneAccountCreatorImpl_configure(J LinphoneCoreVTable *table = linphone_core_get_current_vtable(lc); LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_v_table_get_user_data(table); return getProxy(env, lpc, lcData->core); -} +} \ No newline at end of file diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 9f20ce4a9..2e1cd4361 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -837,6 +837,11 @@ public interface LinphoneCore { */ boolean isMicMuted(); + /** + * Initiate dtmf if in call + * @param dtmf send dtmf + */ + void sendDtmfs(String dtmf); /** * Initiate a dtmf signal if in call * @param number send dtmf ['0'..'9'] | '#', '*' diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index 163fa1e10..58bb250d2 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -77,6 +77,7 @@ class LinphoneCoreImpl implements LinphoneCore { private native long interpretUrl(long nativePtr,String destination); private native Object inviteAddress(long nativePtr,long to); private native Object inviteAddressWithParams(long nativePtrLc,long to, long nativePtrParam); + private native int sendDtmfs(long nativePtr,String dtmf); private native void sendDtmf(long nativePtr,char dtmf); private native void clearCallLogs(long nativePtr); private native boolean isMicMuted(long nativePtr); @@ -367,6 +368,10 @@ class LinphoneCoreImpl implements LinphoneCore { } } + public synchronized void sendDtmfs(String dtmf) { + sendDtmfs(nativePtr, dtmf); + } + public synchronized void sendDtmf(char number) { sendDtmf(nativePtr, number); }