Ask The Experts: Cycling Number Lists


I have a large number of phone numbers (DID) I have purchased.  With each phone call, I want to cycle through the list of numbers so the number presented to contacts is different with each new call.  How can I do that in 3CX?


There are only two ways you can control the outbound caller ID number in 3CX:

  1. Assign a static caller ID number to an outbound rule and control which outbound rule the call uses.

    For example, you could create an outbound rule that matches any dialed numbers starting with 88888. This “prefix” is dialed by the user along with the actual phone number to be called.  The rule would strip the 88888 from the dialed phone number and pass the remaining digits to the SIP provider along with the assigned caller ID number.

    The challenge with this approach is that you would need an outbound rule for every DID you want to use, and the user would need to remember all the codes (8888) to dial to select the desired caller ID number.
  2. Adjust the users Caller ID. This is straightforward, but the user would have to change the number assigned to their extension before each call.

If you have a large number of DIDs you want to us, and you want an automated way of cycling through a list of DIDs, you will need custom development. 3CX cannot do it out-of-the-box.

Here is how I would do it:

When you place a phone call, there is a lot of negotiation taking place between 3CX and your phone carrier.  The two systems have to negotiate things like the codec to use, port numbers, and other technical details to ensure the two phones can communicate with each other.  One of the pieces of information included in this “invite” process is the outbound caller ID number to present to the outside person. 

The trick then, is to replace the phone number assigned to the 3CX user before each phone call.  This can be accomplished using the VoIPTools API and a custom service (Windows Service or Linux Daemon).  The service would monitor when each phone call is placed.  After the initial call setup is complete, the service could update the user’s extension with the next phone number in the list.   In this way, before the next phone call is placed, the new phone number is already there ready to be presented with the next phone call.

Leave a Reply