How to display a popup to user on endpoint call?

Hey All,
I was trying to display an incoming call popup for a user in our ERPNext.

I tried frappe.publish_realtime but it didn’t work.
Anyone can help me to sort it out?

For pop up you can use frappe.msgprint()
but don’t know about using it with endpoint call though.

Thanks for your reply,
frappe.msgprint() function will not work in endpoint call but I’m looking for the same feature which will sort my issue.