Dialer to cosider trunk capacity

Discussion in 'Call Flow Designer' started by empire4, Nov 18, 2017.

Thread Status:
Not open for further replies.
  1. empire4

    Joined:
    Nov 22, 2016
    Messages:
    18
    Likes Received:
    1
    My dialer app query a database and dials out and once connected triggers another app to play out prompts.
    At a time there are 40 - 50 numbers to be called. My sip trunk has only 6 members. The Dialer attempts all the calls in one shot to the trunk, not taking in consideration that there are only 6 channels and wait for the channels to come free, obviously only the first 6 goes out. Is there a way to make the dialer to queue the calls to the trunk or dial them in chunks of 6 calls at a time?
     
  2. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,361
    Likes Received:
    109
    Hi @empire4,

    Yes, you need to use the 3CX Call Control API to know if there is room for another call before you make it.

    You can use this API from a Launch External Script component. You need to create a C# file to invoke this API.

    First, you need to identity your external line. The following code will return all external lines in the system:
    Code:
    PhoneSystem.Root.GetExternalLines()
    That returns an array of "ExternalLine[]" objects, so you might need to iterate this array until you find the line you use to make outbound calls. Then, you need to check the number of active calls in this line as follows:
    Code:
    externalLine.GetActiveConnections().Length
    The method GetActiveConnections() returns an array of ActiveConnection objects, so the Length property will tell you how many calls you have on that line.

    Hope the information helps.

    Kind regards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Thread Status:
Not open for further replies.