Skip to content

Working with incoming calls#

Depending on the integration needs, the work with incoming call notifications can be realized in several ways:

  1. If you don't need to work with incoming calls, we recommend to do incomingCall notification resetting

    • When working with the notification handler, delete unknown types of notifications by the typeWebhook field, so all unnecessary notifications will be removed from the queue.
    • When working via HTTP API, delete notifications using deleteNotification method.
    • When working through Webhook Endpoint, give status code 200.
  2. If you need to receive only the fact of an incoming call, you can make a handler to receive the notification typeWebhook: incomingCall and monitor the status status: offer. All other statuses should be excluded from call processing.

  3. If you need to see only the result of the call and do not inform the operator about the incoming call, then you need to track and record in the chat all statuses except offer. You can also reduce the information on unanswered calls.

    For example:

    • When receiving a notification (typeWebhook: incomingCall + status: offer) - just reset the notification.
    • If other statuses are received, record in the chat with the conversation partner:

      pickUp - "Answered call"
      hungUp - "Missed call"
      missed - "Missed call"
      declined - "Missed call"

  4. If it is necessary to receive all call statuses, it is required to realize processing of all incomingCall type notifications. It is required to broadcast the call record to the chat when receiving a notification.

    For example:

    • Receive incoming call (typeWebhook: incomingCall + status: offer) - record in the chat Incoming call and inform the operator.
    • Call termination (for reasons: operator answer, call drop, waiting time expiration) - receive a notification (typeWebhook: incomingCall) and depending on the value of the status field make a record in the chat:

      pickUp - "Answered call"
      hungUp - "Dropped call" - the operator has dropped the call or the system has a setting or the Do Not Disturb function is activated on the phone (hung up)
      missed - "Missed call" - the caller has ended the call
      declined - "Missed call" - caller did not wait for an answer

Getting the name of the caller's interlocutor

  1. Get notification incomingCall about an incoming call, the from field contains the account number of the interlocutor.

  2. Use the GetContactInfo method to determine the information about the caller.

  3. Use the name or contactName fields from the GetContactInfo method to get the name of the caller.