Validate inbound call using web service and route to not one but two numbers

Hello, a freepbx newbie here. I need guidance on howto setup brand new hosted freepbx for following use case:

  • Allow CALLERs to call into a US number from any phone. Must allow multiple MAX_CONCURRENT_INBOUND_CALLS inbound calls at any given time.
  • There are MAX_NUM_AGENTS number of agents that answer calls.
  • Each agents is assigned to one or more Queues. There are MAX_NUM_QUEUES number of of queues
  • Each inbound CALLER is presented with an IVR menu to select a Queue and then asked to enter a TARGET phone number they are calling
  • The IVR validates the CALLER number and the TARGET number using a custom web service I provide. If the information validates then call proceeds. If it fails to validate an error message is played and call ends.
  • If call proceeds then all agents in queue are called on their phone. Agents’ phone can be any type of phone.
  • The call is connected to the first agent in the Queue that answers and it stops ringing on all other agents’ phones
  • As soon as the agent answers, the TARGET phone number is called and connected to existing call with agent to make a 3 party call
  • When any of the 3 parties hang up the entire call is terminated

Some specific and very newbie questions below. High level guidance and links would be terrific.

  • How do I acquire the one phone number that all CALLERs dial in to and how do I configure it in freepbx
  • How many DID numbers do I need. Is it one per agent?
  • How many SIP trunks do I need. Is it what I called MAX_CONCURRENT_INBOUND_CALLS?
  • How do I configure Freepbx IVR to use a custom backend service to validate TARGET phone number being called
  • How do I get call metering info so I can tell how many minutes per month each agent spent on inbound calls
  • How do I get call metering info on how many minutes each TARGET phone number spent on calls
  • How do I get call metering info on how many minutes each CALLER spent on calls

My apologies if some of my questions are too basic or do not make sense given my lack of expertise in this area.


You need a SIP trunk to have a PSTN phone number route to your PBX. You should do your own research on pricing and local availability to determine the best SIP trunk provider for you.

What is SIP Trunking:

I would also recommend reading the wikis:

Configuring your PBX:


Routing Inbound calls:

Dynamic Routes:



Call Accounting Module:

There is more of course, but it is probably best to break your project into chunks and see what you can do, then follow up with the community with specific questions as they come up.

1 Like

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