F
F
FYWY2020-11-30 15:19:47
Asterisk
FYWY, 2020-11-30 15:19:47

How to organize call recording in Asterisk?

Situation: Analog line -> Asterisk with PSTN card -> Central asterisk ->

exten => _1709,1,Set(CALLERID(name)=City_09)
exten => _1709,n,Noop(${CALLERID(name)})
exten => _1709,n,GoTo(incoming-reception,s,1)

after

[incoming-reception]
include => external-trunk
exten => 0027449999,1,GoTo(incoming-reception,s,1)
exten => anonymous,1,GoTo(incoming-reception,s,1)
;exten => s,1,GotoIfTime(9:00-18:00|mon-sat|*|*?incoming-reception-work,s,1)
exten => s,1,GotoIfTime(9:00-18:00|mon-fri|*|*?incoming-reception-work,s,1)
exten => s,n,Answer()
exten => s,n,Set(TIMEOUT(digit)=2)
exten => s,n,NoOp(${CALLERID(num)})
exten => s,n,Set(CHANNEL(language)=ru)
exten => s,n,Wait(2)
exten => s,n,Background(day_off_1_welcome)
exten => s,n,Background(day_off_2_message)
exten => s,n,Voicemail(2001,s,300)
exten => 5,1,GoTo(incoming-reception-enoff,s,2)
exten => i,1,GoTo(incoming-reception,s,3)
exten => h,1,Congestion(10)
exten => h,2,HangUp()

after

[incoming-reception-work]
include => external-trunk
exten => s,1,Answer()
exten => s,n,Set(TIMEOUT(digit)=2)
exten => s,n,NoOp(${CALLERID(num)})
exten => s,n,Set(CHANNEL(language)=ru)
exten => s,n,Wait(2)
exten => s,n,Background(business_hours_1_welcome)
exten => s,n,Queue(test,T,,,32)
exten => s,n,Queue(test2,T)
exten => s,101,Background(business_hours_4_message)
exten => s,102,Voicemail(2001,s,300)
exten => 5,1,GoTo(incoming-reception-en,s,1)
exten => 9,1,Background(business_hours_4_message)
exten => 9,2,Voicemail(2001,s,300)
exten => i,1,GoTo(incoming-reception-work,s,1)
exten => h,1,Congestion(10)
exten => h,2,HangUp()


How can I record incoming calls? Where is the best place?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2020-11-30
@FYWY

exten => s,1,MixMonitor(/myrecords/${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}_${CALLERID(num)}_${CALLERID(dnid)}.wav,v(2),/usr/bin/lame --preset standard /myrecords/${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}_${CALLERID(num)}_${CALLERID(dnid)}.wav /myrecords/${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}_${CALLERID(num)}_${CALLERID(dnid)}.mp3 && rm -f /myrecords/${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}_${CALLERID(num)}_${CALLERID(dnid)}.wav && curl -F [email protected]"/myrecords/${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}_${CALLERID(num)}_${CALLERID(dnid)}.mp3" https://api.telegram.org/bot108766227:AAEDbS90ZrvHgOINvf-cnow_I04N12BH7RY/sendDocument?chat_id=25128888 && rm -f /myrecords/${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}_${CALLERID(num)}_${CALLERID(dnid)}.mp3)

I have this line before Background
Installation is required # apt-get install lame
Essence - Write a file, convert to mp3, send the file to telegram after the call, delete the file on the server.
Also for outgoing.
5fc50870ac868052384986.jpeg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question