C
CM@POA
I am trying to write a very small program to send a nonstandard command to
some polycom endpoints and I am running into a problem after I get logged in
successfully and try to send the command I get a 502 command not implemented
error (which if i test by hand works fine) it seems like the command I am
sending is getting trashed somehow but I even setup a ftp sever locally to
see what commands are being recieved and it looks like the right command..
BUT I then changed the command to "dir" and "ls" and those both came back
also unimplemented.. so is something getting attached to the end of my
command I am not seeing and breaking it?
Here is a bit of the code
class Program
{
static void Main(string[] args)
{
OpenFTP.FTP f = new OpenFTP.FTP();
f.Connect("127.0.0.1", "loginname", "password");
f.PolycomReboot("dir");
f.Disconnect();
f = null;
}
}
}
(I get connected just fine)
Here is the send command code (used for sending all command including the
login and pw):
internal static void SendCommand(string sCommand)
{
Connect();
Byte[] byCommand = Encoding.ASCII.GetBytes((sCommand + "\r\n").ToCharArray());
main_sock.Send(byCommand, byCommand.Length, 0);
ReadResponse();
}
let me know if you need anymore info.. this is driving me crazy
some polycom endpoints and I am running into a problem after I get logged in
successfully and try to send the command I get a 502 command not implemented
error (which if i test by hand works fine) it seems like the command I am
sending is getting trashed somehow but I even setup a ftp sever locally to
see what commands are being recieved and it looks like the right command..
BUT I then changed the command to "dir" and "ls" and those both came back
also unimplemented.. so is something getting attached to the end of my
command I am not seeing and breaking it?
Here is a bit of the code
class Program
{
static void Main(string[] args)
{
OpenFTP.FTP f = new OpenFTP.FTP();
f.Connect("127.0.0.1", "loginname", "password");
f.PolycomReboot("dir");
f.Disconnect();
f = null;
}
}
}
(I get connected just fine)
Here is the send command code (used for sending all command including the
login and pw):
internal static void SendCommand(string sCommand)
{
Connect();
Byte[] byCommand = Encoding.ASCII.GetBytes((sCommand + "\r\n").ToCharArray());
main_sock.Send(byCommand, byCommand.Length, 0);
ReadResponse();
}
let me know if you need anymore info.. this is driving me crazy