CFD application fails to compile

ghalse1

Customer
Joined
May 27, 2020
Messages
4
Reaction score
0
I have a call flow application that we've not used for some time, and that I need to bring back to life. It was originally created in CFD 18 on 3CX 18, and worked fine then.

When I uploaded the application to 3CX (20.0U8), I got a compile error. I originally assumed this was because my version of CFD was out of date (it was), so I updated it to CFD 20.2.84.0.

I then completely deleted both the build output and the Call Processing Script entry in 3CX, and did a clean build. The build completed without any errors or warnings in CFD 20.

However, when I upload the new build output to 3CX I get the same compile error. The console output shows:

Code:
:[59811..59827)E: (871,29)-(871,45): Error CS0266: Cannot implicitly convert type 'TCX.Configuration.IPhoneSystem' to 'TCX.Configuration.PhoneSystem'. An explicit conversion exists (are you missing a cast?)

            PhoneSystem ps = PhoneSystem.Root;

                             ^^^^^^^^^^^^^^^^

I'm not sure where to begin looking in my CFD app to debug this.
 
Hello ghalse1,

In your C# code, change the variable type from PhoneSystem to IPhoneSystem.
Line with: PhoneSystem ps = PhoneSystem.Root;
Change to: IPhoneSystem ps = PhoneSystem.Root;

Hope this will help you.

Paulo
 
Moreover, to let the compiler infer the type and avoid issues if this changes again in the future, just use var instead:
var ps = PhoneSystem.Root;
 
Thanks for the responses.

The thing is that I didn't write the code; Call Flow Designer did. So any changes I make to the generated code will be overwritten by subsequent rebuilds in Call Flow Designer.

Ideally, I'm trying to figure out how to get Call Flow Designer to generate code that compiles in 3CX.

I'm not sure whether what I am seeing is a bug in Call Flow Designer or something I need to change in the CFD project after upgrading from 18 to 20.
 
Ideally, I'm trying to figure out how to get Call Flow Designer to generate code that compiles in 3CX.

While it doesn't solve the underlying problem, as a workaround, I've tried making the changes to the generated code suggested here (with the caveat that they will need to be done every time CFD rebuilds).

The version suggested by @paulodagraca results in:
Code:
:[59794..59807)E: (871,12)-(871,25): Error CS0246: The type or namespace name 'IPPhoneSystem' could not be found (are you missing a using directive or an assembly reference?)

            IPPhoneSystem ps = PhoneSystem.Root;

            ^^^^^^^^^^^^^

But the inferred type version suggested by @edossantos_sipcaller does compile and seems to work.

So I guess the question is how I make CFD generate code with var rather than PhoneSystem.
 
While it doesn't solve the underlying problem, as a workaround, I've tried making the changes to the generated code suggested here (with the caveat that they will need to be done every time CFD rebuilds).

The version suggested by @paulodagraca results in:
Code:
:[59794..59807)E: (871,12)-(871,25): Error CS0246: The type or namespace name 'IPPhoneSystem' could not be found (are you missing a using directive or an assembly reference?)

            IPPhoneSystem ps = PhoneSystem.Root;

            ^^^^^^^^^^^^^

But the inferred type version suggested by @edossantos_sipcaller does compile and seems to work.

So I guess the question is how I make CFD generate code with var rather than PhoneSystem.
Did you update your Call Flow Designer to the latest version for v20? You need to manually download it. It won't find it automatically in the Check for Updates. Once updated, rebuild and retry.
 
Did you update your Call Flow Designer to the latest version for v20? You need to manually download it. It won't find it automatically in the Check for Updates. Once updated, rebuild and retry.
It's CFD version 20.2.84.0, which I downloaded from and reinstalled yesterday.

I got that from the download link in the v20 announcement at https://www.3cx.com/blog/releases/call-flow-designer-v20/. However, it also appears to be exactly the same link currently shown in the customer portal.

If there's a later version, I couldn't find it.
 
Hello ghalse1,

With the CFD you can use default components, but aso write your own code with an C# component.
Meaning this could be the case in your CFD script, where it would need the change as i did mention before.
Using the latest version CFD is the way, but you have this covered as I understand it.

Paulo
 
  • Like
Reactions: Evolute IT

Forum statistics

Threads
111,928
Messages
589,776
Members
164,799
Latest member
RicoDinero