SIP INVITE dropping 408 before Event Stream webhook acknowledges

Problem

Inbound SIP trunks are failing the moment the call.started event hits the Express middleware. The JWT introspection call to Genesys is taking over 900ms, which pushes the webhook response past the 1-second SIP timeout window. The router’s doing jack all to speed up the crypto step.

Logs

[2024-05-12T14:23:01.442Z] POST /webhooks/gc/events 200 1.12s
[2024-05-12T14:23:01.442Z] JWT validation latency: 942ms
[2024-05-12T14:23:02.550Z] SIP trunk error: 408 Request Timeout (INVITE from 10.0.4.12)

Code

app.post('/gc/events', async (req, res) => {
 const claims = await verifyJwt(req.headers.authorization);
 res.status(200).send('ack');
});