Possible CORS error when looping between Twilio Functions and an external php endpoint

We’re working on a looping alert system that sends an alert to our agent, then sends a request to our external PHP endpoint to sleep for an interval, then the endpoint calls our Twilio Function/Twilio Runtime Domain Endpoint again with an AJAX request to issue an alert, and loops.

Function A –> External Sleep Function (/Sleep) –> Function A

That’s the flow that we need, and we can’t get it to work. We can receive the request from Function A at /Sleep, but then can’t get it back to Function A. We can also send request from the browser to /Sleep, then receive the request back at Function A, then receive at /Sleep but still can’t get it back to Function A.

Basically, we can’t get the loop to complete. Does anyone have experience making a system like this work?

Thank you so much.