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 :
- Is there any way to detect if the incoming call is a voice call or data call?
- Can a dial-up modem initiate a data call also, or it can make voice calls only?
You can have a look here regarding Voice modem commands.
What I believe is that if you receive
AT+VTXthen respond withCONNECTand the data from that point will be wave audio data.It should also work the other way around to initiate a voice call.