コード例 #1
0
  public void connectionOpenResponse(MsConnectionEvent event, SipServletResponse response) {
    logger.info("connection opened " + event);

    String sdp = event.getConnection().getLocalDescriptor();
    SipServletRequest ack = response.createAck();

    try {
      ack.setContent(sdp, "application/sdp");
      ack.send();
    } catch (Exception e) {
      logger.error(e);
    }
    provider = ConferenceCenter.getInstance().getProvider();
    MsConnection connection = event.getConnection();
    MsEndpoint endpoint = connection.getEndpoint();
    MsSession session = connection.getSession();
    String callerName = response.getTo().getURI().toString();

    ConferenceParticipant participant =
        new EndpointConferenceParticipant(callerName, endpoint, session, response, connection);

    String key = SipGwtConferenceConsole.CONFERENCE_NAME;

    ConferenceCenter.getInstance().getConference(key).joinParticipant(participant);
  }
コード例 #2
0
  public void connectionOpenRequest(MsConnectionEvent event, SipServletRequest inviteRequest) {
    logger.info("connection opened " + event);

    String sdp = event.getConnection().getLocalDescriptor();
    SipServletResponse sipServletResponse = inviteRequest.createResponse(SipServletResponse.SC_OK);

    try {
      sipServletResponse.setContent(sdp, "application/sdp");
      sipServletResponse.send();
    } catch (Exception e) {
      logger.error(e);
    }
    provider = ConferenceCenter.getInstance().getProvider();
    MsConnection connection = event.getConnection();
    MsEndpoint endpoint = connection.getEndpoint();
    MsSession session = connection.getSession();
    String callerName = inviteRequest.getFrom().getURI().toString();

    ConferenceParticipant participant =
        new EndpointConferenceParticipant(callerName, endpoint, session, inviteRequest, connection);

    String key = ((SipURI) inviteRequest.getTo().getURI()).getUser();

    ConferenceCenter.getInstance().getConference(key).joinParticipant(participant);
  }