6

I have a Huawei E160E and a Huawei K3765 "GSM"-modem.

The question is: How to send and receive audio data placing or receiving phone/ voice calls with those modems?

Both seem to support voice calls, according to specifications (E160E, K3765) and according to AT-commands:

Issuing

AT^CVOICE?

results in

^CVOICE:0,8000,16,20

OK

(both modems the same).

Both modems provide 3 USB ports, I will call them /dev/ttyUSB0, /dev/ttyUSB1, /dev/ttyUSB2 (assuming there is no other USB serial device present in the system). The K3765 additionally registers an cdc_etherethernet device. I am using Linux.

On both /dev/ttyUSB0 and /dev/ttyUSB2 I can place AT-commands and receive their answers; additionally, /dev/ttyUSB2 reports status messages (like ^RSSI:23, ^BOOT:38021325,0,0,0,77, ^SIMST:1 or ^SRVST:2). The K3765 also reports by default when there is someone calling (RING), the E160E does not.

On both modems, I can place calls with ATD<number>; and I can pick up calls with ATA.

/dev/ttyUSB1 seems to do nothing; simply writing to this file will get no data into it, reading from it gets no data out.

How is it possible to get audio data in and out of the modem(s)?

I already found this stackexchange question and the answer by Sai Chaitanya as well as the comment to use ffmpeg/ffplay. ffplay just stalls for me, and with the code snipped I can not make too much to try it out (not a programmer, and expecially not in C, though; and don't know if this applies to my modem(s) at all).

In the internet I do not find information on how to actually get audio in and out of those devices, other than using big software packages (asterisk, for example) -- which I do not want, the question is on how to get it to work the basic way.

So, how does audio communication work with (those) Huawei GSM modems?

Modem information: Output of ATI-command:

E160E:

Manufacturer: huawei
Model: E160X
Revision: 11.609.10.02.432
IMEI: 354765038021325
+GCAP: +CGSM,+DS,+ES

OK

K3765:

Manufacturer: huawei
Model: K3765
Revision: 11.126.03.06.00
IMEI: 353142047899771
+GCAP: +CGSM,+DS,+ES

OK
4

After placing or receiving a call, audio output on the serial device needs to be enabled (each time for each call) by issuing

AT^DDSETEX=<number>

(for my devices, only AT^DDSETEX=2 is supported, which directs audio to and from the second serial interface, i.e. /dev/ttyUSB1).

Then, reading from /dev/ttyUSB1 gives some data, and writing stuff to /dev/ttyUSB1 gives some noice on the phone at the other end.

Now, finding out how to correctly read and write audio data such that the correct things can be heard, and not just noise, is left as a tecnical exercise ;-).

Thanks to http://lists.ofono.org/pipermail/ofono/2012-March/012551.html, where I got the idea to try this out.

| improve this answer | |
  • .. whereas the encoding part is not that easy. While many guides suggest aplay -f s16_le -r 8000 or aplay -f s16_be -r 8000 on the output of /dev/ttyUSB1 (and similarly arecord for the input), I just get noise, also with many other settings to aplay or ffmpeg/ffplay. AT^CVOICE? gives 0,8000,16,20. – Golar Ramblar Apr 22 '18 at 8:35
  • How to save/record audio to file and send another content from an input file? – auino Jun 11 at 9:52
  • @auino: aplay --help: Usage: aplay [OPTION]... [FILE].... Similar for arecord. Thee the help for aplay and arecord. – Golar Ramblar Jun 14 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.