From 3cbabc10695909027c774303346aebdc0edf88eb Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 19 Jul 2012 15:22:51 +0200 Subject: [PATCH] add device identifier api --- coreapi/linphonecall.c | 4 ++++ coreapi/linphonecore.c | 7 +++++++ coreapi/linphonecore.h | 18 ++++++++++++++++++ coreapi/private.h | 1 + 4 files changed, 30 insertions(+) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 929814b5..786744fb 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -521,7 +521,11 @@ void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const switch(call->reason){ case LinphoneReasonDeclined: call->log->status=LinphoneCallDeclined; +<<<<<<< HEAD break; +======= + break; +>>>>>>> add device identifier api case LinphoneReasonNotAnswered: call->log->status=LinphoneCallMissed; break; diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 47f8a61a..d67ba6d5 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -5104,3 +5104,10 @@ void linphone_call_zoom_video(LinphoneCall* call, float zoom_factor, float* cx, }else ms_warning("Could not apply zoom: video output wasn't activated."); } +void linphone_core_set_device_identifier(LinphoneCore *lc,const char* device_id) { + if (lc->device_id) ms_free(lc->device_id); + lc->device_id=ms_strdup(device_id); +} +const char* linphone_core_get_device_identifier(const LinphoneCore *lc) { + return lc->device_id; +} diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 2972bc09..63763099 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -827,6 +827,24 @@ LinphoneCore *linphone_core_new(const LinphoneCoreVTable *vtable, /* function to be periodically called in a main loop */ void linphone_core_iterate(LinphoneCore *lc); +#if 0 /*not implemented yet*/ +/** + * @ingroup initializing + * Provide Linphone Core with an unique identifier. This be later used to identified contact address coming from this device. + * Value is not saved. + * @param lc object + * @param string identifying the device, can be EMEI or UDID + * + */ +void linphone_core_set_device_identifier(LinphoneCore *lc,const char* device_id); +/** + * @ingroup initializing + * get Linphone unique identifier + * + */ +const char* linphone_core_get_device_identifier(const LinphoneCore *lc); + +#endif LinphoneAddress * linphone_core_interpret_url(LinphoneCore *lc, const char *url); diff --git a/coreapi/private.h b/coreapi/private.h index 6c9ba8d2..2687ddc0 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -539,6 +539,7 @@ struct _LinphoneCore int device_rotation; int max_calls; LinphoneTunnel *tunnel; + char* device_id; }; LinphoneTunnel *linphone_core_tunnel_new(LinphoneCore *lc); -- 2.39.2