AutoAttendant based sample gives "File in use' Error

Jul 19, 2013 at 11:42 AM
Sir, Thanks for replying to my previoius post.

We have developed a single port, sample for dialogic card, which answers a call, records a file using FileRecordTerminal, then playsback the recorded file, disconnects the call;
When we call again the same port; the recording code gives error which says the record file is in use; Why? everytime we play and record, we try to create the FilePlayback terminal and record terminal and connect it to the call; after playback or record is over, we unconnect and make the file terminals null;

//when playback
playbackTerminal = activeCall.RequestTerminal(TTerminal.FilePlaybackTerminal,
                        TAPIMEDIATYPES.AUDIO, TERMINAL_DIRECTION.TD_CAPTURE);
            if (playbackTerminal != null)
            {
                playbackTerminal.MediaPlayList = new string[] { PLAY_FILENAME };
                activeCall.SelectTerminalOnCall(playbackTerminal);

            }
//after the playback stops
// Remove the playback terminal
                    activeCall.UnselectTerminalOnCall(playbackTerminal);
                    playbackTerminal.Dispose();
                    playbackTerminal = null;
similar code for recording;

Thanks
Kavivrao