diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index c6e14ac15..393a05d04 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -177,7 +177,7 @@ static void call_received(SalOp *h){ lc->ringstream=NULL; lc->dmfs_playing_start_time=0; } - if(lc->ringstream==NULL){ + if(lc->ringstream==NULL && lc->sound_conf.local_ring){ MSSndCard *ringcard=lc->sound_conf.lsd_card ?lc->sound_conf.lsd_card : lc->sound_conf.ring_sndcard; ms_message("Starting local ring..."); lc->ringstream=ring_start(lc->sound_conf.local_ring,2000,ringcard); diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 059315b64..d2583a2b8 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2827,7 +2827,7 @@ void linphone_core_set_sound_source(LinphoneCore *lc, char source) /** * Sets the path to a wav file used for ringing. * - * The file must be a wav 16bit linear. + * @param path The file must be a wav 16bit linear. Local ring is disabled if null * * @ingroup media_parameters **/ diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 3ed73fd4c..2e883d56b 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -580,6 +580,26 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isVideoEnabled(JNIEn ,jlong lc) { return linphone_core_video_enabled((LinphoneCore*)lc); } +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setRing(JNIEnv* env + ,jobject thiz + ,jlong lc + ,jstring jpath) { + const char* path = jpath?env->GetStringUTFChars(jpath, NULL):NULL; + linphone_core_set_ring((LinphoneCore*)lc,path); + if (path) env->ReleaseStringUTFChars(jpath, path); +} +extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getRing(JNIEnv* env + ,jobject thiz + ,jlong lc + ) { + const char* path = linphone_core_get_ring((LinphoneCore*)lc); + if (path) { + return env->NewStringUTF(path); + } else { + return NULL; + } +} + //ProxyConfig @@ -1001,4 +1021,4 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_updateAddressWithParams( extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_updateCall(JNIEnv *env, jobject thiz, jlong lc, jlong call, jlong params){ return (jint) linphone_core_update_call((LinphoneCore *)lc, (LinphoneCall *)call, (LinphoneCallParams *)params); -} \ 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 94705b49d..874fc82d9 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -115,7 +115,7 @@ public interface LinphoneCore { } } /** - * Describes proxy registration states. + * Describes firewall policy. * */ static public class FirewallPolicy { @@ -461,4 +461,16 @@ public interface LinphoneCore { public LinphoneCallParams createDefaultCallParameters(); + /** + * Sets the path to a wav file used for ringing. + * + * @param path The file must be a wav 16bit linear. Local ring is disabled if null + */ + public void setRing(String path); + /** + * gets the path to a wav file used for ringing. + * + * @param null if not set + */ + public String getRing(); }