diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 225e81e1545258da717ecc69a4911d4c5dc52dbc..928209827dfaa8ed13fa4f9c4b1e580522d56150 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -917,7 +917,8 @@ static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vta { memset (lc, 0, sizeof (LinphoneCore)); lc->data=userdata; - + lc->ringstream_autorelease=TRUE; + memcpy(&lc->vtable,vtable,sizeof(LinphoneCoreVTable)); linphone_core_set_state(lc,LinphoneGlobalStartup,"Starting up"); @@ -1662,7 +1663,7 @@ void linphone_core_iterate(LinphoneCore *lc){ lc_callback_obj_invoke(&lc->preview_finished_cb,lc); } - if (lc->ringstream && lc->dmfs_playing_start_time!=0 + if (lc->ringstream && lc->ringstream_autorelease && lc->dmfs_playing_start_time!=0 && (curtime-lc->dmfs_playing_start_time)>5){ ring_stop(lc->ringstream); lc->ringstream=NULL; @@ -4088,3 +4089,15 @@ void linphone_core_enable_keep_alive(LinphoneCore* lc,bool_t enable) { bool_t linphone_core_keep_alive_enabled(LinphoneCore* lc) { return sal_get_keepalive_period(lc->sal) > 0; } + +void linphone_core_start_dtmf_stream(LinphoneCore* lc) { + get_dtmf_gen(lc); /*make sure ring stream is started*/ + lc->ringstream_autorelease=FALSE; /*disable autorelease mode*/ +} + +void linphone_core_stop_dtmf_stream(LinphoneCore* lc) { + if (lc->ringstream) ring_stop(lc->ringstream); + lc->ringstream=NULL; +} + + diff --git a/coreapi/linphonecore_utils.h b/coreapi/linphonecore_utils.h index f003c4080e4ab10c3ba8d7d799c060a94d807782..a6845da9e62e83c4f75f75a4b139ed4c8fe584ea 100644 --- a/coreapi/linphonecore_utils.h +++ b/coreapi/linphonecore_utils.h @@ -68,6 +68,18 @@ typedef void (*LinphoneEcCalibrationCallback)(LinphoneCore *lc, LinphoneEcCalibr * Start an echo calibration of the sound devices, in order to find adequate settings for the echo canceller automatically. **/ int linphone_core_start_echo_calibration(LinphoneCore *lc, LinphoneEcCalibrationCallback cb, void *cb_data); +#if TARGET_OS_IPHONE +/** + * IOS special function to warm up dtmf feeback stream. #linphone_core_stop_dtmf_stream must be called before entering BG mode + */ +void linphone_core_start_dtmf_stream(const LinphoneCore* lc); +/** + * IOS special function to stop dtmf feed back function. Must be called before entering BG mode + */ +void linphone_core_stop_dtmf_stream(const LinphoneCore* lc); +#endif + + #ifdef __cplusplus } #endif diff --git a/coreapi/private.h b/coreapi/private.h index 838d6a1323c7797a2f3f9d245bb4d901f33c5681..2c3966a3bc28d318476ef1655c311cd4318fe2b7 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -435,6 +435,7 @@ struct _LinphoneCore bool_t auto_net_state_mon; bool_t network_reachable; bool_t use_preview_window; + bool_t ringstream_autorelease; }; bool_t linphone_core_can_we_add_call(LinphoneCore *lc);