Hi pansophic,
It's me again, I would likt to ask a conceptual problem, and wish you can teach me.
When I spend more time to study the JAnswerinMachine. I found 1 method recordTimeout and 1 event Media TermConnStateEv
I know that the recordTimeout is goind to terminate a call if the recording time is too long. And the TermConnStateEv is the event that the Term is being connected (after created but before hangup/unavaliable).
Inside the TermConnStateEv, it firstly detect is the call is in a playing status, if it is, nothing to do; but, however, if the call is in recording status, the 10sec timeout control will be activate. the timeout is control by the PLAYING and RECORDING status with the Thread.sleep()
And now here is the problem.
(1) How to differentiate the TermConnCreatedEv, TermConnAvaliableEv, MediaTermConnState.
(2) Also, usePlayURL seems to be will not play the URL until .startPlaying() method being involved, same as useRecordURL, it will started to record until .startRecordin() method being invloved, am I correct?
(3) Finally, the code of MediaTermConnStateEv seems to check it is in playing,
if yes, nothing to do,
if no, check "is it in recoding"
if yes, nothing to do
if no, start recording, then following,
check timeout.
am I correct?
If my unstanding is correct, will it start the recording before playing, since this event just check is it playing or recording, before the startPlaying() method, the connection also is in no playing and no recording status.
(4) if I would like to add my DTMF after the play wav (for sure my plan will no play 1 wav and detect 1 DMTF signal), where should I put my code? MediaTermConnAvailableEv??
Thanks again.