diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index f19ad76ef..53bc6ba8b 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -1082,6 +1082,17 @@ int linphone_call_get_duration(const LinphoneCall *call){ return time(NULL)-call->media_start_time; } +/** + * Returns the call ring duration in seconds. This is only useful if the call is in state #LinphoneCallOutgoingRinging + * @param call the call + * @return ringing time + */ +int linphone_call_get_ring_duration(const LinphoneCall* call){ + if( call->start_time == 0) return 0; + return time(NULL)-call->start_time; +} + + /** * Returns the call object this call is replacing, if any. * Call replacement can occur during call transfers. diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 56f33b0d2..5edb9001f 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -639,6 +639,7 @@ LINPHONE_PUBLIC LinphoneCall *linphone_call_get_transferer_call(const LinphoneCa LINPHONE_PUBLIC LinphoneCall *linphone_call_get_transfer_target_call(const LinphoneCall *call); LINPHONE_PUBLIC LinphoneCall *linphone_call_get_replaced_call(LinphoneCall *call); LINPHONE_PUBLIC int linphone_call_get_duration(const LinphoneCall *call); +LINPHONE_PUBLIC int linphone_call_get_ring_duration(const LinphoneCall* call); LINPHONE_PUBLIC const LinphoneCallParams * linphone_call_get_current_params(LinphoneCall *call); LINPHONE_PUBLIC const LinphoneCallParams * linphone_call_get_remote_params(LinphoneCall *call); LINPHONE_PUBLIC void linphone_call_enable_camera(LinphoneCall *lc, bool_t enabled);