Joins a conference room with the provided options and performs validation checks.

Contains:

  • socket: Socket instance for communication.

  • roomName: Name of the room to join.

  • islevel: User level within the room.

  • member: Member identifier.

  • sec: Security token.

  • apiUserName: API username for authentication.

  • Validation:

    • Checks that roomName, apiUserName, and member are alphanumeric.
    • Ensures roomName starts with 's' or 'p' and meets length requirements.
    • Verifies sec, islevel, and apiUserName comply with length and format expectations.
  • Response Handling:

    • Resolves to the server's response data upon a successful join.
    • Rejects with specific reasons if the user is banned, suspended, or if the room host is not present.

Resolves with the join response data, or rejects with error details.

Throws validation errors or issues encountered while joining the room.

const joinOptions = {
socket: mySocket,
roomName: 'sMyRoom',
islevel: '1',
member: 'participant123',
sec: '64-character-long-secret-key-here...',
apiUserName: 'apiUser123',
};
joinConRoom(joinOptions)
.then(response => console.log('Joined room:', response))
.catch(error => console.error('Failed to join room:', error));

Constructors

Methods

Constructors

Methods

  • Joins a conference room using the provided options.

    Parameters

    Returns Promise<object>

    A promise that resolves with the response of the join operation.

    If any of the required parameters are missing or invalid.

    If the user is banned, suspended, or if the host has not joined the room yet.