KRYNNA,
> (1) How to differentiate the TermConnCreatedEv, TermConnAvaliableEv, MediaTermConnState.
I'm not sure that I follow what you want to do. Each of those events exists already as part of a case select, so the program already differentiates them.
> (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?
I believe this to be true. Since I have always put the two together, I've never worried about whether the .startPlaying() is required.
> (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?
I believe that is true.
> 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.
No, I believe that the first time that the MediaTermConnStateEv.ID event fires is when you start playing. I don't believe that it fires before then. But you have to remember that these examples are EXTREMELY simple. They do not handle many of the possible asynchronous events that may occur.
> (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??
There is a DTMF digit received event, MediaTermConnDtmfEv that you can trigger on. Turn DTMF detection on with mtc.setDtmfDetction(true) method.
Look at the JVoiceMail sample code that is delivered with JTAPI for examples of how to use it.
pansophic