# C# Wrapper: Add\_CB\_onUserAudioStatusChange no userId

**URL:** <https://devforum.zoom.us/t/c-wrapper-add-cb-onuseraudiostatuschange-no-userid/17149>\
**Category:** Windows\
**Created:** [May 11, 2020, 9:54pm UTC](https://devforum.zoom.us/t/c-wrapper-add-cb-onuseraudiostatuschange-no-userid/17149 "2020-05-11T21:54:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bragma](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/bragma/32/4213_2.png) [@bragma](https://devforum.zoom.us/u/bragma)\
**Post date:** [May 11, 2020, 9:54pm UTC](https://devforum.zoom.us/t/c-wrapper-add-cb-onuseraudiostatuschange-no-userid/17149/1 "2020-05-11T21:54:40Z")

</div>

Hi,  
I am implementing the callback to Add\_CB\_onUserAudioStatusChange, but I always get 0 as user Id.  
Here is some sample code:

```
authService.Add_CB_onAuthenticationReturn(OnAuthenticationReturn);
...
        private void OnUserAudioStatusChange(IUserAudioStatusDotNetWrap[] lstAudioStatusChange)
        {
            if (lstAudioStatusChange == null || lstAudioStatusChange.Length == 0)
                return;

            for (int i = lstAudioStatusChange.GetLowerBound(0); i <= lstAudioStatusChange.GetUpperBound(0); i++)
            {
                var change = (IUserAudioStatusDotNetWrap)lstAudioStatusChange.GetValue(i);

                Debug.WriteLine($"User audio status: {change.GetUserId()}, status {change.GetStatus()}", nameof(ZoomService));
            }
        }

```

This is the result:

```
ZoomService: User audio status: 0, status Audio_UnMuted
ZoomService: User audio status: 0, status Audio_Muted
ZoomService: User audio status: 0, status Audio_UnMuted

```

What’s wrong with my code? Is it a problem of the sdk/wrapper?

Thanks!

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [May 22, 2020, 7:01am UTC](https://devforum.zoom.us/t/c-wrapper-add-cb-onuseraudiostatuschange-no-userid/17149/2 "2020-05-22T07:01:43Z")

</div>

Hi [bragma](https://devforum.zoom.us/u/bragma),

Thanks for the post and pardon the late response. The code snippet looks great but the result sounds unexpected. To further investigate this issue, you may modify the C# wrapper and make it debuggable, and see if the class `IUserAudioStatusDotNetWrapImpl` is being used correctly and sees the return value from the Windows SDK interfaces.

Hope this helps. Thanks!

---

<div class="post-metadata">

**Author:** ![async](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@async](https://devforum.zoom.us/u/async)\
**Post date:** [June 11, 2020, 7:33pm UTC](https://devforum.zoom.us/t/c-wrapper-add-cb-onuseraudiostatuschange-no-userid/17149/3 "2020-06-11T19:33:25Z")

</div>

Hi @carson.zoom, the bug @bragma found is indeed in the C# wrapper. I found the issue and created a pull request at [https://github.com/zoom/zoom-c-sharp-wrapper/pull/26](https://github.com/zoom/zoom-c-sharp-wrapper/pull/26). The issue was the wrapper was not actually returning the wrapped value properly (there was a missing return!). I hope this helps you @bragma. @carson.zoom let me know if there is a better way to get this reviewed with the team. The change is very small

---

<div class="post-metadata">

**Author:** ![bragma](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/bragma/32/4213_2.png) [@bragma](https://devforum.zoom.us/u/bragma)\
**Post date:** [June 11, 2020, 8:25pm UTC](https://devforum.zoom.us/t/c-wrapper-add-cb-onuseraudiostatuschange-no-userid/17149/4 "2020-06-11T20:25:33Z")

</div>

Thanks @async, I’ve quickly checked the code but didn’t notice the missing return!

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [June 12, 2020, 5:27am UTC](https://devforum.zoom.us/t/c-wrapper-add-cb-onuseraudiostatuschange-no-userid/17149/5 "2020-06-12T05:27:14Z")

</div>

Hi @async,

Thanks for the reply and the pull request! I will forward that to the engineering team for review. Please feel free to submit a pull request if you found any other places that could be improved.

Thanks again!

---

<div class="post-metadata">

**Author:** ![bragma](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/bragma/32/4213_2.png) [@bragma](https://devforum.zoom.us/u/bragma)\
**Post date:** [July 7, 2020, 10:53am UTC](https://devforum.zoom.us/t/c-wrapper-add-cb-onuseraudiostatuschange-no-userid/17149/6 "2020-07-07T10:53:33Z")

</div>

I confirm this is solved in windows SDK v5.0.24433.0616

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [July 8, 2020, 6:51am UTC](https://devforum.zoom.us/t/c-wrapper-add-cb-onuseraudiostatuschange-no-userid/17149/7 "2020-07-08T06:51:18Z")

</div>

Closed on July 8, 2020, 6:51am UTC


