Dismiss Notice
We would like to remind you that we’re updating our login process for all 3CX forums whereby you will be able to login with the same credentials you use for the Partner or Customer Portal. Click here to read more.

Get active calls & Understanding 3CXDialer.log

Discussion in 'CRM / Helpdesk / App Integration' started by bugfix, Feb 10, 2017.

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

    Joined:
    Feb 10, 2017
    Messages:
    9
    Likes Received:
    2
    Hello,

    we are a big company and wand to/have to integrate the 3CX to our systems.
    Since there is no (state of the art) (REST-)API I wanted to ask if there is any chance of getting the infos abour active (ringing) callers out of the system.
    We found out that it is not possible via PostgreSQL because the insert-querys are made after hangup.

    So we now have to use the "3CXDialer.log" and parse the results.
    Can you give me some details of the columns used?

    Code:
    17.02.10 13:51:50.066|200002| Trc|75|0009|: Ins: Call(7) [Dialing] DN=10001 IP=10001 EP=066412345
    Attached: [sip_displayname=+4366412345;lookup_displayname=;inbound_did=+43000666;inbound_did_rule=;chid=0000015A281466B1_7;prevCalcontact=sip:11111111@sip02.vie.***.at:5060;caller_name=+4366412345]
    1: Date
    2: this is sometimes 200002, 200003 or 100018 - what is this?
    3: Trc or Inf -> it seems that I have to parse only Trc for the callers
    4: 50 or 75 - what is this?
    5: this is sometimes 0009, 0013, 0010, 0012, 0014 - what is this?
    6: Here are the detailed infos.

    Details seems to be DBG (I think I can ignore them?) and then Ins for Insert, Upd for Update and Del for Delete.
    When there is a new call I get some Inserts, when the call is established I get an Update and when the call is ended I get Delete of [Connection] - is this correct?

    Any help would by highly appreciated. Thank you!!

    Best regards,
    Harald
     
  2. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,616
    Likes Received:
    126
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. bugfix

    Joined:
    Feb 10, 2017
    Messages:
    9
    Likes Received:
    2
    Hi,

    and to integrate our systems we have to build our own api in this .net application?
    We want to access these infos from remote (other systems) - the .net has to run on the pbx-server so we have to write a second api on top of your api to get this done?

    Can you give me a short hint on the columns anyway?

    Best regards
     
  4. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,616
    Likes Received:
    126
    Yes, you need to consume the API locally from the same 3CX server. Then you can expose a REST API for remote access if you want.

    I do not recommend parsing the logs. Logs are very likely to change, so any update of the PBX can break your implementation... You better use the API, that's the way to go.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. bugfix

    Joined:
    Feb 10, 2017
    Messages:
    9
    Likes Received:
    2
    Hello. We are using your ISO which is based on Linux and we cannot install .net here, can we?
     
  6. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,616
    Likes Received:
    126
    You need to create a .NET CORE program. In Linux 3CX is running .NET CORE, so you can use Visual Studio to create a .NET CORE program and use the API from linux.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. bugfix

    Joined:
    Feb 10, 2017
    Messages:
    9
    Likes Received:
    2
    Are there any Examples or Tutorials for this?

    And could You please give me a little hint on the logs? Just in case...

    Thanks
     
  8. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,616
    Likes Received:
    126
    This article has a lot of samples on how to use the API:
    https://www.3cx.com/blog/docs/call-control-api/

    Regarding how to create a .NET CORE program, you can google it and you will get lots of tutorials and information.

    RE logs, I don't have the information you need, however I strongly discourage using that approach.

    Kind regards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. bugfix

    Joined:
    Feb 10, 2017
    Messages:
    9
    Likes Received:
    2
    Thank you - we will try to do it this way.

    But:
    Can you get the answer to my question from someone who has this info? I assume someone at 3CX has to know it ;-)
    Or don't you want to tell because it's magic?
    And of course - I got it that you strongly discourage, recommend not to use and find the API the better way.

    Thank you!
     
  10. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,616
    Likes Received:
    126
    Of course the dev team has the answer for the logs, but they're very focused on their work and I'm not allowed to ask that kind of questions to them. In any case, if you're going to parse the log, you should concentrate on the part on the right, which contains the call information. I think you should be able to do it without completely understanding the meaning of the numbers on the left...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    bugfix likes this.
  11. bugfix

    Joined:
    Feb 10, 2017
    Messages:
    9
    Likes Received:
    2
    The article you provided is for a 3cx installation running on windows, we are running the application on linux. Therefore you suggested to build an own REST-API againt your call control api as a .net core application. The problem is, there is no sensible way to reference a dll file in a net core application, just if the .ll is packaged in a nuget package. Can you update your article for linux installations or deliver a nuget package with the call control api?

    br
     
  12. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,616
    Likes Received:
    126
    Hi Harald,
    In a .NET CORE program you can still add references to DLLs by browsing from the file system. Just copy the file "3cxpscomcpp2.dll" from your linux server at "/usr/lib/3cxpbx" to your dev machine, and add a reference to that DLL. When you have your program ready, copy it to the same folder "/usr/lib/3cxpbx" and all the references will work.
    Kind regards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. bugfix

    Joined:
    Feb 10, 2017
    Messages:
    9
    Likes Received:
    2
    Hi,
    I just tried your solution, and got this error adding a refrence to the 3cxpscomcpp2.dll file to my project: Error.PNG
    VisualStudio Version 2015, netcore 1.0.0
    As I mentioned in the post above it needs to be in a NuGet package. Have you tried the solution yourself? Is there the possibilty of providing the 3cxpscomcpp2.dll as an NuGet Package?

    Best Regards.
     
  14. bugfix

    Joined:
    Feb 10, 2017
    Messages:
    9
    Likes Received:
    2
    Hi, I was able do add an .ddl file as reference to the procjet in VS2017 RC. And after compiling it and running on the remote machine in the /usr/lib/3cxbx directory i get following exception:

    Unhandled Exception: TCX.Configuration.Exceptions.PhoneSystemException: ConfigServer is not connected
    at TCX.Configuration.PhoneSystem.Connect()
    at TCX.Configuration.PhoneSystem.get_Root()
    at ShowGatewayParametersSample.Run()
    at PBXParameters.Program.Main(String[] args)

    How can i connect the ConfigServer?
    BR
     
  15. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,616
    Likes Received:
    126
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Thread Status:
Not open for further replies.