As I mentioned in previous email, I found out that setting up a silent-call from osmo-msc makes osmo-bts produce an RTP stream, which is not surprising given that we activate a TCH channel as if it was a usual MT call. Once a silent call is established, one can "attach" to the RTP stream using gapk [1]:
$ osmo-gapk \ --input-rtp 127.0.1.1/4000 \ --input-format={gsm,rtp-efr,rtp-amr,rtp-hr-ietf} \ --output-alsa=default --output-format=rawpcm-s16le
This command will play the Uplink RTP stream via ALSA. I believe it should also be possible to loop the Uplink frames back via Downlink if you know the right RTP address/port for that:
$ osmo-gapk \ --input-rtp $UL_RTP_ADDR/$UL_RTP_PORT \ --input-format={gsm,rtp-efr,rtp-amr,rtp-hr-ietf} \ --output-rtp $DL_RTP_ADDR/$DL_RTP_PORT \ --output-format={gsm,rtp-efr,rtp-amr,rtp-hr-ietf}
This approach has a few benefits:
* you can choose a specific codec: HR, FR, EFR, AMR; * you can play the RTP streams on the host side.
... and a big spoon of tar: none of the real phones I tested so far turn on the microphone during a silent-call. This would have been a big security problem if they did so: nobody wants their phone to be turned into a spy microphone. But I won't be surprised if some phones do ;)
The mobile app (from osmocom-bb.git) currently does enable the microphone even without the usual MT call establishment signalling (MT SETUP in this case). This is acceptable for now, as I doubt anybody is using this app as a real phone for normal every day calls.
If anyone likes this approach, I could implement a 'test-call' command which would be like a silent call, but sending an MT SETUP message with a random calling MSISDN. This way it would work for real phones too.
[1] https://gitea.osmocom.org/osmocom/gapk/
Best regards, Vadim.