0

I use zoom's API, jwt and the websdk to create a meeting on button click, then join as a host and simultaneously start the meeting enabling others to join. This works fine locally, but somehow when deployed to cloudflare I get the following error:

Your connection has timed out and you cannot join the meeting. Verify your network connectivity and try again.

Error object:

errorCode: 3706
errorMessage: undefined
method: "join"
result: "The meeting number is wrong."
status: false

"The meeting number is wrong." is obviously the wrong message here, since the meeting number provided comes from zoom's API directly and is working locally.

const joinMeeting = async (meetConfig: MeetConfigData) => {
    const ZoomMtg = require("@zoomus/websdk").ZoomMtg;
    ZoomMtg.setZoomJSLib("https://source.zoom.us/1.9.0/lib", "/av");
    ZoomMtg.preLoadWasm();
    ZoomMtg.prepareJssdk();

    const signature = await generateSignature(meetConfig.role, meetConfig.meetingNumber);

    ZoomMtg.init({
        leaveUrl: meetConfig.leaveUrl,
        isSupportAV: true,
        success: () => {
            ZoomMtg.join({
                signature,
                apiKey: "API_KEY",
                meetingNumber: meetConfig.meetingNumber,
                userName: meetConfig.userName,
                passWord: meetConfig.password,
                success: () => {
                    console.log("Successfully hosted or joined meeting.");
                },
                error: (err: Error) => {
                    console.log("Error: ", err);
                },
            });
        },
        error: (err: Error) => {
            console.log("Error: ", err);
        },
    });
};

Serverside signature method which returns the correct signature since, again, it works locally:

export const createSignature = ({ role, meetingNumber }) => {
    const timestamp = new Date().getTime() - 30000;
    const msg = Buffer.from(
        process.env.NEXT_PUBLIC_ZOOM_API_KEY + meetingNumber + timestamp + role
    ).toString("base64");
    const hash = crypto
        .createHmac("sha256", process.env.NEXT_PUBLIC_ZOOM_API_SECRET)
        .update(msg)
        .digest("base64");

    return Buffer.from(
        `${process.env.NEXT_PUBLIC_ZOOM_API_KEY}.${meetingNumber}.${timestamp}.${role}.${hash}`
    ).toString("base64");
};

Has anyone ever experienced this?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Johnny Kontrolletti
  • 727
  • 1
  • 10
  • 22

1 Answers1

0

if you are getting this (Receiving “Your connection has timed out and you cannot join the meeting” when joining a meeting that has not started) error need to do something

Search in your project

<script src="https://source.zoom.us/zoom-meeting-1.7.8.min.js"></script>
and replace with 

<script src="https://source.zoom.us/zoom-meeting-2.1.1.min.js"></script>

1 After doing that error will go away 2

TourEiffel
  • 4,034
  • 2
  • 16
  • 45
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 15 '21 at 09:48