From d5d0ed5056a8e38293d44c841e729f1ba73087ff Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 14 Mar 2017 10:05:31 +0100 Subject: [PATCH] Added callback setter for globalStateChanged --- coreapi/linphonecore.c | 5 ++++- include/linphone/core.h | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 2df55e0a0..4b36d6c9a 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -173,6 +173,10 @@ LinphoneCoreCbs *linphone_core_get_current_callbacks(const LinphoneCore *lc) { return lc->current_cbs; } +void linphone_core_cbs_set_global_state_changed(LinphoneCoreCbs *cbs, LinphoneCoreGlobalStateChangedCb cb) { + cbs->vtable->global_state_changed = cb; +} + void linphone_core_cbs_set_registration_state_changed(LinphoneCoreCbs *cbs, LinphoneCoreCbsRegistrationStateChangedCb cb) { cbs->vtable->registration_state_changed = cb; } @@ -277,7 +281,6 @@ void linphone_core_cbs_set_friend_list_removed(LinphoneCoreCbs *cbs, LinphoneCor cbs->vtable->friend_list_removed = cb; } - typedef belle_sip_object_t_vptr_t LinphoneCore_vptr_t; BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneCore); BELLE_SIP_INSTANCIATE_VPTR(LinphoneCore, belle_sip_object_t, diff --git a/include/linphone/core.h b/include/linphone/core.h index c54e3b7b9..6d63a2e02 100644 --- a/include/linphone/core.h +++ b/include/linphone/core.h @@ -607,6 +607,13 @@ LINPHONE_PUBLIC void *linphone_core_cbs_get_user_data(const LinphoneCoreCbs *cbs */ LINPHONE_PUBLIC LinphoneCoreCbs *linphone_core_get_current_callbacks(const LinphoneCore *lc); +/** + * Set the #LinphoneCoreGlobalStateChangedCb callback. + * @param[in] cbs A #LinphoneCoreCbs. + * @param[in] cb The callback. + */ +LINPHONE_PUBLIC void linphone_core_cbs_set_global_state_changed(LinphoneCoreCbs *cbs, LinphoneCoreGlobalStateChangedCb cb); + /** * Set the #LinphoneCoreCbsRegistrationStateChangedCb callback. * @param[in] cbs A #LinphoneCoreCbs.