Montesuma80 / 3cx-web-API

an local API to Controll your 3CX v16/v18 over HTTP
77 stars 38 forks source link

Compile issue (Debian) #22

Open castlerockconsult opened 1 year ago

castlerockconsult commented 1 year ago

Hi, My environment is as follows:

The PBX is a fresh install with all updates and the code is from the MASTER branch. I have updated the location of 3cxpscomcpp2.dll and removed the private/false line in WebAPICore.csproj. Below is the compile error:

voipl@3cx:~/3cx-web-API-Master$ dotnet build WebAPICore.csproj
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
/home/voipl/3cx-web-API-Master/update.cs(16,30): error CS0161: 'update.updateid(string, string)': not all code paths return a value [/home/voipl/3cx-web-API-Master/WebAPICore.csproj]
/home/voipl/3cx-web-API-Master/getcallid.cs(29,38): warning CS0618: 'ActiveConnection.HistoryIDOfTheCall' is obsolete: 'V14. This ID is not stored in call history database. So this property should not be used to store references' [/home/voipl/3cx-web-API-Master/WebAPICore.csproj]

Build FAILED.

/home/voipl/3cx-web-API-Master/getcallid.cs(29,38): warning CS0618: 'ActiveConnection.HistoryIDOfTheCall' is obsolete: 'V14. This ID is not stored in call history database. So this property should not be used to store references' [/home/voipl/3cx-web-API-Master/WebAPICore.csproj]
/home/voipl/3cx-web-API-Master/update.cs(16,30): error CS0161: 'update.updateid(string, string)': not all code paths return a value [/home/voipl/3cx-web-API-Master/WebAPICore.csproj]
    1 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.97

I'm not able to work out why the compile is failing as it looks like a generic issue but I can't see the cause.

Thanks.

castlerockconsult commented 1 year ago

I have looked further into this and can confirm that this can be resolved by adding a "return null;" at line 35 after the Console.WriteLine command within the catch.

m4aax16 commented 1 year ago

Thank you @castlerockconsult !

So basically just add inside the file update.cs after Console.WriteLine($"Update failed\n{ex}"); the line "return null;"