Menu

getting early MediaTermConnAvailableEv

Help
fred
2006-10-05
2013-04-11
  • fred

    fred - 2006-10-05

    I am trying to diale out and leave a message for my users but I get the MediaTermConnAvailableEv event very soon before the other sides phone even ring.

    I appreciate any help with it.

    Here is the code:
    It start playing the file before the other party's phone even rings.

        class MessageSenderCallObserver implements MediaCallObserver {
            public void callChangedEvent(CallEv[] eventList) {
                for (int i = 0; i < eventList.length; i++) {
                    CallEv ev = eventList[i];
                        TerminalConnection tc = ((TermConnEv) ev).getTerminalConnection();
                        MediaTerminalConnection mtc = (MediaTerminalConnection) tc;

                        switch (ev.getID()) {
                            case TermConnCreatedEv.ID:
                            try {
                                String sExt = ".au";

                                if(useMSTAPI == true)
                                    sExt = ".wav";

                                mtc.usePlayURL(new URL("file:./Greeting" + sExt));
                            } catch (Exception excp) {
                                System.out.println("Exception TermConnCreatedEv: " +
                                                    excp.toString());
                            }
                                break;
                            case MediaTermConnAvailableEv.ID:
                                try {
                                    mtc.startPlaying();
                                } catch (Exception excp) {
                                    System.out.println("Exception startPlaying: " +
                                                excp.toString());
                                }
                                break;

                            case MediaTermConnStateEv.ID:
                                System.out.println("MediaTermConnStateEv");
                                System.out.println("2    "+mtc.getMediaState());
                            try {
                                /* Want to find out when playing is done */
                                int state = mtc.getMediaState();
                                state = state & MediaTerminalConnection.PLAYING;
                                 if (state == 0) {
                //                     hangup();
                //                     exit();
                                  }
                            } catch (Exception excp) {
                                System.out.println("Exception startRecording: " +
                                        excp.toString());
                            }
                                break;
            }
        }
         }

     
    • fred

      fred - 2006-10-05

      Ok, I found my answere in previous questions.
      So forget about it ;)

       
    • bruce

      bruce - 2007-09-19

      Hello,
         Could you tell me what java JDK version since I'm trying to compile, but got compilation error.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.