# Can not join meeting when windows load

**URL:** <https://devforum.zoom.us/t/can-not-join-meeting-when-windows-load/9341>\
**Category:** Web\
**Created:** [March 23, 2020, 7:08pm UTC](https://devforum.zoom.us/t/can-not-join-meeting-when-windows-load/9341 "2020-03-23T19:08:04Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![tranvuong1803](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@tranvuong1803](https://devforum.zoom.us/u/tranvuong1803)\
**Post date:** [March 23, 2020, 7:08pm UTC](https://devforum.zoom.us/t/can-not-join-meeting-when-windows-load/9341/1 "2020-03-23T19:08:04Z")

</div>

**Description**  
Here is my code  
$(document).ready(function() {  
console.log(‘checkSystemRequirements’);  
console.log(JSON.stringify(ZoomMtg.checkSystemRequirements()));  
ZoomMtg.setZoomJSLib(‘[https://source.zoom.us/1.7.2/lib](https://source.zoom.us/1.7.2/lib)’, ‘/av’);  
ZoomMtg.preLoadWasm();  
ZoomMtg.prepareJssdk();

```
            ZoomMtg.init({
                leaveUrl: 'http://www.zoom.us',
                isSupportAV: true,
                success: function () {
                    ZoomMtg.join({
                        meetingNumber: '@meetingNumber',
                        userName: '@userName',
                        signature: '@signature',
                        apiKey: '@apiKey',
                        userEmail: 'email@gmail.com',
                        passWord: '@passWord',
                        success: function(res) {
                            $('#nav-tool').hide();
                            console.log('join meeting success');
                        },
                        error: function(res) {
                            console.log(res);
                        }
                    });
                },
                error: function (res) {
                
                    console.log(res);
                }
            });

    });

```

**Error**  
I customize the sample code, i want to join meeting onload but always nothing happen?  
If i using button click it always message “fail to join”  
I code on MVC c# so @meetingNumber value from a viewbag  
What Error is here?  
Thank for read 🙂

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [March 23, 2020, 10:44pm UTC](https://devforum.zoom.us/t/can-not-join-meeting-when-windows-load/9341/2 "2020-03-23T22:44:08Z")

</div>

Hey @tranvuong1803,

How are you generating the signature? Also what is the meeting ID you are trying to join?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![tranvuong1803](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@tranvuong1803](https://devforum.zoom.us/u/tranvuong1803)\
**Post date:** [March 24, 2020, 1:05am UTC](https://devforum.zoom.us/t/can-not-join-meeting-when-windows-load/9341/3 "2020-03-24T01:05:56Z")

</div>

> [@tommy](#):
>
> signature

Thank @tommy to answer my question  
I use these code to generate signature,  
The meeting id 9129153552 i created from API, i can join this meeting by join url [Launch - Zoom](http://zoom.us/j/9129153552&pwd)

```auto
static readonly char[] padding = { '=' };

        static void Main (string[] args) {
            Console.WriteLine ("Zoom copyright!");
            Console.WriteLine ("generate websdk token!");
            string apiKey = "apiKey";
            string apiSecret = "apiSecret";
            string meetingNumber = "";
            String ts = ToTimestamp(DateTime.UtcNow.ToUniversalTime ()).ToString();
            string role = "1";
            string token = GenerateToken (apiKey, apiSecret, meetingNumber, ts, role);
            Console.WriteLine (token);
        }

        public static long ToTimestamp (DateTime value) {
            long epoch = (value.Ticks - 621355968000000000) / 10000;
            return epoch;
        }

        public static string GenerateToken (string apiKey, string apiSecret, string meetingNumber, string ts, string role) {
            string message = String.Format ("{0}{1}{2}{3}", apiKey, meetingNumber, ts, role);
            apiSecret = apiSecret ?? "";
            var encoding = new System.Text.ASCIIEncoding ();
            byte[] keyByte = encoding.GetBytes (apiSecret);
            byte[] messageBytesTest = encoding.GetBytes (message);
            string msgHashPreHmac = System.Convert.ToBase64String (messageBytesTest);
            byte[] messageBytes = encoding.GetBytes (msgHashPreHmac);
            using (var hmacsha256 = new HMACSHA256 (keyByte)) {
                byte[] hashmessage = hmacsha256.ComputeHash (messageBytes);
                string msgHash = System.Convert.ToBase64String (hashmessage);
                string token = String.Format ("{0}.{1}.{2}.{3}.{4}", apiKey, meetingNumber, ts, role, msgHash);
                var tokenBytes = System.Text.Encoding.UTF8.GetBytes (token);
                return System.Convert.ToBase64String (tokenBytes).TrimEnd (padding);
            }
        }

```

---

<div class="post-metadata">

**Author:** ![tranvuong1803](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@tranvuong1803](https://devforum.zoom.us/u/tranvuong1803)\
**Post date:** [March 24, 2020, 1:43am UTC](https://devforum.zoom.us/t/can-not-join-meeting-when-windows-load/9341/4 "2020-03-24T01:43:26Z")

</div>

@tommy i findout that function generate signature C# error, i try generate with javascript is okie

---

<div class="post-metadata">

**Author:** ![tranvuong1803](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@tranvuong1803](https://devforum.zoom.us/u/tranvuong1803)\
**Post date:** [March 24, 2020, 2:06am UTC](https://devforum.zoom.us/t/can-not-join-meeting-when-windows-load/9341/5 "2020-03-24T02:06:21Z")

</div>

what did i do to generate right signature from c#

---

<div class="post-metadata">

**Author:** ![tranvuong1803](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@tranvuong1803](https://devforum.zoom.us/u/tranvuong1803)\
**Post date:** [March 24, 2020, 6:24am UTC](https://devforum.zoom.us/t/can-not-join-meeting-when-windows-load/9341/6 "2020-03-24T06:24:54Z")

</div>

Signature  
Generate from javascript:

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [March 24, 2020, 6:23pm UTC](https://devforum.zoom.us/t/can-not-join-meeting-when-windows-load/9341/7 "2020-03-24T18:23:52Z")

</div>

Hey @tranvuong1803,

They both appear correct, but maybe there is a bug in the c# example.

Here is a Node.js signature sample app you could use in the meantime:

[https://marketplace.zoom.us/docs/sdk/native-sdks/web/essential/signature#simple-signature-setup](https://marketplace.zoom.us/docs/sdk/native-sdks/web/essential/signature#simple-signature-setup)

Related thread:

> [@Invalid Signature C#](https://devforum.zoom.us/t/invalid-signature-c/6542):
>
> Description/Error When generating a signature from a .net core 3.0 api server using the c# example from ([https://marketplace.zoom.us/docs/sdk/native-sdks/Web-Client-SDK/tutorial/generate-signature](https://marketplace.zoom.us/docs/sdk/native-sdks/Web-Client-SDK/tutorial/generate-signature)) it fails with an invalid signature error. {method: “join”, status: false, errorCode: 1, errorMessage: “Invalid signature.”, result: null} C# Code: Where as using ZoomMtg.generateSignature with the same data works. var signature = ZoomMtg.generateSignature({ meetingNumber: data.me…

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![JackYang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jackyang/32/1135_2.png) [@JackYang](https://devforum.zoom.us/u/JackYang)\
**Post date:** [March 27, 2020, 8:40am UTC](https://devforum.zoom.us/t/can-not-join-meeting-when-windows-load/9341/8 "2020-03-27T08:40:07Z")

</div>

try  
string ts = ToTimestamp(DateTime.UtcNow.ToUniversalTime()).ToString();  
change to  
String ts = ToTimestamp(DateTime.UtcNow.ToUniversalTime() - 30000).ToString();

if your sever go ahead zoom server, it will casue signature expired issue

and try syc your server time

---

<div class="post-metadata">

**Author:** ![tranvuong1803](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@tranvuong1803](https://devforum.zoom.us/u/tranvuong1803)\
**Post date:** [March 27, 2020, 8:53am UTC](https://devforum.zoom.us/t/can-not-join-meeting-when-windows-load/9341/9 "2020-03-27T08:53:23Z")

</div>

> [@JackYang](#):
>
> if your sever go ahead zoom server, it will casue signature expired issue

thank, i will try it

---

<div class="post-metadata">

**Author:** ![tranvuong1803](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@tranvuong1803](https://devforum.zoom.us/u/tranvuong1803)\
**Post date:** [March 27, 2020, 10:04am UTC](https://devforum.zoom.us/t/can-not-join-meeting-when-windows-load/9341/10 "2020-03-27T10:04:19Z")

</div>

> [@JackYang](#):
>
> ToTimestamp

hey Jack, can not subtract datetime and int?  
“DateTime.UtcNow.ToUniversalTime() - 30000” is that right?

---

<div class="post-metadata">

**Author:** ![JackYang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jackyang/32/1135_2.png) [@JackYang](https://devforum.zoom.us/u/JackYang)\
**Post date:** [March 27, 2020, 1:05pm UTC](https://devforum.zoom.us/t/can-not-join-meeting-when-windows-load/9341/11 "2020-03-27T13:05:18Z")

</div>

sorry make mistake,

String ts = (ToTimestamp(DateTime.UtcNow.ToUniversalTime ()) - 30000).ToString();

---

<div class="post-metadata">

**Author:** ![manishkumarmm93](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/manishkumarmm93/32/3956_2.png) [@manishkumarmm93](https://devforum.zoom.us/u/manishkumarmm93)\
**Post date:** [March 30, 2020, 4:46am UTC](https://devforum.zoom.us/t/can-not-join-meeting-when-windows-load/9341/12 "2020-03-30T04:46:10Z")

</div>

> [@tranvuong1803](#):
>
> ZoomMtg

Hi, I had written Jquery customize. I found one error . That is  
“Uncaught ReferenceError: ZoomMtg is not defined”

how can i define ZoomMtg ?

This is my code

$(document).ready(function () {

```
    console.log('checkSystemRequirements');
    console.log(JSON.stringify(ZoomMtg.checkSystemRequirements()));
    ZoomMtg.setZoomJSLib('https://source.zoom.us/1.7.2/lib', '/av');
    ZoomMtg.preLoadWasm();
    ZoomMtg.prepareJssdk();     

```

Thanks

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [March 30, 2020, 7:14pm UTC](https://devforum.zoom.us/t/can-not-join-meeting-when-windows-load/9341/13 "2020-03-30T19:14:15Z")

</div>

Hey @manishkumarmm93,

Have you added the script in your index.html so ZoomMtg is globally available?

> <https://github.com/zoom/sample-app-web/blob/master/CDN/index.html#L44>

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 7:35pm UTC](https://devforum.zoom.us/t/can-not-join-meeting-when-windows-load/9341/14 "2020-08-21T19:35:51Z")

</div>

Closed on August 21, 2020, 7:35pm UTC


