Configuring Inbound Calls to Execute REST API for Dynamic Extension Assignment

Hello FreePBX Community,

I am seeking advice on how to implement a specific call routing scenario using FreePBX. The objective is to execute a REST API (cURL, for example: https://example.com/api/assigned-by-number/{phoneNumber}) whenever there is an inbound call to a particular phone number. This API call should return an extension number to which the call should be routed.

For context, we have a CRM system where each customer is assigned a dedicated representative. We want to set up our FreePBX system so that when a customer calls our main phone number, the call is automatically redirected to their assigned agent’s extension.

How can we achive this?

Thank you

If FreePBX V15 or V16 have a look at dynamic routing module

Dynamic Routes is the way to handle this. If you’re able to get a plain text reply back from a simple URL with GET args, then you can use the URL option directly in dynroutes, otherwise you’ll want to use an AGI script that performs the lookup and process the data returned into an extension number.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.