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 1/2] 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 +} From 53281322d4d83c24e4e9d183afddd503e659c890 Mon Sep 17 00:00:00 2001 From: Deantwo <2676134+Deantwo@users.noreply.github.com> Date: Tue, 21 Jul 2020 14:17:07 +0200 Subject: [PATCH 2/2] Fixed use of incorrect Contains method --- Asterisk.2013/Asterisk.NET/Helper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Asterisk.2013/Asterisk.NET/Helper.cs b/Asterisk.2013/Asterisk.NET/Helper.cs index 56f5dd4..61125ed 100644 --- a/Asterisk.2013/Asterisk.NET/Helper.cs +++ b/Asterisk.2013/Asterisk.NET/Helper.cs @@ -647,7 +647,7 @@ namespace AsterNET { string name = line.Substring(0, delimiterIndex).ToLower(CultureInfo).Trim(); string val = line.Substring(delimiterIndex + 1).Trim(); - if (list.ContainsKey(name)) + if (list.Contains(name)) list[name] += Environment.NewLine + val; else if (val == "") list[name] = null;