/**
* 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);
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);
,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
* 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
*/
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;
}
-Subproject commit dce5ac7d4dc8e298cdedd5dcef55c60d7485206e
+Subproject commit 9412db625a9f00e6de4c612dbc69ab1f98822d63
-Subproject commit c8b487f32fe225f8b1961754db9140eb282a0d28
+Subproject commit 4e61d05db02318f44768458a69f29faec75c94c8