question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AsterNet command returns only last line

See original GitHub issue

I’m sending the command below using C # and AsterNet.

The command executes, but only returns the last line of the command’s response.

CommandAction cmdAction = new CommandAction ();
cmdAction.Command = "core show channels";
var response = manager.SendAction(cmdAction);

Ex: response: “0 calls processed”

Does anyone know how I do to return all lines of the command response?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
marcosnegrisolicommented, Jun 10, 2020

I made a correction by changing Helper.cs

I added this line:

 if (name == "output" && list.Contains("output")) val = list[name] + Environment.NewLine + val;
        internal static void AddKeyValue(IDictionary list, string line)
        {
            int delimiterIndex = line.IndexOf(":");
            if (delimiterIndex > 0 && line.Length > delimiterIndex + 1)
            {
                string name = line.Substring(0, delimiterIndex).ToLower(CultureInfo).Trim();
                string val = line.Substring(delimiterIndex + 1).Trim();

                if (name == "output" && list.Contains("output")) val = list[name] + Environment.NewLine + val;

                if (val == "<null>")
                    list[name] = null;
                else
                    list[name] = val;
            }
        }
0reactions
omidsaghicommented, Mar 29, 2021

that is great thanks very much.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - AsterNet comand
The command executes, but only returns the last line of the command's response. CommandAction cmdAction = new CommandAction (); cmdAction.
Read more >
How to display only the last line of a listing
This will display only the last line of ls -ltr 's output. You can control the number of lines by changing the value...
Read more >
Core Show Channel Command · Issue #55 · AsterNET ...
However, this itself doesn't return a result, but tells Asterisk to send 'CoreShowChannels' ... AsterNet command returns only last line #233.
Read more >
Untitled
I'm sending the command below using C # and AsterNet. The command executes, but only returns the last line of the command's response....
Read more >
How can we append asterisk (*) at the end of last line ...
That command will find all files even with spaces then append a * to the last line of all the .txt files found...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found