Commit dcaa1bcc authored by Matthieu Tanon's avatar Matthieu Tanon

Add API to access ZRTP peer status from core

parent 85b26d9b
......@@ -6718,6 +6718,17 @@ void *linphone_core_get_zrtp_cache_db(LinphoneCore *lc){
#endif /* SQLITE_STORAGE_ENABLED */
}
int linphone_core_get_zrtp_status(LinphoneCore *lc, const char *peerUri) {
#ifdef SQLITE_STORAGE_ENABLED
if (lc->zrtp_cache_db) {
return ms_zrtp_get_peer_status(lc->zrtp_cache_db, peerUri);
}
return 0;
#else /* SQLITE_STORAGE_ENABLED */
return 0;
#endif /* SQLITE_STORAGE_ENABLED */
}
static void linphone_core_zrtp_cache_close(LinphoneCore *lc) {
#ifdef SQLITE_STORAGE_ENABLED
if (lc->zrtp_cache_db) {
......
......@@ -4230,13 +4230,23 @@ LINPHONE_PUBLIC void linphone_core_set_zrtp_secrets_file(LinphoneCore *lc, const
LINPHONE_PUBLIC const char *linphone_core_get_zrtp_secrets_file(LinphoneCore *lc);
/**
* Get a pointer to the sqlite db holding zrtp/lime cache
* Get a pointer to the sqlite db holding zrtp/lime cache.
* @param[in] lc #LinphoneCore object.
* @return An sqlite3 pointer cast to a void one or NULL if cache is not available(not enabled at compile or access failed)
* @ingroup initializing
*/
LINPHONE_PUBLIC void *linphone_core_get_zrtp_cache_db(LinphoneCore *lc);
/**
* Get the zrtp sas validation status for a peer uri.
* Once the SAS has been validated or rejected, the status will never return to UNKNOWN (unless you delete your cache)
* @param[in] lc #LinphoneCore object.
* @return - BZRTP_CACHE_PEER_STATUS_UNKNOWN: this uri is not present in cache OR during calls with the active device, SAS never was validated or rejected
* - BZRTP_CACHE_PEER_STATUS_VALID: the active device status is set to valid
* - BZRTP_CACHE_PEER_STATUS_INVALID: the active peer device status is set to invalid
*/
LINPHONE_PUBLIC int linphone_core_get_zrtp_status(LinphoneCore *lc, const char *addr);
/**
* Set the path to the directory storing the user's x509 certificates (used by dtls)
* @param[in] lc #LinphoneCore object
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment