How to recognize type of incoming call? (Data call or Voice call)

1.6k Views Asked by At

Consider a situation in which that you installed a GSM modem (DLink DWM-156 in my case) to your computer. Then you wrote the following Python program to accept all the incoming calls:

import serial

phone = serial.Serial("COM10",  115200, timeout=5)

try:
    time.sleep(1)
    while(1):
        x = phone.readline()
        print(x)
        if (x == b'RING\r\n'):
            phone.write(b'ATA\r')
            time.sleep(2)

finally:
    phone.close()

Now, the question is :

  1. Is there any way to detect if the incoming call is a voice call or data call?
  2. Can a dial-up modem initiate a data call also, or it can make voice calls only?
2

There are 2 best solutions below

5
Christopher Janzon On

You can have a look here regarding Voice modem commands.

What I believe is that if you receive AT+VTX then respond with CONNECT and the data from that point will be wave audio data.

It should also work the other way around to initiate a voice call.

0
Mick On

The modem you have is a 3G (HSDPA) data modem - it is intended to set up a data connection to the operators PS network (packet switched network).

3G core networks have two major parts, circuit switched for voice and packet switched for data.

Things get muddied a bit as you can make a modem call over the CS voice network (data is converted into 'tones' over the voice channel, as a very high level explanation), and you can make a VoIP call over the PS data network.

For the former case, most times you would not want to do this as you will get far higher speed over the PS network. For the latter case, your operator may block (or try to block...) VoIP traffic, although many do not now as voice minutes are cheap on many plans now anyway, so this is not such a threat to them anymore.

Although the modem you have is probably not set up to send and receive voice calls, there are instructions for some 3G dongles to update them to allow this, for example this video explain how to do so for a Huawei dongle: https://www.youtube.com/watch?v=mRF2cCFehRQ. Your modem does appear to support an easy set up to redirect calls or apply a busy tone etc from a quick look at the manual, but this is not what you want I think.