Added "echo" command to report or change remote echo status. Pressing

enter on an empty line does output back an empty line.


git-svn-id: http://voip.null.ro/svn/yate@1467 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2007-10-30 14:13:13 +00:00
parent e9fa93c5a4
commit 2948c61597
1 changed files with 13 additions and 1 deletions

View File

@ -93,6 +93,7 @@ static const CommandInfo s_cmdInfo[] =
{ "help", "[command]", 0, "Provide help on all or given command" },
{ "status", "[overview] [modulename]", s_oview, "Shows status of all or selected modules or channels" },
{ "uptime", 0, 0, "Show information on how long Yate has run" },
{ "echo", "[on|off]", s_bools, "Show or turn remote echo on or off" },
{ "machine", "[on|off]", s_bools, "Show or turn machine output mode on or off" },
{ "output", "[on|off]", s_bools, "Show or turn local output on or off" },
{ "color", "[on|off]", s_bools, "Show status or turn local colorization on or off" },
@ -438,11 +439,12 @@ bool Connection::processChar(unsigned char c)
case 0x1B: // ESC
m_escmode = c;
return false;
case '\r':
case '\n':
m_escmode = 0;
if (m_buffer.null())
return false;
case '\r':
m_escmode = 0;
if (m_echoing)
writeStr("\r\n");
if (processLine(m_buffer))
@ -711,6 +713,8 @@ bool Connection::processLine(const char *line)
DDebug("RManager",DebugInfo,"processLine = '%s'",line);
String str(line);
str.trimBlanks();
if (str.null())
return false;
m_lastcmd = str;
@ -731,6 +735,14 @@ bool Connection::processLine(const char *line)
writeStr(str);
return false;
}
else if (str.startSkip("echo"))
{
str >> m_echoing;
str = "Remote echo: ";
str += (m_echoing ? "on\r\n" : "off\r\n");
writeStr(str);
return false;
}
else if (str.startSkip("machine"))
{
str >> m_machine;