pradeesi / record_audio_from_phone_line

This python script will record an audio message from a phone line.
13 stars 5 forks source link

Error when receiving call #1

Open RudyFiero opened 4 years ago

RudyFiero commented 4 years ago

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... `

RudyFiero commented 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 + "" +

kalashnikov2 commented 4 years ago

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