From 41aad2cf4f3986b6e3526204c90a980dd67e2d34 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Mon, 22 Jun 2015 15:02:48 +0200 Subject: [PATCH] Quality reporting: add device name in report for iOS platform --- coreapi/quality_reporting.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/coreapi/quality_reporting.c b/coreapi/quality_reporting.c index b476aca93..23bfe8199 100644 --- a/coreapi/quality_reporting.c +++ b/coreapi/quality_reporting.c @@ -28,6 +28,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include +#if TARGET_OS_IPHONE +#include +#endif + #define STR_REASSIGN(dest, src) {\ if (dest != NULL) \ ms_free(dest); \ @@ -109,7 +113,6 @@ static void reset_avg_metrics(reporting_session_report_t * report){ #define METRICS_JITTER_BUFFER 1 << 3 #define METRICS_DELAY 1 << 4 #define METRICS_SIGNAL 1 << 5 -#define METRICS_ADAPTIVE_ALGORITHM 1 << 6 static uint8_t are_metrics_filled(const reporting_content_metrics_t rm) { uint8_t ret = 0; @@ -326,6 +329,17 @@ static int send_report(LinphoneCall* call, reporting_session_report_t * report, append_to_buffer(&buffer, &size, &offset, "\r\n"); } +#if TARGET_OS_IPHONE + { + size_t namesize; + char *machine; + sysctlbyname("hw.machine", NULL, &namesize, NULL, 0); + machine = malloc(namesize); + sysctlbyname("hw.machine", machine, &namesize, NULL, 0); + APPEND_IF_NOT_NULL_STR(&buffer, &size, &offset, "Device: %s\r\n", machine); + } +#endif + linphone_content_set_buffer(content, buffer, strlen(buffer)); ms_free(buffer);