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
20 changes: 20 additions & 0 deletions src/main/java/org/jitsi/jigasi/AbstractGateway.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ public abstract class AbstractGateway<T extends AbstractGatewaySession>
public static final String P_NAME_JVB_INVITE_TIMEOUT
= "org.jitsi.jigasi.JVB_INVITE_TIMEOUT";

/**
* Name of the property used to set default empty call leave timeout.
*/
public static final String P_NAME_DEFAULT_CALL_EMPTY_TIMEOUT
= "org.jitsi.jigasi.DEFAULT_CALL_EMPTY_TIMEOUT";

/**
* Name of the property used to disable advertisement of ICE feature in
* XMPP capabilities list. This allows conference manager to allocate
Expand All @@ -69,6 +75,11 @@ public abstract class AbstractGateway<T extends AbstractGatewaySession>
*/
public static final long DEFAULT_JVB_INVITE_TIMEOUT = 30L * 1000L;

/**
* Default empty call leave timeout.
*/
public static final long DEFAULT_CALL_EMPTY_TIMEOUT = 30L * 1000L;

/**
* A map which matches CallContext to the specific session of a Gateway.
*/
Expand Down Expand Up @@ -234,6 +245,15 @@ public static long getJvbInviteTimeout()
DEFAULT_JVB_INVITE_TIMEOUT);
}

/**
* Returns timeout for waiting for the JVB conference invite from the focus.
*/
public static long getEmptyCallTimeout()
{
return JigasiBundleActivator.getConfigurationService()
.getLong(P_NAME_DEFAULT_CALL_EMPTY_TIMEOUT, DEFAULT_CALL_EMPTY_TIMEOUT);
}

/**
* Sets new timeout for waiting for the JVB conference invite from the
* focus.
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/org/jitsi/jigasi/JvbConference.java
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,11 @@ private ExtensionElement addSupportedFeatures(
"Did not received session invite"
);

private final JvbConferenceStopTimeout emptyTimeout = new JvbConferenceStopTimeout(
"EmptyCallTimeout",
"only bots or empty room",
"only bots or empty room"
);
/**
* The last status we sent in the conference using setPresenceStatus.
*/
Expand Down Expand Up @@ -1397,6 +1402,8 @@ private void memberPresenceChangedInternal(ChatRoomMemberPresenceChangeEvent evt
{
if (ChatRoomMemberPresenceChangeEvent.MEMBER_JOINED.equals(eventType))
{
emptyTimeout.cancel();

gatewaySession.notifyChatRoomMemberJoined(member);
}
else if (ChatRoomMemberPresenceChangeEvent.MEMBER_UPDATED
Expand Down Expand Up @@ -1530,8 +1537,7 @@ private void processChatRoomMemberLeft(ChatRoomMember member)

if (onlyBotsInRoom)
{
logger.info("Leaving room only bots in the room!");
stop();
emptyTimeout.scheduleTimeout(AbstractGateway.getEmptyCallTimeout());
}
}
}
Expand Down