Originally published on — set the Call Control Application webhook URL to https://<your-ngrok-id>.ngrok.io/webhooks/voice.
Why Screen at the Carrier Edge?
Fraud screening typically runs at the application layer — after the call is already connected. By that point, the fraud has already consumed SIP trunks, media servers, and agent time.
Screening at the carrier edge means the decision happens on the same network that carries the call. Number Lookup and AI Inference run on Telnyx infrastructure, not a third-party API called over the public internet. The screen-then-route decision is fast enough to sit inline on every inbound call.
Going to Production
This sample uses in-memory state. For production:
- Replace the in-memory blocklist with Redis
- Add rate limiting to the AI classification call
- Set up monitoring on classification latency and block rate
- Use
gunicorn -w 4 app:appas a process manager - Configure failover webhook URLs in the Telnyx Portal
Resources
Related Examples
— Verify suspicious activity with an outbound confirmation call
edge-geo-smart-router-python — Route inbound calls at the edge based on caller geography
SOCIAL SHARE CARD GENERATOR