Sheepshaver able to generate DTMF (simulated modem dialing)

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Post Reply
Spike
Space Cadet
Posts: 3
Joined: Mon May 13, 2024 9:02 pm

Sheepshaver able to generate DTMF (simulated modem dialing)

Post by Spike »

Hello folks. Does anyone know if it's possible to configure SheepShaver to emulate or simulate the presence of a modem in an emulated System 7 in order to permit classic Mac applications with telephony capabilities to produce DTMF tones through the host computer's speakers?

If it isn't possible within SheepShaver, is there any other emulator or an external component/program that can perform this task?

Thanks!
joevt
Tinkerer
Posts: 76
Joined: Mon Feb 01, 2010 3:08 am

Re: Sheepshaver able to generate DTMF (simulated modem dialing)

Post by joevt »

There exists code for software modems on GitHub. I don't know if any will do 57.6K or whatever. What baud did you want to get? Or do you just want to do the DTMF dialling?

macOS has DTMF sounds in /System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/telephony/

DTMF tones are simple overlapping sine waves so they can be easily calculated.
https://68kmla.org/bb/threads/dtmf-player.48757/

Decoding is more difficult:
https://github.com/ribt/dtmf-decoder
Spike
Space Cadet
Posts: 3
Joined: Mon May 13, 2024 9:02 pm

Re: Sheepshaver able to generate DTMF (simulated modem dialing)

Post by Spike »

Hi there. Thanks for your reply!

I just want to be able to "trick" various programs that invoke the modem to dial phone numbers into thinking they're controlling a real modem (actual modem speed is irrelevant, since no data would flow over this virtualized serial port), and for the emulator to generate the DTMF tones through the sound card/speaker. I don't intend to actually connect to a POTS; I only want terminal, fax, PPP dialers, or other programs to be able to "dial out" in a simulated way.

As it stands, most software of this type run within the SheepShaver environment tests whether a modem is present on one of the serial ports (modem/printer) and usually fails to proceed once it realizes there's nothing connected.

FWIW although it is useful to know that OSX has sound files in its system libraries, I am using SheepShaver on Windows 10/11 computers and would not have access to those libraries. I am also not a developer or programmer, so I would be unable to take advantage of those files even if I did have them.

Hope that helps clarify.
joevt
Tinkerer
Posts: 76
Joined: Mon Feb 01, 2010 3:08 am

Re: Sheepshaver able to generate DTMF (simulated modem dialing)

Post by joevt »

SheepShaver can send modem commands but nothing exists to send the expected response.

You're asking for an emulated modem to appear on the emulated serial port.
https://en.wikipedia.org/wiki/Hayes_AT_command_set
https://en.wikipedia.org/wiki/Command_m ... _Data_mode

Then there's fax modems.
https://en.wikipedia.org/wiki/Fax_modem
https://en.wikipedia.org/wiki/List_of_I ... mendations

You might need other sideband signals to be considered. A Mac serial port can support 2 or 3 of those so some can be ignored. CTS, DCD, DTR, RTS.
Other signals that can probably be ignored: DSR, RI, RTR.
https://en.wikipedia.org/wiki/RS-232

There's also the BREAK condition.
https://www.decisivetactics.com/support ... nd-a-break

For your purposes, you might not need any of these extra signals - you might just need the serial port to think it's always ready or always clear to send, etc.

You might only need to implement a couple modem commands. Monitor the characters being sent to the modem port. Then lookup what the response should be.

Can a program outside of SheepShaver connect to the emulated serial port and monitor the output to send a proper response?

DingusPPC creates a unix domain socket for the modem port. I connect to it in Terminal.app using this command:

Code: Select all

socat UNIX-CLIENT:dingussocket -,cs8,parenb=0,echo=0,icanon=0,isig=0,icrnl=0
to do Open Firmware input/output.
google AI says I can do something like this:

Code: Select all

socat UNIX-LISTEN:/tmp/test.sock,fork SYSTEM:"read line; echo 'Received: \$line'; echo 'Response From Server'"
I would replace "read line" with something that gets characters one at a time and adds it to a buffer, then the next part would look for the dialling command inside the buffer, then play the sounds for the digits of the phone number.
User avatar
adespoton
Forum All-Star
Posts: 4727
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com

Re: Sheepshaver able to generate DTMF (simulated modem dialing)

Post by adespoton »

Yeah; SheepShaver can connect to a host TTY as a virtual serial port. So what you really want is a program sitting on that TTY that will respond to Hayes AT commands.

Example minimal transcript (what you’d see on the serial line)

Code: Select all

(open port)
Host -> Modem: ATZ\r
Modem -> Host: OK\r\n
Host -> Modem: ATQ0V1E0S0=0\r
Modem -> Host: OK\r\n
Host -> Modem: ATDT18005551212\r
Modem -> Host: DIALING\r\n
Modem -> Host: RINGING (optional)\r\n
Modem -> Host: CONNECT 57600\r\n
Now data bytes flow (PPP, terminal session, etc.)
Failure example

Code: Select all

Host -> Modem: ATDT18005551212\r
Modem -> Host: NO DIALTONE\r\n
Modem -> Host: NO CARRIER\r\n
Post Reply