API in LInux

Status
Not open for further replies.

choimarc

Free User
Joined
Feb 19, 2014
Messages
81
Reaction score
10
Hello,

I'm trying to write an app to export some data to sql to use it in another app. I have found that I need to use net core or net standard (.net) to acheive this. I can compile my "hello world" test but I don't see how I can run it on my 3CX server (linux edition from iso on 3CX's site). It seems to be missing the dotnet command. When I try to do dotnet run, I get a "command not found". I'm using 3CX 15.5 SP4

Please help.

Marco.
 
Hello Marco,

Do you need to use a 3CX API to get the information? Maybe there is a simpler way, taking the data from CDRs for example... If you tell us what information you need, we can tell you the best approach you can take.

Regarding the .NET question, I would make that question in a Microsoft forum instead...

Kind regards.
 
Hello,

I need to use the 3CX API to get the information. I want to get the list of agents and their status and their last disconnected/connected time. I thought you were using .net for 3CX ?

Thanks.

Marco
 
Yes, you will need to use the 3CX Call Control API to get that information.

And yes, 3CX uses .NET Core 2.0, so you should be able to execute your .NET Core 2.0 program as well. But if you are having issues with that, probably in a Microsoft forum you will get faster and better help than here...
 
Hi,

The only thing I want to know is how do I execute my dll ? I saw in the forum that I need to use the command: dotnet "my app" to launch it. This does not work because the "dotnet" command does not exist. How do you launch your .net app ?

Thanks.
 
We have executables, not DLLs...
 
Thanks, I will look into that. I will report back once I figure it out.
 
Keep in mind that you don't have access to historical information via the API. You can get the current state of the agent, but I don't believe you can get historical information like "their last disconnected/connected time". For logging information you can only get this via 3CX reports, or by accessing the PostgreSQL database directly. I should stress that 3CX does not support and strongly discourages direct access to the PostgreSQL database. If you elect to go this route (accessing the database), you must be extraordinarily careful to ensure you make a read-only connection that does not place a lock on either the table or individual records. We do have a tool for this purpose (3CX Exporter) which can do this. While Exporter only runs on Windows, we do have a way of connecting to the PostgreSQL database running on Linux. We do this without making any changes to the PostgreSQL configuration by proxying a connection so it looks like it is coming from "localhost".
 
Hi,

I do not want historical data but only realtime.

Thanks.
 
I would be surprised if you can get the last disconnected / connected time via the API, but maybe you can?
 
There are no events for that, you would have to poll every few seconds to see which agents are logged in and which are logged out...
 
I know there is no "supported" way of getting this information and I'm probably on very thin ice, but you can get when an agent logged in / out of queues in the callcent_ag_queuestatus table. But my warnings stated above apply. The correct answer is probably "don't do it", but if you chose to do it, be very, very careful.
 
That's what I want to see, however I'm still stuck at compiling my program to work on debian. I program on windows. Any thoughts ? It keeps making a dll but I want a native debian executable.

Marco.
 
Just to answer the first question, a .Net core DLL works fine. It doesn't have to be a "native" Linux executable. Why your "dotnet run" command is not working is unclear. It works in my environment (3CX 15.5), but I've installed a desktop interface on my server and may have made other changes from the default 3CX iso.
 
Hi,

I haven't done any modification to my linux server. I have found how to compile the native file though :) I'm struggling with dependencies for now :)
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,323
Messages
591,896
Members
165,474
Latest member
costionofrei