• V20: 3CX Re-engineered. Get V20 for increased security, better call management, a new admin console and Windows softphone. Learn More.

Changing extensions properties

Status
Not open for further replies.

Trestill

Platinum Distributor
Advanced Certified
Joined
Jan 22, 2015
Messages
61
Reaction score
6
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
 
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.
 
  • Like
Reactions: RafalR and Trestill
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
 
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.
 
Great help as always. Thank you
 
Status
Not open for further replies.

Getting Started - Admin

Latest Posts

Members Online Now

Forum statistics

Threads
141,622
Messages
748,861
Members
144,737
Latest member
damiano giannini
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.