Search in sources :

Example 1 with VoiceStartRecordingEvent

use of org.bigbluebutton.freeswitch.voice.events.VoiceStartRecordingEvent in project bigbluebutton by bigbluebutton.

the class FreeswitchConferenceEventListener method sendMessageToBigBlueButton.

private void sendMessageToBigBlueButton(final VoiceConferenceEvent event) {
    Runnable task = new Runnable() {

        public void run() {
            if (event instanceof VoiceUserJoinedEvent) {
                System.out.println("************** FreeswitchConferenceEventListener received voiceUserJoined ");
                VoiceUserJoinedEvent evt = (VoiceUserJoinedEvent) event;
                vcs.userJoinedVoiceConf(evt.getRoom(), evt.getVoiceUserId(), evt.getUserId(), evt.getCallerIdName(), evt.getCallerIdNum(), evt.getMuted(), evt.getSpeaking(), evt.getAvatarURL());
            } else if (event instanceof VoiceUserLeftEvent) {
                System.out.println("************** FreeswitchConferenceEventListener received VoiceUserLeftEvent ");
                VoiceUserLeftEvent evt = (VoiceUserLeftEvent) event;
                vcs.userLeftVoiceConf(evt.getRoom(), evt.getUserId());
            } else if (event instanceof VoiceUserMutedEvent) {
                System.out.println("************** FreeswitchConferenceEventListener VoiceUserMutedEvent ");
                VoiceUserMutedEvent evt = (VoiceUserMutedEvent) event;
                vcs.userMutedInVoiceConf(evt.getRoom(), evt.getUserId(), evt.isMuted());
            } else if (event instanceof VoiceUserTalkingEvent) {
                System.out.println("************** FreeswitchConferenceEventListener VoiceUserTalkingEvent ");
                VoiceUserTalkingEvent evt = (VoiceUserTalkingEvent) event;
                vcs.userTalkingInVoiceConf(evt.getRoom(), evt.getUserId(), evt.isTalking());
            } else if (event instanceof VoiceStartRecordingEvent) {
                VoiceStartRecordingEvent evt = (VoiceStartRecordingEvent) event;
                System.out.println("************** FreeswitchConferenceEventListener VoiceStartRecordingEvent recording=[" + evt.startRecord() + "]");
                vcs.voiceConfRecordingStarted(evt.getRoom(), evt.getRecordingFilename(), evt.startRecord(), evt.getTimestamp());
            } else if (event instanceof DeskShareStartedEvent) {
                DeskShareStartedEvent evt = (DeskShareStartedEvent) event;
                System.out.println("************** FreeswitchConferenceEventListener DeskShareStartedEvent");
                vcs.deskShareStarted(evt.getRoom(), evt.getCallerIdNum(), evt.getCallerIdName());
            } else if (event instanceof DeskShareEndedEvent) {
                DeskShareEndedEvent evt = (DeskShareEndedEvent) event;
                System.out.println("************** FreeswitchConferenceEventListener DeskShareEndedEvent");
                vcs.deskShareEnded(evt.getRoom(), evt.getCallerIdNum(), evt.getCallerIdName());
            } else if (event instanceof DeskShareRTMPBroadcastEvent) {
                if (((DeskShareRTMPBroadcastEvent) event).getBroadcast()) {
                    DeskShareRTMPBroadcastEvent evt = (DeskShareRTMPBroadcastEvent) event;
                    System.out.println("************** FreeswitchConferenceEventListener DeskShareRTMPBroadcastStartedEvent");
                    vcs.deskShareRTMPBroadcastStarted(evt.getRoom(), evt.getBroadcastingStreamUrl(), evt.getVideoWidth(), evt.getVideoHeight(), evt.getTimestamp());
                } else {
                    DeskShareRTMPBroadcastEvent evt = (DeskShareRTMPBroadcastEvent) event;
                    System.out.println("************** FreeswitchConferenceEventListener DeskShareRTMPBroadcastStoppedEvent");
                    vcs.deskShareRTMPBroadcastStopped(evt.getRoom(), evt.getBroadcastingStreamUrl(), evt.getVideoWidth(), evt.getVideoHeight(), evt.getTimestamp());
                }
            }
        }
    };
    runExec.execute(task);
}
Also used : VoiceUserTalkingEvent(org.bigbluebutton.freeswitch.voice.events.VoiceUserTalkingEvent) DeskShareEndedEvent(org.bigbluebutton.freeswitch.voice.events.DeskShareEndedEvent) DeskShareRTMPBroadcastEvent(org.bigbluebutton.freeswitch.voice.events.DeskShareRTMPBroadcastEvent) VoiceStartRecordingEvent(org.bigbluebutton.freeswitch.voice.events.VoiceStartRecordingEvent) DeskShareStartedEvent(org.bigbluebutton.freeswitch.voice.events.DeskShareStartedEvent) VoiceUserLeftEvent(org.bigbluebutton.freeswitch.voice.events.VoiceUserLeftEvent) VoiceUserMutedEvent(org.bigbluebutton.freeswitch.voice.events.VoiceUserMutedEvent) VoiceUserJoinedEvent(org.bigbluebutton.freeswitch.voice.events.VoiceUserJoinedEvent)

Example 2 with VoiceStartRecordingEvent

use of org.bigbluebutton.freeswitch.voice.events.VoiceStartRecordingEvent in project bigbluebutton by bigbluebutton.

the class ESLEventListener method conferenceEventRecord.

//@Override
public void conferenceEventRecord(String uniqueId, String confName, int confSize, EslEvent event) {
    String action = event.getEventHeaders().get("Action");
    if (action == null) {
        return;
    }
    if (action.equals(START_RECORDING_EVENT)) {
        if (confName.endsWith(DESKSHARE_CONFERENCE_NAME_SUFFIX)) {
            if (isRTMPStream(event)) {
                DeskShareRTMPBroadcastEvent rtmp = new DeskShareRTMPBroadcastEvent(confName, true);
                rtmp.setBroadcastingStreamUrl(getStreamUrl(event));
                rtmp.setVideoHeight(Integer.parseInt(getBroadcastParameter(event, "vh")));
                rtmp.setVideoWidth(Integer.parseInt(getBroadcastParameter(event, "vw")));
                rtmp.setTimestamp(genTimestamp().toString());
                System.out.println("DeskShare conference broadcast started. url=[" + getStreamUrl(event) + "], conf=[" + confName + "]");
                conferenceEventListener.handleConferenceEvent(rtmp);
            }
        } else {
            VoiceStartRecordingEvent sre = new VoiceStartRecordingEvent(confName, true);
            sre.setRecordingFilename(getRecordFilenameFromEvent(event));
            sre.setTimestamp(genTimestamp().toString());
            System.out.println("Voice conference recording started. file=[" + getRecordFilenameFromEvent(event) + "], conf=[" + confName + "]");
            conferenceEventListener.handleConferenceEvent(sre);
        }
    } else if (action.equals(STOP_RECORDING_EVENT)) {
        if (confName.endsWith(DESKSHARE_CONFERENCE_NAME_SUFFIX)) {
            if (isRTMPStream(event)) {
                DeskShareRTMPBroadcastEvent rtmp = new DeskShareRTMPBroadcastEvent(confName, false);
                rtmp.setBroadcastingStreamUrl(getStreamUrl(event));
                rtmp.setVideoHeight(Integer.parseInt(getBroadcastParameter(event, "vh")));
                rtmp.setVideoWidth(Integer.parseInt(getBroadcastParameter(event, "vw")));
                rtmp.setTimestamp(genTimestamp().toString());
                System.out.println("DeskShare conference broadcast stopped. url=[" + getStreamUrl(event) + "], conf=[" + confName + "]");
                conferenceEventListener.handleConferenceEvent(rtmp);
            }
        } else {
            VoiceStartRecordingEvent sre = new VoiceStartRecordingEvent(confName, false);
            sre.setRecordingFilename(getRecordFilenameFromEvent(event));
            sre.setTimestamp(genTimestamp().toString());
            System.out.println("Voice conference recording stopped. file=[" + getRecordFilenameFromEvent(event) + "], conf=[" + confName + "]");
            conferenceEventListener.handleConferenceEvent(sre);
        }
    } else {
        System.out.println("Processing UNKNOWN conference Action " + action + "]");
    }
}
Also used : DeskShareRTMPBroadcastEvent(org.bigbluebutton.freeswitch.voice.events.DeskShareRTMPBroadcastEvent) VoiceStartRecordingEvent(org.bigbluebutton.freeswitch.voice.events.VoiceStartRecordingEvent)

Aggregations

DeskShareRTMPBroadcastEvent (org.bigbluebutton.freeswitch.voice.events.DeskShareRTMPBroadcastEvent)2 VoiceStartRecordingEvent (org.bigbluebutton.freeswitch.voice.events.VoiceStartRecordingEvent)2 DeskShareEndedEvent (org.bigbluebutton.freeswitch.voice.events.DeskShareEndedEvent)1 DeskShareStartedEvent (org.bigbluebutton.freeswitch.voice.events.DeskShareStartedEvent)1 VoiceUserJoinedEvent (org.bigbluebutton.freeswitch.voice.events.VoiceUserJoinedEvent)1 VoiceUserLeftEvent (org.bigbluebutton.freeswitch.voice.events.VoiceUserLeftEvent)1 VoiceUserMutedEvent (org.bigbluebutton.freeswitch.voice.events.VoiceUserMutedEvent)1 VoiceUserTalkingEvent (org.bigbluebutton.freeswitch.voice.events.VoiceUserTalkingEvent)1