diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index ef145c2fd..6af2fbfc9 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -3532,12 +3532,19 @@ static MSFilter *get_dtmf_gen(LinphoneCore *lc){ /** * Plays a dtmf to the local user. **/ -void linphone_core_play_dtmf(LinphoneCore *lc, char dtmf, int duration_ms){ +void linphone_core_play_dtmf(LinphoneCore *lc, char dtmf, int duration_ms, bool_t speaker){ MSFilter *f=get_dtmf_gen(lc); if (f==NULL){ ms_error("No dtmf generator at this time !"); return; } + + if (!speaker && !linphone_core_in_call(lc)) { + // If not in call and user doesn't want sound to go out from speaker + // TODO: update dtmf generator to only output on output stream if speaker is false. + return; + } + if (duration_ms>0) ms_filter_call_method(f, MS_DTMF_GEN_PLAY, &dtmf); else ms_filter_call_method(f, MS_DTMF_GEN_START, &dtmf); diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 0b9823f3c..a2f86f429 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -897,7 +897,7 @@ void linphone_core_use_files(LinphoneCore *lc, bool_t yesno); void linphone_core_set_play_file(LinphoneCore *lc, const char *file); void linphone_core_set_record_file(LinphoneCore *lc, const char *file); -void linphone_core_play_dtmf(LinphoneCore *lc, char dtmf, int duration_ms); +void linphone_core_play_dtmf(LinphoneCore *lc, char dtmf, int duration_ms, bool_t speaker); void linphone_core_stop_dtmf(LinphoneCore *lc); int linphone_core_get_current_call_duration(const LinphoneCore *lc); diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index fbd8f01ea..7eca2c823 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -480,8 +480,9 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_playDtmf( JNIEnv* env ,jobject thiz ,jlong lc ,jchar dtmf - ,jint duration) { - linphone_core_play_dtmf((LinphoneCore*)lc,dtmf,duration); + ,jint duration + ,jboolean speaker) { + linphone_core_play_dtmf((LinphoneCore*)lc,dtmf,duration,speaker); } extern "C" void Java_org_linphone_core_LinphoneCoreImpl_stopDtmf( JNIEnv* env ,jobject thiz diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 3e33bdce6..2d5daff6d 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -350,8 +350,9 @@ public interface LinphoneCore { * Initiate a dtmf signal to the speqker if not in call * @param number * @param duration in ms , -1 for unlimited + * @param speaker play dtmf on speaker */ - public void playDtmf(char number,int duration); + public void playDtmf(char number,int duration, boolean speaker); /** * stop current dtmf */ diff --git a/java/common/org/linphone/core/LinphoneCoreFactory.java b/java/common/org/linphone/core/LinphoneCoreFactory.java index a4137ec91..5cbd5ac5e 100644 --- a/java/common/org/linphone/core/LinphoneCoreFactory.java +++ b/java/common/org/linphone/core/LinphoneCoreFactory.java @@ -36,14 +36,14 @@ abstract public class LinphoneCoreFactory { factoryName = className; } - public static LinphoneCoreFactory instance() { + public static final synchronized LinphoneCoreFactory instance() { try { if (theLinphoneCoreFactory == null) { Class lFactoryClass = Class.forName(factoryName); theLinphoneCoreFactory = (LinphoneCoreFactory) lFactoryClass.newInstance(); } } catch (Exception e) { - System.err.println("cannot instanciate factory ["+factoryName+"]"); + System.err.println("Cannot instanciate factory ["+factoryName+"]"); } return theLinphoneCoreFactory; } diff --git a/mediastreamer2 b/mediastreamer2 index dce5ac7d4..9412db625 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit dce5ac7d4dc8e298cdedd5dcef55c60d7485206e +Subproject commit 9412db625a9f00e6de4c612dbc69ab1f98822d63 diff --git a/oRTP b/oRTP index c8b487f32..4e61d05db 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit c8b487f32fe225f8b1961754db9140eb282a0d28 +Subproject commit 4e61d05db02318f44768458a69f29faec75c94c8