Changing extensions properties

Discussion in 'Call Flow Designer' started by Trestill, Sep 20, 2017.

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

    Joined:
    Jan 22, 2015
    Messages:
    41
    Likes Received:
    1
    Hi,

    I'm super excited at new CFD build and functions that come with it. I see that it's now possible for example to get and set DN properties from call flow. I was trying to test this but can't figure out how.
    The simple test wat to get ID of extension that triggered call flow and write it to the file:
    upload_2017-9-20_16-35-14.png
    But all I get is new line in the output file. Log isn't helping at all:
    Code:
    17-09-20 16:26:03.366|100049| Trc|75|0004|: PlugIn[random_cid - Callflow - MainFlow - CallID SHEHWHNSMYLN] Trace: Start executing component 'TcxGetDnProperty1'
    17-09-20 16:26:03.372|100049| Trc|75|0004|: PlugIn[random_cid - Callflow - MainFlow - CallID SHEHWHNSMYLN] Trace: Start executing component 'ReadWriteFile2'
    17-09-20 16:26:03.379|100049| Trc|75|0004|: PlugIn[random_cid - Callflow - MainFlow - CallID SHEHWHNSMYLN] Trace: Start executing component 'mainAutoAddedFinalExitCallflow'
    What am I missing? Is it documented somewhere? Manual isn't very detailed on this https://www.3cx.com/docs/manual/cfd-components/#h.1qvnvylpx4nt

    Best Regards,
    Trestill
     
  2. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,254
    Likes Received:
    97
    Hi @Trestill,

    DN properties are not documented. You can browse them from the 3CX console, in Settings > Parameters. By default you see global parameters only, but if you set global property "DEVELOPMENT_DNTABLE_EXPOSE" = 1 then you will be able to see a new "DN Properties" tab and see what you have for specific DNs.

    3CX saves some information in the database with specific field names, but for some fields that are not available in every entity it uses these properties. The ID is a field common to every DN (extensions, queues, ring groups, etc.) so you will not see it as a DN Property. In order to get the ID for an extension, you need to get the Extension object (from the Call Control API) and then get the C# property DN.ID.

    The idea of these new components to read and write DN properties is that you can use them to save some configuration for the callflow. Then you can change this configuration from the console, without needing to re-deploy your app. This way the callflow can adapt its behavior to different conditions.

    In order to get the ID you just need to invoke:
    PhoneSystem.Root.GetDNByNumber("100").ID

    Kind regards.
    Ernesto.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Trestill likes this.
  3. Trestill

    Joined:
    Jan 22, 2015
    Messages:
    41
    Likes Received:
    1
    Hi Ernesto,

    thank you for pointers. Just one more question: how to use call flow variables in c# expression (I would like to use session.ani in place of static "100")

    Best Regards,
    Trestill
     
  4. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,254
    Likes Received:
    97
    Hi @Trestill,

    The compiler generated code for variables, for example session.ani, is the following:
    variableMap["session.ani"].Value

    The return value is an object, so you need to cast it to string. As a result, you can use the following expression:
    PhoneSystem.Root.GetDNByNumber(Convert.ToString(variableMap["session.ani"].Value)).ID

    Regards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Trestill

    Joined:
    Jan 22, 2015
    Messages:
    41
    Likes Received:
    1
    Great help as always. Thank you
     
Thread Status:
Not open for further replies.