Nick Cobley
2004-Nov-20 11:15 UTC
[Asterisk-Users] Playing announcement when call is answered
Okay, I posted a question earlier asking how to start the monitor command when the call is answered not when it is dialed. I managed to fix the problem myself by using a macro in the Dial string like this: exten => 21060,1,Dial(${Nick},20,M(monitor)) Next problem though! What I need to do is play a legal announcement to the caller when the the call is answered. Now I thought this would be easy, but it seems I am missing something. I simply added the playback line to the same macro that I used for my monitor command. I made sure the call was answered before commencing playback along with having a pause and removed the r option from the dial string so as to not block playback on the line. But when I call in the audio is played on the destination extension but not to the caller. Caller just hears the ring until the macro is complete then conversation commences. My macro I am using is below. [macro-monitor] exten => s,1,Answer exten => s,2,Wait(2) exten => s,3,Playback(legal-announcement) exten => s,4,Monitor(wav49,${UNIQUEID},m) I have tried lots of variations of this, including using Background not Playback. Anyone have any ideas? TIA for any help anyone can offer. Oh yea, I also tried answering the call in the dial string rather than the macro but this had the same effect. I also want to avoid answering the call before the call has been picked up, as this will be an extension of an existing PABX, so we want the call to return to reception if the call goes unanswered. Not sure how I would go abouts doing this if astrisk answers the call? The test system I am doing this on has calls incoming via IAX and terminating on SIP extensions. But the final production system will be using Zaptel hardware for the incoming call and SIP extensions. Cheers Nick