The Meeting Number is Wrong 1.7.5

Description
I’m using the code from the Start & Join docs almost verbatim with the Heroku test app for signatures.

Error
errorCode: 1
errorMessage: “The meeting number is wrong.”
method: “join”
result: null
status: false

Which version?
1.7.5

To Reproduce(If applicable)
Steps to reproduce the behavior:

fetch('https://zoom-signature-testing.herokuapp.com/', {
    method: 'POST',
    body: JSON.stringify({ meetingNumber: config.meetingNumber, role: 0 })
}).then(function (result) {
    return result.text();
}).then(function (response) {
    response = $.parseJSON(response);
    //console.log('signature', response.signature);

    //console.log('ZoomMtg.init()');

    ZoomMtg.init({
	    debug: true,
	    leaveUrl: config.leaveUrl,
	    isSupportAV: true,
	    success: function (res) {
	        console.log('ZoomMtg.join()', res);
	        ZoomMtg.join({
	            signature: response.signature,
	            apiKey: config.apiKey,
	            meetingNumber: config.meetingNumber,
	            userName: config.userName,
	            userEmail: config.userEmail,
	            passWord: config.passWord,
	            success: function (res) { console.log('join success', res); },
	            error: function (res) { console.log('join error', res); }
	        });
	    },
	    error: function (err) {
	        console.log('err', err);
	    }
    });
});

Hey @sales1,

Are you creating the meeting before hand and starting it, then joining with the Web SDK?

Thanks,
Tommy

Yes, this is an existing, recurring meeting setup on the account which I’m using to test with. I can join the meeting using the same details as I’m passing into the SDK via the desktop app.

Hey @sales1,

Can you please share one of your old signatures to developersupport@zoom.us so I can debug?

Thanks,
Tommy

I now seem to be getting “The Signature has Expired”

Here is an old signature:

This is the code. I copied this from /docs/sdk/native-sdks/web/essential/signature and updated it for VB.net but it should be otherwise the same, essentially.

    Public Overridable Function ZoomGetSignature(config As ZoomMeetingConfig) As GenericResult
        Dim result As New GenericResult

        '' get timestamp
        Dim ts As String = (ToTimestamp(DateTime.UtcNow.ToUniversalTime()) - 30000).ToString()

        result.Data = CreateToken(config.ApiKey, config.MeetingNumber, ts, config.Role)
        result.Success = True

        Return result
    End Function

    Private Function ToTimestamp(ByVal value As DateTime) As Long
        Dim epoch As Long = (value.Ticks - 621355968000000000) / 10000
        Return epoch
    End Function

    Private Function CreateToken(ByVal apiKey As String, ByVal meetingNumber As String, ByVal ts As String, ByVal role As String) As String
        Dim padding() As Char = {"="}

        Dim message As String = String.Format("{0}{1}{2}{3}", apiKey, meetingNumber, ts, role)

        Dim encoding As New System.Text.ASCIIEncoding()
        Dim keyByte() As Byte = encoding.GetBytes(apiSecret)
        Dim messageBytesTest() As Byte = encoding.GetBytes(message)
        Dim msgHashPreHmac As String = System.Convert.ToBase64String(messageBytesTest)
        Dim messageBytes() As Byte = encoding.GetBytes(msgHashPreHmac)

        Dim token As String

        Using hmacsha256 As New HMACSHA256(keyByte)
            Dim hashmessage() As Byte = hmacsha256.ComputeHash(messageBytes)
            Dim msgHash As String = System.Convert.ToBase64String(hashmessage)
            token = String.Format("{0}.{1}.{2}.{3}.{4}", apiKey, meetingNumber, ts, role, msgHash)
            Dim tokenBytes = System.Text.Encoding.UTF8.GetBytes(token)

            token = System.Convert.ToBase64String(tokenBytes).TrimEnd(padding)
        End Using

        Return token
    End Function

And now I seem to be getting “Your connection has timed out and you cannot join the meeting. Verify your network connectivity and try again.” Using the same code. No changes.

I doubt my network is actually the issue as I have no issue connecting to zoom meetings with the Zoom Web client on your site.

So it appears that when I do

Dim epoch As Long = value.Ticks / TimeSpan.TicksPerMillisecond

I get “The Signature has Expired”, when I use the code for the timestamp in the example, I get the other error “Your connection has timed out and you cannot join the meeting. Verify your network connectivity and try again.”

And when I use the JS GenerateSignature method, I can connect to the meeting.

There was a role mismatch, which was causing the error. It would be helpful if perhaps a more specific error was provided when the role used in the hash doesn’t match what is used in the final encode.

Hey @sales1,

Did you get it working now? We are working on the error messages.

Thanks,
Tommy

1 Like

Sorted. I don’t see a “close” button but I seem to be good now.

1 Like

Happy to hear it is working! :slight_smile:

-Tommy