3CX Webhook generator

Created by Oleg Agapov, Modified on Wed, 18 May 2022 at 09:25 PM by Oleg Agapov

The “webhooks” module is used to integrate 3CX with third-party CRM systems. It is written in C #, implemented as a service and connects to 3CX at the time of start. As a result, the module continuously monitors the low-level telephone exchange activity and on this basis of monitoring generates a high-level events occur:
  • ringing
  • call start
  • call end

3CX Webhook generator sends  at the moment of each of the events https-request (webhook) on the address specified in the .ini file with certain data about the call.

Note: if an extension’s phone rang, and then stopped ringing, but the call did not end (went to another extension), then there is no such event (the extension’s phone stopped ringing, but the call did not end).

Description of the data that is transmitted via webhooks when events occur 

The phone rings at such and such extension number

  • event = ringing
  • callerid = Caller ID
  • did = external number the call was received from (incoming DID rule)
  • user = user extension 
  • usertype = ext/queue/other
  • id = unique call id (string value). If a call has come to the queue and the phone is sequentially or simultaneously ringing for several managers, then they will all have the same id.

Call started

  • event = hangupincoming / hangupoutgoing (Incoming or outgoing call)
  • callerid = External number participating in the conversationExtension
  • user =participating in the conversation
  • did = If the call is incoming, then the external number that received the call (DID- rule)
  • trtype = NotDef / Blind / Accomp (How the call was received: 1) a regular call, 2) a call received through a blind transfer, 3) a call received through an accompanying transfer)
  • Id = Unique call id (string value) The

Call ended

  • event = incoming / outgoing
  • callerid = External number
  • user = Internal number. If the call is missed, and it ended at the queue level, then this will be the queue extension
  • finishtype = Ok / Missed (How the call ended: successful (there was a conversation) or unsuccessful (i.e. when an outgoing call was called, but the other end did not picked up the phone, and when the call came in, no one answered the call on the 3CX side))
  • transfer = false / true (Did the call end completely, or went through the transfer to another extension)
  • title = As a phrase, detailed information about the call, which, in addition to the above includes: a) the name of the DID rule for an incoming call; b) if the call ended at the queue level, was a callback ordered; c) call duration
  • id = Unique call id (string value) The

call ID is formed as follows:

[date time]_[unique call number within the current 3CX session]-[call link number]

Example ID: 210701165649_698-2

Date and time correspond to the moment when the call arrived at the 3CX. A call link is a sequence number of a call in a single chain of transfers. When a call has just arrived at the PBX, and no one has answered it yet, the call link is equal to 0. As soon as someone answers, it is equal to 1. For each subsequent transfer, the call link is increased by 1. All calls in a single transfer chain have a date time and a unique number within the current session are the same. Such calls differ only in the link number.

Example:

https://webhook.site/?event=ringing&callerid=420774852629&user=106&usertype=other&did=PragueDID&id=211230100614_665-0
https://webhook.site/?callerid=420774852629&event=hangupincoming&user=106&did=PragueDID&trtype=NotDef&id=220106205945_755-1

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article