Refresh on ticket create disrupts live WebRTC session | Community
Skip to main content

Refresh on ticket create disrupts live WebRTC session

  • August 8, 2023
  • 0 replies
  • 0 views

Development

I'm building a phone integration with Zendesk, using our own platform (React, typescript, Redux) with OAuth2 and ZAF to create tickets, accept or reject calls etcetera. in Zendesk.

The issue
1. When someone calls, a socket event triggers opening the top_bar app.
2. Zendesk agent accepts the call.
3. Accepting the call triggers a POST to /api/v2/tickets.json, which creates a new ticket.
4. This in turn triggers another post to said created ticket on the /display endpoint.
5. Zendesk now navigates to the created ticket in step 4.
6. The active WebRTC session is lost.

More context
1. The active session is stored in the Redux store, which empties when a page refreshes. In essence, this counts as a "I'm starting up the application".
2. The same iframe is loaded in the sidebar in the new_ticket_sidebar and ticket_sidebar positions.

Question(s)
1. Why is Zendesk (apprently sometimes) refreshing when using the Api to create and open a new ticket, while clicking the "Add" button keeps the top_bar application open when navigating through the tickets?
2. How can I pass the active session (an active WebRTC -> SIP connection) from top_bar to ticket_sidebar and viceversa?
3. What is the best way to "preload" the iframe(s)?