Open RudyFiero opened 4 years ago
audio_file_name = from_phone + "" + call_date + "" + calltime + "" +
I think there were missing quotes, the following works.
audio_file_name = "from_phone" + "" + call_date + "" + calltime + "" +
i use this for get this format
audio_file_name = from_phone + "_" + str(datetime.strftime(datetime.now(),"%m_%d_%Y_%H_%M_%S")) + ".wav"
PHONE_DATE_TIME.wav xxxxxxxxxxxx_04_03_2020_15_19_33.wav
I am trying to run your example but it fails after it enters a call. I provided the serial output below. I have a Raspberry Pi 3 B and a USR5637 modem.
`pi@BrokerMQTT:~/Music $ python record_audio.py AT+FCLASS=8
OK
Modem COM Port is: /dev/ttyACM0 AT
OK
ATZ3
OK
ATV1
OK
ATE1
OK
AT+VCID=1
OK
RING
DATE=1101
TIME=1401
NAME=O
DDN=2042333251
RING
Traceback (most recent call last): File "record_audio.py", line 494, in
read_data()
File "record_audio.py", line 454, in read_data
audio_file_name = fromphone + "" + calldate + "" + calltime + "" + str(datetime.strftime(datetime.now(),"%S")) + ".wav"
UnboundLocalError: local variable 'from_phone' referenced before assignment
ATH
OK
Serial Port closed... `