/**
  * Fired when a call ends
  *
  * @param evt CallEvent
  */
 public void callEnded(CallEvent evt) {
   AudioMediaSession audioMediaSession = evt.getSourceCall().getAudioMediaSession();
   if (audioMediaSession != null) {
     audioMediaSession.close();
   }
   VideoMediaSession videoMediaSession = evt.getSourceCall().getVideoMediaSession();
   if (videoMediaSession != null) {
     videoMediaSession.stopTrasmit();
     videoMediaSession.stopReceive();
   }
 }
Beispiel #2
0
  /**
   * Implements CallListener.incomingCallReceived. When a call is received creates a call panel and
   * adds it to the main tabbed pane and plays the ring phone sound to the user.
   */
  public void incomingCallReceived(CallEvent event) {
    Call sourceCall = event.getSourceCall();

    CallPanel callPanel = new CallPanel(this, sourceCall, GuiCallParticipantRecord.INCOMING_CALL);

    mainFrame.addCallPanel(callPanel);

    if (mainFrame.getState() == JFrame.ICONIFIED) mainFrame.setState(JFrame.NORMAL);

    if (!mainFrame.isVisible()) mainFrame.setVisible(true);

    mainFrame.toFront();

    this.callButton.setEnabled(true);
    this.hangupButton.setEnabled(true);

    NotificationManager.fireNotification(
        NotificationManager.INCOMING_CALL,
        null,
        "Incoming call recived from: " + sourceCall.getCallParticipants().next());

    activeCalls.put(sourceCall, callPanel);

    this.setCallPanelVisible(true);
  }
 /**
  * Fired when a call is received
  *
  * @param evt CallEvent
  */
 public void callReceived(CallEvent evt) {
   try {
     Call call = evt.getSourceCall();
     Interlocutor interlocutor = new Interlocutor();
     interlocutor.setCall(call);
     guiManager.addInterlocutor(interlocutor);
     call.addStateChangeListener(this);
     // handleAnswerRequest(interlocutor);
   } catch (Exception e) {
     Log.error("callReceived", e);
   }
 }
Beispiel #4
0
  /**
   * Implements CallListener.callEnded. Stops sounds that are playing at the moment if there're any.
   * Removes the call panel and disables the hangup button.
   */
  public void callEnded(CallEvent event) {
    Call sourceCall = event.getSourceCall();

    NotificationManager.stopSound(NotificationManager.BUSY_CALL);
    NotificationManager.stopSound(NotificationManager.INCOMING_CALL);
    NotificationManager.stopSound(NotificationManager.OUTGOING_CALL);

    if (activeCalls.get(sourceCall) != null) {
      CallPanel callPanel = (CallPanel) activeCalls.get(sourceCall);

      this.removeCallPanelWait(callPanel);
    }
  }