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.

Use of API outside of CFD

Discussion in 'Call Flow Designer' started by cognos1, Jan 10, 2018.

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

    Joined:
    Dec 18, 2015
    Messages:
    5
    Likes Received:
    0
    I'm new to 3CX and CFD so I'm not sure how this whole thing works. Hope this is the right place to ask this.

    It looks to me that the CFD can be used to invoke a C# script (which can in turn invoke API methods) but this can only be triggered by a phone call that is captured by the CFD, which is fine for in-call functionality. If I want to invoke API methods without making a phone call, say to change extension configurations on a timed basis, how could I do this? Does it go roughly like this:-
    1. Create a C# project in Visual Studio 2015;
    2. Make sure that the prerequisites listed in the 'readme.txt' file (as below) for the Configuration and Call Control API V15 > OMSamples are in place;
    3. Use similar 'using' statements as the OMSamples do to pick up the API objects, e.g. "using TCX.Configuration" ?

    The readme.txt in the OMSamples folder starts with this:-

    3CXObjectModel.2.0.0.0_v15.chm - help file for Configuration and Call Control API V15
    OMSamples - C# project files for VS2015 containing samples of how to use Configuration server and Call Control API.
    If you cannot open the chm, right click > properties > and press Unblock button.

    #####################

    Prerequisites:
    1. Stanalone host.
    2. User should have administrative rights.
    3. Two applications installed on the the host:
    a) Microsoft Visual Studio 2015 (.NET 4.6.1, C#)
    b) Test installaion of 3CX Phone System version 15 SP1(or later) with activated demo or any other commercial license.
    WARNING: DO NOT RUN SAMPLES ON PRODUCTION (LIVE) enviroment
    4. Copy 3CXPhoneSystem.ini from C:\Program Files\3CX Phone System\Instance1\Bin to the same folder where Visual Studio will output the binary files.


    Thank you very much for your help.
    Regards,
    Stephen
     
  2. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,602
    Likes Received:
    126
    Hello Stephen,

    Yes, that is the way to go. You need to create a C# program in Visual Studio, which will use the 3CX Call Control API. From there you can perform changes to the 3CX configuration using the API. Please note that the program needs to run in the 3CX server, and not remotely. Also, please note that you need to target .NET Core 1.0, as the API is targeting that version. If you use 3CX v15.5 SP3 (just the alpha has been released so far), then you need to target .NET Core 2.0, and you will need Visual Studio 2017.

    Kind regards.
    Ernesto.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cognos1

    Joined:
    Dec 18, 2015
    Messages:
    5
    Likes Received:
    0
    Thank you very much, Ernesto. Appreciate the extra tips regarding different versions,
    Regards,
    Stephen
     
Thread Status:
Not open for further replies.