Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(visitors): Notifies for not live call via sip info msg. #554

Merged
merged 1 commit into from
Sep 21, 2024
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
6 changes: 6 additions & 0 deletions src/main/java/org/jitsi/jigasi/AbstractGatewaySession.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,12 @@ public void notifyOnLobbyWaitReview(ChatRoom lobbyRoom)
}
}

/**
* Method called to notify that the conference is not live yet.
*/
public void notifyConferenceNotLive()
{}

/**
* Method called by {@link JvbConference} that it has reached
* the maximum number of occupants and gives a chance to the session to
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/jitsi/jigasi/JvbConference.java
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,8 @@ else if (opex.getErrorCode() == NOT_LIVE_ERROR_CODE)
{
logger.info(this.callContext + " Conference is not live yet.");

gatewaySession.notifyConferenceNotLive();

websocketClient = new WebsocketClient(this, visitorsQueueServiceUrl, this.callContext);
websocketClient.connect();

Expand Down
18 changes: 18 additions & 0 deletions src/main/java/org/jitsi/jigasi/SipGatewaySession.java
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,24 @@ public void notifyOnLobbyWaitReview(ChatRoom lobbyRoom)
}
}

/**
* {@inheritDoc}
*/
@Override
public void notifyConferenceNotLive()
{
super.notifyConferenceNotLive();

try
{
SipGatewaySession.this.sendJson(SipInfoJsonProtocol.createSIPCallNotLive());
}
catch(OperationFailedException ex)
{
logger.error("Cannot send visitor message", ex);
}
}

/**
* {@inheritDoc}
*/
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/org/jitsi/jigasi/sip/SipInfoJsonProtocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public static class MESSAGE_TYPE
public static final int AV_MODERATION_DENIED = 10;
public static final int SIP_CALL_HEARTBEAT = 11;
public static final int SIP_CALL_VISITOR = 12;
public static final int SIP_CALL_NOT_LIVE = 14;
}

private static class MESSAGE_HEADER
Expand Down Expand Up @@ -324,4 +325,19 @@ public static JSONObject createSIPCallVisitors(boolean enabled)

return obj;
}

/**
* Creates new JSONObject for call that is not live.
*
* @return JSONObject representing a message to be sent over SIP.
*/
public static JSONObject createSIPCallNotLive()
{
JSONObject obj = new JSONObject();

obj.put(MESSAGE_HEADER.MESSAGE_TYPE, MESSAGE_TYPE.SIP_CALL_NOT_LIVE);
obj.put(MESSAGE_HEADER.MESSAGE_DATA, true);

return obj;
}
}
Loading