linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-developers] linphone-daemon patch


From: Nick Briggs
Subject: Re: [Linphone-developers] linphone-daemon patch
Date: Tue, 5 May 2020 21:39:10 -0700

Why would you not have done

config-set sound playback_dev_id "ALSA: Intel HDA"

since the value had spaces in it...?

On May 5, 2020, at 8:03 PM, Mike Flood <address@hidden> wrote:

Was using linphone-daemon on linux.

When I ran the command: "config-set sound playback_dev_id ALSA: Intel HDA"

It would set playback_dev_id to "ALSA:"

The below patch fixed the issue:

diff --git a/daemon/commands/config.cc b/daemon/commands/config.cc
index 7a59bff..c4ed008 100644
--- a/daemon/commands/config.cc
+++ b/daemon/commands/config.cc
@@ -18,6 +18,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 */
 
 #include "configcommand.h"
+#include <regex>
 
 using namespace std;
 
@@ -72,7 +73,9 @@ void ConfigSetCommand::exec(Daemon *app, const string& args) {
         app->sendResponse(Response("Missing section and/or key names."));
         return;
     }
-    ist>>value;
+    getline(ist, value);
+    value = std::regex_replace(value, std::regex("^ +"), "");
+    value = std::regex_replace(value, std::regex(" +$"), "");
     lp_config_set_string(linphone_core_get_config(app->getCore()), section.c_str(), key.c_str(), value.size()>0 ? value.c_str() : NULL);
     app->sendResponse(ConfigResponse(value.c_str()));
 }

_______________________________________________
Linphone-developers mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/linphone-developers


reply via email to

[Prev in Thread] Current Thread [Next in Thread]