From 2b0c7c5d5cc4ca3c17e973749966f590f9800247 Mon Sep 17 00:00:00 2001 From: Fredrik Iversen Date: Sun, 10 Oct 2021 19:32:11 +0200 Subject: [PATCH 1/2] fix broken CallStatsEvent() when using audio only --- recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.bb | 3 ++- .../linphone-sdk/linphone-sdk/call-stats.patch | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk/call-stats.patch diff --git a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.bb b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.bb index 80eb63c..e05cfb8 100644 --- a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.bb +++ b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.bb @@ -16,7 +16,8 @@ python () { print(d.getVar('SRCREV', True)) } -SRC_URI = "gitsm://gitlab.linphone.org/BC/public/linphone-sdk.git;protocol=https;branch=release/5.0;" +SRC_URI = "gitsm://gitlab.linphone.org/BC/public/linphone-sdk.git;protocol=https;branch=release/5.0;" +SRC_URI += "file://call-stats.patch" PV = "git_${SRCREV}" PKGV = "${GITPKGVTAG}" diff --git a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk/call-stats.patch b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk/call-stats.patch new file mode 100644 index 0000000..4fff849 --- /dev/null +++ b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk/call-stats.patch @@ -0,0 +1,10 @@ +--- linphone-sdk/liblinphone/daemon/commands/call-stats.cc 2021-10-10 19:04:26.305172757 +0200 ++++ linphone-sdk/liblinphone/daemon/commands/call-stats.cc.new 2021-10-10 19:03:35.268962507 +0200 +@@ -74,6 +74,6 @@ + + ostringstream ostr; + ostr << CallStatsEvent(app, call, linphone_call_get_audio_stats(call)).getBody(); +- ostr << CallStatsEvent(app, call, linphone_call_get_video_stats(call)).getBody(); ++ // ostr << CallStatsEvent(app, call, linphone_call_get_video_stats(call)).getBody(); + app->sendResponse(Response(ostr.str(), Response::Ok)); + } From a00903756e3a1685c55da062df5c001db1c25329 Mon Sep 17 00:00:00 2001 From: Fredrik Iversen Date: Sun, 10 Oct 2021 19:33:13 +0200 Subject: [PATCH 2/2] improve CallStatsEvent patch with cleaner code The segfault behavior that this patch intends to fix might be fixed upstream. Track issue on remote github: https://github.com/BelledonneCommunications/linphone-sdk/issues/183 --- .../linphone-sdk/call-stats.patch | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk/call-stats.patch b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk/call-stats.patch index 4fff849..078acbf 100644 --- a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk/call-stats.patch +++ b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk/call-stats.patch @@ -1,10 +1,20 @@ ---- linphone-sdk/liblinphone/daemon/commands/call-stats.cc 2021-10-10 19:04:26.305172757 +0200 -+++ linphone-sdk/liblinphone/daemon/commands/call-stats.cc.new 2021-10-10 19:03:35.268962507 +0200 -@@ -74,6 +74,6 @@ +--- linphone-sdk/liblinphone/daemon/commands/call-stats.cc 2021-10-10 19:26:55.499286281 +0200 ++++ linphone-sdk/liblinphone/daemon/commands/call-stats.cc.new 2021-10-10 19:26:51.799270213 +0200 +@@ -73,7 +73,15 @@ + } ostringstream ostr; - ostr << CallStatsEvent(app, call, linphone_call_get_audio_stats(call)).getBody(); +- ostr << CallStatsEvent(app, call, linphone_call_get_audio_stats(call)).getBody(); - ostr << CallStatsEvent(app, call, linphone_call_get_video_stats(call)).getBody(); -+ // ostr << CallStatsEvent(app, call, linphone_call_get_video_stats(call)).getBody(); ++ ++ LinphoneCallStats* stats = nullptr; ++ stats = linphone_call_get_audio_stats(call); ++ if (nullptr != stats) { ++ ostr << CallStatsEvent(app, call, stats).getBody(); ++ } ++ stats = linphone_call_get_video_stats(call); ++ if (nullptr != stats) { ++ ostr << CallStatsEvent(app, call, stats).getBody(); ++ } app->sendResponse(Response(ostr.str(), Response::Ok)); }