Recording Busy Tones/Operator Messages with AGI script

Hi All,

If i dial out using something like the following i can record the while call including ringtone, busy tone, operator messages etc:

exten => _9.,1,MixMonitor(/home/recordings/${EXTEN}.wav) exten => _9.,2,Dial(SIP/${EXTEN:1}@provider,90,Tt) exten => _9.,3,hangup

I have an application that uses the Asterisk Manager and AGI scripts and am looking to do the same. The problem is using the manager and AGI scripts i do not hit the extensions.conf. If i put the following at the start of my AGI script it will only record after the call is answered:

Using call files work fine but unfortunately this is not an option for me. Can this be done using AGI scripts and the Asterisk Manager? Any help would be appreciated.

I’m surprised even the first one works, as the call progress tones, on a normal, unanswered, SIP call are generated in the calling phone, and are not present in Asterisk. I can’t think why there would be an implicit answer from the dialplan, but not from AGI.

Thanks for the reply. Is it possible to put and implicit answer in the AGI script? I have tried $AGI->answer(); at the start of my agi script but it does not work.