I was often asked why DOS terminal programs would fail to download files from BBSes when using DOSBox (e.g. using traditional serial/modem transfer protocols like XMODEM, YMODEM, ZMODEM). I'd seen it reported and confirmed that when a "serialX" port is configured in a DOSBox .conf as device of type "modem", that it does indeed, by default, not support Telnet. It may appear to support Telnet as it'll connect to Telnet servers, but it won't actually escape sent-IAC characters, unescape received-IAC characters or recognize or respond to Telnet commands. The "nullmodem" devicetype does support a "telnet:1" parameter to enable Telnet support, but that's not really helpful to those attempting to use DOS terminals to connect to Telnet BBSes on the Internet.
I looked through the DOSBox Wiki and Manual and really could find nothing about enabling Telnet support for "modem" (softmodem) serial devices. So I looked through the DOSBox source code and foudn this little bit of code in softmodem.cpp:
else if (strstr(cmdbuf,"NET1")) {
telnetmode = true;
SendRes(ResOK);
return;
}
That's some interesting code there. So if the 4 characters "NET1" appear anywhere in any AT command received by this softmodem, it'll enable Telnet support and then immediately stop parsing the command and return "OK". That's pretty terrible AT command parsing there (what if "NET1" happens to be in the hostname you're trying to connect to?), but whatever. I tried typing "ATNET1", and indeed it works: the next connection using "ATD..." did indeed support Telnet.
So...
1. Please document this ATNET0/1 command (1 to turn Telnet support on 0, to turn if off).
2. Please fix the AT command parser: strstr() is almost never what you actually want to use.
3. Please support the "telnet:1" option in the .conf file to enable telnet suport for "modem" devices by default.
Thanks, BBS users and sysops thank you.