- native-test's line tools (fax_line, codec_line, t30_line) at
LINE_SPEED times the sample clock (line_speed.h); the fax tests ask
for 2x (DMODEM_LINE_SPEED, 1 a phone line's pace): 4x leaves the DTE
a quarter second for what class 1 times in a second, too tight on a
busy machine
- t30_line's first page some 70 KB in MH, not 220 KB (still two ECM
blocks)
- the Kermit and lrzsz interop tests' byte traces only when asked
(KERMIT_TRACE, TRANSFER_TRACE): a file opened for each chunk; Kermit's
big file 64 KB
- two test JVMs at once
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
T.38 tested end to end (SipFaxTest): the app's engine dialling dmodemd,
which asks for T.38 a second after it answers, before its CED; the
engine's call progress then waited for a CED that never came on audio.
D-Modem-RE's claude/t38-caller (the submodule here) takes T.38 on a fax
call still waiting for its answer tone as the answer. With ECM and
without, and on audio with T.38 off.
Fax through a mobile call's speech codec doesn't train even at 2400
bit/s (CellFaxTest: AMR-NB 12.2, about a bit in sixteen wrong), so the
app turns fax down on the mobile-call line with why.
The interop test receiving without ECM from D-Modem-RE's T.30 at 12000:
at 14400 a page's row of 1-pel runs comes spoilt the same way each time
on a clean line, before our T.30 (D-Modem-RE's DSP; ECM hides it).
sip_fax_line waits for its dmodemd to end; the README's fax section.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
native-test's t30_line: a class 1 modem on a line to dsp/t30.cpp's fax
machine (ECM or not, noise if asked); sip_fax_line: the app's engine
dialling a dmodemd over loopback SIP with T.38, each DTE a pty. The
tests (T30InteropTest, SipFaxTest) drive our T.30 on them, skipped
without the programs; FaxLineProcess and Pbm shared among the fax tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
The engine for a program in C or Swift (dmodem_engine.h): started on SIP
or a peer line, its DTE a socket, the log, status, exit, peer line and
speaker as callbacks; native-test's c_api_test drives it (AT commands, a
dial handing the program its line, BUSY, the end).
ios/build-native.sh builds the engine with D-Modem-RE, libre and Mbed
TLS for iOS (devices, simulator) and macOS into DModemEngine.xcframework;
ios/DModemSmoke's Swift tests run it on macOS through the C API. CI
(apple.yml) does both on a macOS runner; android.yml's native job runs
the engine's tests with Apple's fallbacks on Linux too.
D-Modem-RE to its claude/apple-portability branch (portable.h: Apple's
ways where Linux has its own), on top of the speaker hook.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
The modem dials and answers on the phone's mobile line: Telecom places,
answers and ends the calls, Telephony tells their state, and Android 13's
call audio interception (CALL_AUDIO_INTERCEPTION, a privileged app's) has
their sound, on PeerLine as another transport (CellTransport): the
handshake made for the call, the exchange's tones played until it is
placed, the call's sound then.
On a rooted phone the app makes itself privileged: a Magisk module with
its APK in /system/priv-app and every privileged permission it asks for
allowed (Settings, Line).
Speech codecs decide the speed: native-test's codec_line puts AMR-NB or
GSM between two modems. AMR 12.2 carries V.21 (300 bit/s); V.22 and
V.22bis connect but lose data half the time; nothing faster connects;
GSM and AMR 4.75 carry nothing reliable. So the line starts at V.21
(+MS), with 1200 and 2400 bit/s to try.
Tests: CellTransportTest (the calls placed, answered, given up),
CellLineTest (two modems on mobile calls, clean and through AMR, on the
phones' audio clock), CellSettingsTest; the settings' screenshot.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
As a modem's speaker had the line: on from off hook until CONNECT (ATM1,
the modem's default), all the call with ATM2, never with ATM0, at ATL's
volume; a switch in the settings silences it. The native modem passes
the line's sound (what came, its own at half level) on a socket the
app's player reads, never waiting for it; on SIP calls and on the line
to another phone.
D-Modem-RE to its latest (the V.90/V.92 analogue modem work) with
SipModem::on_speaker() on top (its branch claude/modem-speaker).
Tests: engine_test (SIP: the speaker on until CONNECT, nothing in data
mode, quiet with ATM0), PeerLineTest (the caller's speaker on a call to
another phone), ModemSpeakerTest (the player).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
A line choice beside SIP: another phone running the app, on Wi-Fi (TCP,
found by NSD) or Bluetooth (RFCOMM). The native PeerModem hands the app
its line's samples off hook; PeerLine rings the other phone, carries the
samples both ways as they are and hangs up by closing. The loop runs on
the samples themselves (each side answers every sample, paced to the
sample clock), so nothing is lost and the phones' clocks can't drift:
the modems connect as on a perfect line (V.91, 62666 bit/s).
The calling side plays a dial tone and ringback as an exchange does, so
dialling works with X4 and S7. Busy, no answer and an unreachable phone
give BUSY, NO ANSWER and NO CARRIER.
Tests: peer_host (native-test) runs the engine on a peer line; PeerLineTest
calls between two or three of them over real TCP, through a slow and
uneven link as well. Also a missing alpha in the lights' glow colour.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
The fax machine's side in the app, over the modem's class 1 commands
(T.31): T.4's MH coding of the pages, T.30's procedure (DIS/DCS, the
training and its fallback to lower rates, the pages with MPS/EOP and
their MCF/RTN/RTP, DCN), V.17 to V.27ter as the modem has them.
Tested on D-Modem's own modems back to back (native-test's fax_line,
modem_test paced as a phone line): our sender to our receiver, efax
sending to us and receiving from us, the pages exact.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
- external/d-modem-re: D-Modem-RE as a submodule (claude/android-support:
libdmodem_sip, the modem on a SIP line as a library, cross compiling
with libre on Mbed TLS).
- app/src/main/cpp: libdmodem_jni.so. engine.cpp runs dmd::SipModem in
a thread of its own, its DTE one end of a socket pair whose other end
is the app's; stop() from any thread, start() again after; the log
(the modem's and SIP's) and the call's status to callbacks. jni.cpp
binds it to com.neodesktop.dmodem.NativeModem (log lines made
printable ASCII for NewStringUTF: SIP messages come from the network).
- NativeModem.kt: the Kotlin side of the binding.
- native-test: the engine on the build host against a dmodemd over
loopback SIP. Passes: dialling out (CONNECT 62666, V.91), data both
ways, the status online with its rates, a hangup, stop() and a second
call after start() again, a call coming in (RING, ATA, CONNECT), and
the app closing its end ending the engine.
Built with NDK r29 for arm64-v8a and x86_64 (android-26).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs