I wrote the below Python program to communicate with my D-Link DWM-156 GSM modem. This program wait for incoming calls and as it receive a RING alert, it accepts that call.
Fortunately it works fine ;)
The Program:
import time
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(0.5)
finally:
phone.close()
Output during running:
>>> ================================ RESTART ================================
>>>
b''
b''
b''
b'\r\n'
b'RING\r\n' #Here, my friend (named "Jimmy",for example), called me.
b'OK\r\n'
b''
b''
b''
b''
b''
As you see above, immediately after receiving an incoming call, the GSM modem accept it and from that point to the end, we have an active call.
My questions:
1- Is it possible to send/receive some data (SMS for example) during this active call? Or at least can I make a noise on the other side of this channel (i.e on the speaker of Jimmy's phone) during this active call? (I don't want to send recognisable sound, a noise is enough. Although having a methodology to send recognisable voice is really better.)
2- Why this program detect incoming calls, but doesn't detect incoming SMSs? Look below. You can see output of my program when Jimmy sent 3 SMSs to my GSM modem (And he received "delivered" notification in his my mobile phone for all of them).
>>> ================================ RESTART ================================
>>>
b''
b''
b''
b''
b''
b''
b''
As you see above, I received nothing, while he sent 3 SMSs! Why?