MediaGroup g2 = session.createMediaGroup(MediaGroup.PLAYER_RECORDER_SIGNALDETECTOR); c1.getSdpPortManager().addListener(new MediaEventListener<SdpPortManagerEvent>() { public void onEvent(SdpPortManagerEvent event) { if (event.getEventType() == SdpPortManagerEvent.OFFER_GENERATED) { c2.getSdpPortManager().addListener(new MediaEventListener<SdpPortManagerEvent>() { public void onEvent(SdpPortManagerEvent event) { if (event.getEventType() == SdpPortManagerEvent.ANSWER_PROCESSED) { c1.join(Direction.DUPLEX, g1); c1.getSdpPortManager().generateSdpOffer(); c2.join(Direction.DUPLEX, g2);
public void release() { for (MediaMixer mixer : mixers) { mixer.release(); } for (MediaGroup group : groups) { group.release(); } for (NetworkConnection connection : connections) { connection.release(); } factory.removeSession(this); }
private void finishMediaSessionSetup( ActivityContextInterface networkConnectionAci) throws MsControlException { NetworkConnection connection = (NetworkConnection) networkConnectionAci .getActivity(); MediaSession session = connection.getMediaSession(); MediaGroup mediaGroup = session .createMediaGroup(MediaGroup.PLAYER_RECORDER_SIGNALDETECTOR); connection.joinInitiate(Direction.DUPLEX, mediaGroup, "context"); ActivityContextInterface mediaGroupACI = mscRaAciFactory .getActivityContextInterface(mediaGroup); mediaGroupACI.attach(sbbContext.getSbbLocalObject()); setMediaGroupACI(mediaGroupACI); }
private void onLeave(Leave message, ActorRef self, ActorRef sender) throws Exception { if (is(active) && (this.mediaMixer != null)) { try { // Leave conference or bridge this.networkConnection.unjoin(this.mediaMixer); this.mediaMixer = null; this.bridge = null; // Restore link with Media Group this.networkConnection.join(Direction.DUPLEX, this.mediaGroup); // Warn call the operation is complete call.tell(new Left(), self); } catch (MsControlException e) { logger.error(e, "Call could not leave Bridge. Failing..."); fsm.transition(e, failed); } } }
@Override public void execute(Object message) throws Exception { try { networkConnection.getSdpPortManager().addListener(sdpListener); networkConnection.getSdpPortManager().processSdpAnswer(remoteSdp.getBytes()); } catch (MsControlException e) { fsm.transition(e, failed); } }
networkConnection.setParameters(sdpParameters); networkConnection.getSdpPortManager().setCodecPolicy(codecPolicy); networkConnection.getSdpPortManager().addListener(sdpListener); if (callOutbound) { networkConnection.getSdpPortManager().generateSdpOffer(); } else { networkConnection.getSdpPortManager().processSdpOffer(remoteSdp.getBytes());
private void onUnmute(Unmute message, ActorRef self, ActorRef sender) throws Exception { if (is(active) && (this.mediaMixer != null)) { try { this.networkConnection.join(Direction.DUPLEX, this.mediaMixer); } catch (MsControlException e) { logger.error("Could not unmute call: " + e.getMessage(), e); } } }
public void onEvent(SdpPortManagerEvent event) { if (event.getEventType() == SdpPortManagerEvent.OFFER_GENERATED) { try { c2.getSdpPortManager().processSdpOffer(event.getMediaServerSdp()); } catch (MsControlException e){ e.printStackTrace(); } } else { System.out.println("BAD!BAD!BAD!"); } } });
private void onMute(Mute message, ActorRef self, ActorRef sender) { if (is(active) && (this.mediaMixer != null)) { try { this.networkConnection.join(Direction.RECV, this.mediaMixer); } catch (MsControlException e) { logger.error("Could not mute call: " + e.getMessage(), e); } } }
MediaGroup g2 = session.createMediaGroup(MediaGroup.PLAYER_RECORDER_SIGNALDETECTOR); c1.getSdpPortManager().addListener(new MediaEventListener<SdpPortManagerEvent>() { public void onEvent(SdpPortManagerEvent event) { if (event.getEventType() == SdpPortManagerEvent.OFFER_GENERATED) { c2.getSdpPortManager().addListener(new MediaEventListener<SdpPortManagerEvent>() { public void onEvent(SdpPortManagerEvent event) { if (event.getEventType() == SdpPortManagerEvent.ANSWER_PROCESSED) { c1.join(Direction.DUPLEX, g1); c1.getSdpPortManager().generateSdpOffer(); c2.join(Direction.DUPLEX, g2);
public void onEvent(SdpPortManagerEvent event) { if (event.getEventType() == SdpPortManagerEvent.ANSWER_PROCESSED) { try { c1.getSdpPortManager().processSdpAnswer(event.getMediaServerSdp()); } catch (MsControlException e){ e.printStackTrace(); } } else { System.out.println("BAD!BAD!BAD!"); } } });
public void release() { for (MediaMixer mixer : mixers) { mixer.release(); } for (MediaGroup group : groups) { group.release(); } for (NetworkConnection connection : connections) { connection.release(); } factory.removeSession(this); }
private void onJoinBridge(JoinBridge message, ActorRef self, ActorRef sender) throws Exception { if (is(active)) { try { // join call leg to bridge this.bridge = sender; this.mediaMixer = (MediaMixer) message.getEndpoint(); this.networkConnection.join(Direction.DUPLEX, mediaMixer); // alert call has joined successfully this.call.tell(new JoinComplete(), self); } catch (MsControlException e) { logger.error("Call bridging failed: " + e.getMessage()); fsm.transition(e, failed); } } }
private void finishMediaSessionSetup( ActivityContextInterface networkConnectionAci) throws MsControlException { NetworkConnection connection = (NetworkConnection) networkConnectionAci .getActivity(); MediaSession session = connection.getMediaSession(); MediaGroup mediaGroup = session .createMediaGroup(MediaGroup.PLAYER_RECORDER_SIGNALDETECTOR); connection.joinInitiate(Direction.DUPLEX, mediaGroup, "context"); ActivityContextInterface mediaGroupACI = mscRaAciFactory .getActivityContextInterface(mediaGroup); mediaGroupACI.attach(sbbContext.getSbbLocalObject()); setMediaGroupACI(mediaGroupACI); }
if (event.isSuccessful()) { if (is(initializing) || is(updatingMediaSession)) { networkConnection.getSdpPortManager().removeListener(this); if (SdpPortManagerEvent.ANSWER_GENERATED.equals(eventType)) { if (is(initializing)) { networkConnection.join(Direction.DUPLEX, mediaGroup); networkConnection.join(Direction.DUPLEX, mediaGroup);
public void onEvent(SdpPortManagerEvent event) { if (event.getEventType() == SdpPortManagerEvent.ANSWER_PROCESSED) { try { c1.getSdpPortManager().processSdpAnswer(event.getMediaServerSdp()); } catch (MsControlException e){ e.printStackTrace(); } } else { System.out.println("BAD!BAD!BAD!"); } } });
.getActivity(); if (networkConnection != null) { networkConnection.release();
private void onJoinConference(JoinConference message, ActorRef self, ActorRef sender) throws Exception { if (is(active)) { try { // join call leg to bridge // overlay configuration MediaAttributes ma = message.mediaAttributes(); if (!StringUtils.isEmpty(ma.getVideoOverlay())) { mediaSession.setAttribute("CAPTION", ma.getVideoOverlay()); } this.bridge = sender; this.mediaMixer = (MediaMixer) message.getEndpoint(); this.networkConnection.join(Direction.DUPLEX, mediaMixer); // alert call has joined successfully this.call.tell(new JoinComplete(), self); } catch (MsControlException e) { logger.error("Call bridging failed: " + e.getMessage()); fsm.transition(e, failed); } } }
.createNetworkConnection(NetworkConnection.BASIC); SdpPortManager sdpManag = conn.getSdpPortManager(); sipServletRequest.send(); mg.getSignalDetector().addListener(new DTMFListener(mg, sipServletRequest.getSession(), MMSUtil.audioFilePath)); conn.join(Direction.DUPLEX, mg); } catch (UnsupportedOperationException uoe) { log.error("An unexpected exception occurred while trying to create the request for shipping call", uoe);
public void onEvent(SdpPortManagerEvent event) { if (event.getEventType() == SdpPortManagerEvent.OFFER_GENERATED) { try { c2.getSdpPortManager().processSdpOffer(event.getMediaServerSdp()); } catch (MsControlException e){ e.printStackTrace(); } } else { System.out.println("BAD!BAD!BAD!"); } } });