コード例 #1
0
  @Override
  protected void doAck(SipServletRequest req) throws ServletException, IOException {
    SipSession sipSession = req.getSession();

    MediaSession ms = (MediaSession) sipSession.getAttribute("MEDIA_SESSION");
    try {
      MediaGroup mg = ms.createMediaGroup(MediaGroup.PLAYER_RECORDER_SIGNALDETECTOR);
      mg.addListener(new MyJoinEventListener());

      NetworkConnection nc = (NetworkConnection) sipSession.getAttribute("NETWORK_CONNECTION");
      mg.joinInitiate(Direction.DUPLEX, nc, this);

    } catch (MsControlException e) {
      logger.error(e);
      // Clean up media session
      terminate(sipSession, ms);
    }
  }