0
votes

I want to record incoming calls in asterisk

  • i used Record() for recording calls, it works fine but it needs maxduration parameter to set record time limit. if i do not specify maxduration it goes to unlimited recording mode.

  • upto this is ok, my problem is that i want to stop and save recorded file when caller cuts the call from his site. in my case it took some time to complete process when caller cuts the call. i dont want to wait for that time.

    [incoming-call]

    exten => s,1,Answer

    exten => s,n,Record(filename.wav,0,0,qxk)

    exten => s,n,Hangup

1

1 Answers

0
votes

Use mixmonitor, after that use wait(100000) or some other forever loop.

https://wiki.asterisk.org/wiki/display/AST/Application_MixMonitor

Or use h-extension(execute on hangup), but be care, you can hangs your asterisk forever.

http://www.voip-info.org/wiki/view/Asterisk+h+extension

Since you have c++ tag, also you have option create new application with needed behavour using c/c++. See asterisk source code for record/mixmonitor.