Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions

You are not logged in.

Announcement

#1 2022-03-28 03:34:22

trueJP
New member
Registered: 2022-02-11
Posts: 6

Notification Event for new chat

Hey there,
I am currently creating a custom "start call" button for my website which starts a new video call. So far so good, works just perfectly fine. However, there is one special case where I do not get the notification event.

How my implementation works:

If a visitor klicks on the "start a call"-Button, the javascript checks first if an ID for this chat exists. If not, it will send a message into the chat and reload the widget in order to fetch the ID properly. Once it has successfully created the chat, I open a popup window with the voicevideo module. This triggers the already existing event in the Node.js Backend App which I modified to play a custom sound (Ring Tone) whenever a new call was triggered. My modification also includes online/offline status handling for the department which works really well.

The issue:
The above way works perfectly fine when any operator has clicked on the chat at some point in the past. The chat does not have to be open on any tab and it rings even on the every other account within the same department. If the chat was just created and not yet clicked on by any operator, there won't be neither standard message notification nor my own ringtone. I tried manually changing many attributes of the database including status, chat owner, user status and so on, but didn't find anything working. I compared the values of a "yet to be clicked on"-Chat to those from another one which I already clicked and worked including ringtone.

My question:
Which attributes do I need to overwrite in order to achieve my notification on new incoming calls which were not yet clicked by any operator? I hope you can help me here with a slight hint since I wasn't able to find any information regarding my issue in the documentation.

Thank you very much in advance!

Offline

#2 2022-03-28 08:13:31

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: Notification Event for new chat

Hi,

Sorry, but your scenario way unclear for me what exactly you expect.
https://doc.livehelperchat.com/docs/cha … -new-chats

Offline

#3 2022-03-28 14:47:16

trueJP
New member
Registered: 2022-02-11
Posts: 6

Re: Notification Event for new chat

Sorry, please let me try again!

I've made a "start a call" Button for my website. The button works just like the one in the chat widget itself, but combined with some custom logic. Now the fun part: I do not hear a notification whenever a new message comes in or a new call started as long as the chat was only used by a bot or no operator ever clicked on it. But if one of the operators, no matter who, clicks on the chat just one time (not even assigning a new owner), I can hear all notifications from new messages and from new calls.

So basically I want to know which chat attributes I have to set in order to get the sound notification in the operators backend. To me it looks like opening the chat from the backend sets a couple of values in the database which makes the backend listen to new events.

Offline

#4 2022-03-28 15:09:52

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: Notification Event for new chat

To see notification operator has to have enabled messages and new chats notifications.
https://doc.livehelperchat.com/docs/use … ifications

That's the page where all that is controlled.

Offline

#5 2022-03-28 15:37:25

trueJP
New member
Registered: 2022-02-11
Posts: 6

Re: Notification Event for new chat

New Chat Notification Seems to do the trick, thanks a lot! Is there a way to make it activate by default for new accounts?
Cheers

Offline

#6 2022-03-28 16:36:10

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: Notification Event for new chat

Bottom one settings I suppose is the default one.
https://demo.livehelperchat.com/site_ad … ndesetting

Offline

#7 2022-03-28 18:14:13

trueJP
New member
Registered: 2022-02-11
Posts: 6

Re: Notification Event for new chat

I see, thank you.
Now just one more thing, when I start a brand new chat I only get a notification for the very first message until I assign the chat to any user. It looks like I need to have the chat open in a tab order to receive notification sounds & events for every message. Is it possible to add all pending chats to the list of synced chats within this request:

$.postJSON(this.wwwDir + this.syncadmin ,{ 'chats[]': this.chatsSynchronisingMsg }

File: lh.min.js in "defaulttheme", Line 1708 or sth like this

The variable chatsSynchronisingMsg holds only IDs of chats with open tabs, and I am searching the response for incoming call events to open call. If I get this working I might send you a GitHub Request for this call function, adds a nice touch to the chat. smile

Last edited by trueJP (2022-03-28 18:14:44)

Offline

#8 2022-03-28 19:03:23

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: Notification Event for new chat

Notifications happens based on messages happens only if chat is open. This you can try make yourself but won't be easy for sure...
https://github.com/LiveHelperChat/liveh … h.js#L1716

And chats notifications happens here
https://github.com/LiveHelperChat/liveh … c.js#L1057

Offline

Board footer