Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public abstract class AbstractBridgeEvent extends ManagerEvent {
private String bridgeName;
private String bridgeTechnology;
private String accountCode;
private String bridgevideosourcemode;
private String bridgeVideoSource;
private String bridgeVideoSourceMode;

AbstractBridgeEvent(Object source) {
super(source);
Expand Down Expand Up @@ -77,11 +78,19 @@ public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}

public String getBridgeVideoSource() {
return bridgeVideoSource;
}

public void setBridgeVideoSource(String bridgeVideoSource) {
this.bridgeVideoSource = bridgeVideoSource;
}

public String getBridgevideosourcemode() {
return bridgevideosourcemode;
return bridgeVideoSourceMode;
}

public void setBridgevideosourcemode(String bridgevideosourcemode) {
this.bridgevideosourcemode = bridgevideosourcemode;
public void setBridgevideosourcemode(String bridgeVideoSourceMode) {
this.bridgeVideoSourceMode = bridgeVideoSourceMode;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2023 Hector Espert
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.asteriskjava.manager.event;

/**
* Raised when the channel that is the source of video in a bridge changes.
*/
public class BridgeVideoSourceUpdateEvent extends AbstractBridgeEvent {
private String bridgePreviousVideoSource;

public BridgeVideoSourceUpdateEvent(Object source) {
super(source);
}

/**
* Gets the unique ID of the channel that was the video source.
*
* @return the unique ID of the channel that was the video source.
*/
public String getBridgePreviousVideoSource() {
return bridgePreviousVideoSource;
}

public void setBridgePreviousVideoSource(String bridgePreviousVideoSource) {
this.bridgePreviousVideoSource = bridgePreviousVideoSource;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright 2023 Hector Espert
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.asteriskjava.manager.event;

import org.junit.jupiter.api.Test;

import java.util.HashMap;
import java.util.HashSet;

import static org.assertj.core.api.Assertions.assertThat;
import static org.asteriskjava.manager.util.EventAttributesHelper.setAttributes;

class BridgeVideoSourceUpdateEventTest {

@Test
void shouldCreateEvent() {
BridgeVideoSourceUpdateEvent bridgeVideoSourceUpdateEvent = new BridgeVideoSourceUpdateEvent(new Object());

HashMap<String, Object> attributes = new HashMap<>();
attributes.put("bridgeuniqueid", "85f11e74-b0d9-4354-bc91-80782ee7a6a7");
attributes.put("bridgepreviousvideosource", "e39cdee4-61a1-49b5-9656-96cef742806f");
setAttributes(bridgeVideoSourceUpdateEvent, attributes, new HashSet<>());

assertThat(bridgeVideoSourceUpdateEvent.getBridgeUniqueId())
.isEqualTo("85f11e74-b0d9-4354-bc91-80782ee7a6a7");
assertThat(bridgeVideoSourceUpdateEvent.getBridgePreviousVideoSource())
.isEqualTo("e39cdee4-61a1-49b5-9656-96cef742806f");
}

}
Loading