# Zoom raw recording and chat messaging

**URL:** <https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890>\
**Category:** Meeting SDK\
**Created:** [April 1, 2024, 7:03am UTC](https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890 "2024-04-01T07:03:32Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![gofmannir](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gofmannir/32/56746_2.png) [@gofmannir](https://devforum.zoom.us/u/gofmannir)\
**Post date:** [April 1, 2024, 7:03am UTC](https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890/1 "2024-04-01T07:03:33Z")

</div>

I’m using the linux sdk to access raw video data, but as I understood from the docs, this sdk cant send messages in the meeting’s chat.

1. How to use my meeting bot the send messages to the in-meeting chat?
2. Is there an API to send messages in the chat without the requirement of a bot?
3. The only solution I found is that I need to setup another bot with web sdk to access the chat features but then I’ll end up with 2 bots in the meeting.

How can I solve this?

(cc @chunsiong.zoom )  
Thanks!

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [April 1, 2024, 7:21am UTC](https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890/2 "2024-04-01T07:21:34Z")

</div>

@gofmannir , you might be able to send message using

```
m_pMeetingService->GetMeetingChatController()->SendChatMsgTo(......)

```

> Is there an API to send messages in the chat without the requirement of a bot?

No

> The only solution I found is that I need to setup another bot with web sdk to access the chat features but then I’ll end up with 2 bots in the meeting.

Try sending using the method I’ve mentioned above

---

<div class="post-metadata">

**Author:** ![gofmannir](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gofmannir/32/56746_2.png) [@gofmannir](https://devforum.zoom.us/u/gofmannir)\
**Post date:** [April 2, 2024, 10:16am UTC](https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890/3 "2024-04-02T10:16:33Z")

</div>

Hi, I’m trying to create a thread that will handle chat messaging in my application this way:

Defining global chatController: in the top on the file

```auto
IMeetingChatController* m_pChatController;

```

Defining it after the bot has joined succesfully:

```auto
m_pChatController = m_pMeetingService->GetMeetingChatController();

std::cout << "Setting up thread" << std::endl;
m_pChatController->SendChatMsgTo("mesasge before thread", 0, ZOOM_SDK_NAMESPACE::SDKChatMessageType_To_All);
thread(ReadResultsAndSendToChat).detach();

```

```auto
void ReadResultsAndSendToChat(){
    std::this_thread::sleep_for(std::chrono::seconds(3));
	std::cout << "trying to send chat in thread" << std::endl;
	SDKError err = m_pChatController->SendChatMsgTo("mesasge in thread", 0, ZOOM_SDK_NAMESPACE::SDKChatMessageType_To_All);

	if (err != SDKERR_SUCCESS) {
		std::cout << "Error occurred sending chat: " << err << std::endl;
	}
}

```

The “mesasge before thread” Sent successfully to the chat,  
But “mesasge in thread” not sent, Without and SDKError.

What could cause that?  
@chunsiong.zoom

I see that this similar to this: [Can't send chat messages from a background thread - #4 by chunsiong.zoom](https://devforum.zoom.us/t/cant-send-chat-messages-from-a-background-thread/100928/4)  
but no answer there too.

I’m trying to achieve that in a certain event, a chat message will be sent.  
The events in my application defined by .txt/.json file that gets updated each X seconds.  
So, I’m trying to setup a thread that will listen to file changes and accordingly send chat messages.

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [April 2, 2024, 10:32am UTC](https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890/4 "2024-04-02T10:32:06Z")

</div>

@gofmannir sorry I’m not familiar with the issue you are facing.

There is a very high possibility the issue you are having is due to threading and sleep.

As a rule of thumb, all of these needs to run on the main thread

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [April 2, 2024, 10:41am UTC](https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890/5 "2024-04-02T10:41:51Z")

</div>

@gofmannir Hi,

Please review here [Can't send chat messages from a background thread - #2 by freelancer.nak](https://devforum.zoom.us/t/cant-send-chat-messages-from-a-background-thread/100928/2)

---

<div class="post-metadata">

**Author:** ![gofmannir](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gofmannir/32/56746_2.png) [@gofmannir](https://devforum.zoom.us/u/gofmannir)\
**Post date:** [April 2, 2024, 11:28am UTC](https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890/6 "2024-04-02T11:28:50Z")

</div>

@chunsiong.zoom This is a very straightforward thread, even removing the sleep it still the same.  
Why chat is limited only for the main thread?

@freelancer.nak Why do you this it’s like that? what workaround could work?  
Is there any event based strategy that can be implemented here at all with the chatController?

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [April 2, 2024, 12:11pm UTC](https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890/7 "2024-04-02T12:11:38Z")

</div>

> [@gofmannir](#):
>
> This is a very straightforward thread, even removing the sleep it still the same.  
> Why chat is limited only for the main thread?

As far as I know, the documentations and threads on the dev forums mentions that the functionalities of the SDK must run on the main thread.

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [April 2, 2024, 12:42pm UTC](https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890/8 "2024-04-02T12:42:06Z")

</div>

> [@gofmannir](#):
>
> Why do you this it’s like that? what workaround could work?  
> Is there any event based strategy that can be implemented here at all with the chatController?

Please use meetingService from main thread using event loop here is my working sample

```auto
// triggered from Event Loop
void BotLauncher::sendChat(string content)

{

_meetingService->GetMeetingChatController()->SendChatMsgTo(convertStringToWChar(content), 0, SDKChatMessageType::SDKChatMessageType_To_All);

}

// Called from main
void BotLauncher::SendChatFromMainThread()
{
	if (!msgs.empty())
	{
		sendChat(msgs.front());
		msgs.pop();
	}
}

// here is WinMain
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, char*, int nCmdShow)
{
	HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);

	Log logger;
	LPWSTR* meetingCreds = readJWT();

	if (meetingCreds[1] != NULL)
	{
		zoomBot = new BotLauncher(meetingCreds[1], meetingCreds[2], _atoi64(CW2A(meetingCreds[3])), meetingCreds[4], LPWSTRToString(meetingCreds[5]));

		zoomBot->Run(hInstance);

		std::this_thread::sleep_for(std::chrono::seconds(3));
	}

	MSG msg;
	while (GetMessage(&msg, NULL, 0, 0))
	{
		if (WM_QUIT == msg.message)
		{
			break;
		}

		if (zoomBot != NULL) {
			zoomBot->SendChatFromMainThread();
		}

		DispatchMessage(&msg);
	}

	return 0;
	TranslateMessage(&msg);
}

```

Hope that works for you. Thanks

---

<div class="post-metadata">

**Author:** ![gofmannir](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gofmannir/32/56746_2.png) [@gofmannir](https://devforum.zoom.us/u/gofmannir)\
**Post date:** [April 2, 2024, 1:12pm UTC](https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890/9 "2024-04-02T13:12:15Z")

</div>

> [@freelancer.nak](#):
>
> `sendChat`

Sorry but I’m using the linux sdk, What is the pattern you used here?

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [April 2, 2024, 1:13pm UTC](https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890/10 "2024-04-02T13:13:30Z")

</div>

The pattern will be same as above for Windows.

---

<div class="post-metadata">

**Author:** ![gofmannir](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gofmannir/32/56746_2.png) [@gofmannir](https://devforum.zoom.us/u/gofmannir)\
**Post date:** [April 2, 2024, 1:17pm UTC](https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890/11 "2024-04-02T13:17:57Z")

</div>

I trying queuing & dispatching messages to the main thread but it frezzes the raw video recording I’m doing…  
Maybe you can help me understand it offline?

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [April 2, 2024, 1:19pm UTC](https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890/12 "2024-04-02T13:19:44Z")

</div>

You need to implement better multithread strategy to avoid that thing.

---

<div class="post-metadata">

**Author:** ![amanda-recallai](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/amanda-recallai/32/44747_2.png) [@amanda-recallai](https://devforum.zoom.us/u/amanda-recallai)\
**Post date:** [April 4, 2024, 11:23pm UTC](https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890/13 "2024-04-04T23:23:06Z")

</div>

Hey @gofmannir ,

One thing that you might want to try is using something like [GLib](https://docs.gtk.org/glib/ctor.MainLoop.new.html), which provides a pretty useful main loop abstraction that makes dealing with these sorts of things a bit simpler.

Then, you could edit your queueing strategy to use [`g_idle_add`](https://docs.gtk.org/glib/func.idle_add.html) to call the function in the main loop, whenever there are no higher priority events pending. This should alleviate the freezing you’re observing in your current implementation.

We use a similar approach in our meeting bots and it works well for us.

Another alternative is to use [Recall.ai](https://www.recall.ai/)for your meeting bots instead. It’s a simple 3rd party API that lets you use meeting bots to get raw audio/video from meetings without you needing to spend months to build, scale and maintain these bots.

Let me know if you have any questions!

---

<div class="post-metadata">

**Author:** ![wiseranirudh](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/wiseranirudh/32/49388_2.png) [@wiseranirudh](https://devforum.zoom.us/u/wiseranirudh)\
**Post date:** [May 8, 2024, 10:44am UTC](https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890/14 "2024-05-08T10:44:55Z")

</div>

The Latest SDK - [SendChatMessage()](https://marketplacefront.zoom.us/sdk/meeting/linux/class_i_meeting_chat_controller.html#aa246496b1154469ebc7b67f1f23e805e) uses a `IChatMsgInfo`.

There is no clear way to create a IChatMsgInfo to send the message, so basically the latest SDK blocks us from sending messages in chat then?

@chunsiong.zoom

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [May 9, 2024, 3:39am UTC](https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890/15 "2024-05-09T03:39:59Z")

</div>

@wiseranirudh can you try this?

```
std::wstring wstr = L"Hello world!";
wchar_t wcharArray[1024]; // Choose an appropriate size
wcscpy_s(wcharArray, wstr.c_str());

IChatMsgInfoBuilder* chatbuilder = meetingchatcontroller->GetChatMessageBuilder();
chatbuilder->SetReceiver(0);
chatbuilder->SetMessageType(SDKChatMessageType_To_All);
chatbuilder->SetContent(wcharArray);
chatbuilder->Build();
meetingchatcontroller->SendChatMsgTo(chatbuilder->Build());

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [May 12, 2025, 7:16pm UTC](https://devforum.zoom.us/t/zoom-raw-recording-and-chat-messaging/106890/16 "2025-05-12T19:16:52Z")

</div>

Closed on May 12, 2025, 7:16pm UTC

This topic was automatically closed 368 days after the last reply. New replies are no longer allowed.
