From d2ed993a60769fad306ec728dceb88733e3046e6 Mon Sep 17 00:00:00 2001 From: Deantwo <2676134+Deantwo@users.noreply.github.com> Date: Mon, 20 Jul 2020 23:34:22 +0200 Subject: [PATCH] Fixed multiple entries with same key If the reply from the asterisk server has multiple of the same key, they are override. This should fix that issue. See: #233 --- Asterisk.2013/Asterisk.NET/Helper.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Asterisk.2013/Asterisk.NET/Helper.cs b/Asterisk.2013/Asterisk.NET/Helper.cs index e6fc507..56f5dd4 100644 --- a/Asterisk.2013/Asterisk.NET/Helper.cs +++ b/Asterisk.2013/Asterisk.NET/Helper.cs @@ -647,7 +647,9 @@ namespace AsterNET { string name = line.Substring(0, delimiterIndex).ToLower(CultureInfo).Trim(); string val = line.Substring(delimiterIndex + 1).Trim(); - if (val == "") + if (list.ContainsKey(name)) + list[name] += Environment.NewLine + val; + else if (val == "") list[name] = null; else list[name] = val; @@ -885,4 +887,4 @@ namespace AsterNET #endregion } -} \ No newline at end of file +}