Dismiss Notice
We would like to remind you that we’re updating our login process for all 3CX forums whereby you will be able to login with the same credentials you use for the Partner or Customer Portal. Click here to read more.

How Can I check Outbouns in CDF

Discussion in 'Call Flow Designer' started by AlirezaKeshmiri, Mar 18, 2018.

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

    Joined:
    Mar 16, 2018
    Messages:
    12
    Likes Received:
    0
    Dear @edossantos ,

    I have a problem in my auto dialer ,
    I have 100 phone number and my dialer miss some of them...

    i think the problem is that , my out bounds will busy and the dialer execute the dialer flow spontaneously .
    so the dialer not able to make success call to all of my phone numbers .

    how can i check my out bounds status ? like checking the free extensions ?

    i want to check my outbound and when there are free i make next call .
     
  2. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,617
    Likes Received:
    126
    Hello @AlirezaKeshmiri,

    You need to use a script to check that, using the 3CX Call Control API. First, you need to get your Gateway. You can use:
    PhoneSystem.Root.GetGateways()

    to get a Gateway[]. Then you need to iterate the results to get the gateway you need. If you have a single Gateway, then just get the first item from the array.

    Once you have your Gateway object, you can call:
    Gateway.GetExternalLines()

    to get an array of ExternalLine objects.

    For each external line, you can invoke:
    ExternalLine.GetActiveConnections()

    That will return an array of active connections on that line.

    Using this approach you can see if you have free channels or not, and then make the call or wait for the next dialer cycle.

    Kind regards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. AlirezaKeshmiri

    Joined:
    Mar 16, 2018
    Messages:
    12
    Likes Received:
    0
    Dear @edossantos ,
    Thanks
    here is my code , it can be useful for someone .


    i use it in my flow designer to check my free line in gateways in order to make a successful call.


    using System;
    using TCX.Configuration;

    namespace OutboundDialer
    {
    public class GetwaysState
    {
    public bool IsThereAnyFreeLine()
    {
    TCX.Configuration.Gateway[] gt_i = PhoneSystem.Root.GetGateways();
    TCX.Configuration.ExternalLine gt_ex = gt_i[0].GetExternalLines()[0];
    if (gt_ex.GetActiveConnections().Length < 4)
    {
    return true ;
    }
    gt_ex = gt_i[1].GetExternalLines()[0];
    if (gt_ex.GetActiveConnections().Length < 4)
    {
    return true ;
    }
    return false ;
    }
    }
    }

    -----------------

    NOTE : i have 2 gateways , so my gt_i have 2 item
     
  4. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,617
    Likes Received:
    126
    Thanks for sharing! That will be very useful for other users!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    AlirezaKeshmiri likes this.
Thread Status:
Not open for further replies.