I wrote the Python program below to communicate with my D-Link DWM-156 GSM modem . This program waits for incoming calls and when it receives a warning, RING accepts this call.
Fortunately, it works great;)
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()
Exit during operation:
>>> ================================ RESTART ================================ >>> b'' b'' b'' b'\r\n' b'RING\r\n'
As you see above, immediately after receiving an incoming call, the GSM modem receives it and from this point to the end, we have an active call.
My questions:
1 - Is it possible to send or receive some data (for example, SMS) during this active call? Or, at least, can I make 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 a recognizable sound, enough noise. Although the methodology for sending a recognizable voice is really better.)
2 - Why does this program detect incoming calls but not detect incoming SMS? See below. You can see the output of my program when Jimmy sent 3 SMS to my GSM modem (and he received a βdeliveredβ notification in his mobile phone for everyone).
>>> ================================ RESTART ================================ >>> b'' b'' b'' b'' b'' b'' b''
As you see above, I received nothing , and he sent 3 SMS! Why?
Abraham
source share