What’s the right way to handle STUN binding timeouts when the WebSocket Notification API pushes a webrtc.session.update event? GC sits at 2024-6.712.0. The Express middleware catches the payload, but the JWT validation step drops the refresh token. Console logs show a 401 Unauthorized on v1/communications/webrtc/softphone/tokens. It’s dropping the handshake before the queue even sees it.
app.post('/gc/webhook', (req, res) => {
const token = req.headers['authorization'];
});
Architect flow routes straight through. Queue’s just sitting there doing jack all. Logs show the handshake timing out.
You’re hitting a 401 because the webhook listener isn’t passing the correct Bearer token in the Authorization header for that specific endpoint. Check your Express middleware to ensure it’s attaching the valid OAuth token retrieved from the platform client before making the POST request.
Don’t use the webhook listener to fetch the softphone token. That endpoint expects a user context, not a bot token. You’ll need to rotate the client credentials on the frontend instead.
// Use the standard OAuth flow, not the webhook token
const token = await platformClient.authApi.authPostOAuthToken({
grant_type: 'refresh_token',
refresh_token: storedRefreshToken
});