Detail-call-statuses

Since Itgrix_bx v3.5.1 and Itgrix_amo v2.8.0, we have expanded the list of recognizable call statuses from just two (Successful and Missed) to almost all that are supported in CRMs.

Now we need Extra

At the same time, our requirements for setting up Asterisk have increased. To find out the result of the call, we need the "extra" field in the CEL table. If you haven't added it yet, call statuses will work in the old way with only two basic values.

Despite the temporary support for CEL without extra, it's better not to leave the settings that don't meet system requirements. We already rely on the content of extra for handling call interception and transfers, and will rely on it when developing new features.

If the new call statuses do not meet your expectations yet, you can temporarily disable them by making the extra field unavailable.

To do this, you need to set the value "id" instead of "extra" in the config field database.column_name_aliases.cel_extra. After that, the module will look in the id field instead of extra, won't see the expected data, and will work in the old way.

Don't forget to restart the service for the changes to take effect, and let us know what needs to be changed in the call statuses so that they work more correctly.

Statuses in Asterisk

Call statuses are based on a call property that is new to us - the result. This is the result of peer A's attempt to call peer B, expressed with a code from the SIP protocol. The codes are similar in appearance and meaning to the status codes of the HTTP protocol, for example, 404 means "not found", but in a telephony sense.

The call result is not a literal SIP status code, but the set of situations described by these codes is very fitting.

To determine the result of the call, we rely on the contents of the extra field. It contains hangup_cause and dial_status values set by Asterisk.
hangup_cause has values ​​from 0 to 127, and some of them correspond to one or more SIP status codes.
dial_status can be either empty or one of 9 values, such as "ANSWERED" or "CANCEL".
Both of these fields together allow us to determine the result of the call:

Hangup CauseDial StatusCall Result
0 Undefined0 Unknown - we process the call in the old way
anyCANCEL480 Temporarily unavailable
anyCHANUNAVAIL
CONGESTION
500 Server error
1 Unallocated
20 SubscriberAbsent
ANSWER200 Success
1 Unallocated
20 SubscriberAbsent
404 Not found
16 NormalClearingempty
ANSWER
200 Success
16 NormalClearingNOANSWER408 Request timeout
16 NormalClearingBUSY486 The subscriber is busy
17 UserBusy486 The subscriber is busy
18 NoUserResponse408 Request timeout
19 NoAnswer480 Temporarily unavailable
21 CallRejected603 Call rejected
26 AnsweredElsewhere200 Success
28 InvalidNumberFormat484 Not complete address
34 NormalCircuitCongestion
127 Interworking
500 Server error
38 NetworkOutOfOrder500 Server error
44 RequestedChanUnavailANSWER200 Success
44 RequestedChanUnavail500 Server error
58 BearercapabilityNotavail488 Can't access
66 ChanNotImplementedANSWER200 Success
66 ChanNotImplemented405 Method not supported

Obviously, not all 1280 possible combinations are considered here. Some hangup_cause values are not used by Asterisk, some combinations don't make sense or aren't possible, but most importantly, our preliminary research has shown that this set of combinations covers all common cases.
As new cases are discovered, we will add them to the list, but for now, they will be handled in the old way with two options.

Statuses in CRM

Each CRM has its own idea of what statuses a call can have. They depend on the point of view of a specific CRM on the role of calls in a business process and the model of employee interaction with a call. It is important that in CRM, users can both set and read the call status along with automation, and therefore, the list of options should be intuitive and not too large. We map our set of call results to this reduced set of statuses.

Bitrix24

Call statuses in Bitrix24 are based on SIP status codes, just like our call result, but with some differences:

StatusDescription from Bitrix24Display text example
200 Successful callthe request was successfully accepted, recognized and confirmedAn incoming call from ended. Successful call
304 Missed callfor this status, we took a non-standard codeMissed an incoming call from . Missed call
402 Insufficient funds on the accountpayment requiredYou cannot make a call, there are not enough funds on your account.
403 Forbiddensubscriber not registeredThe call to number <number> ended. Forbidden
404 Wrong numbercalled subscriber not found, no such SIP numberA call to number <number> is not possible. This route is not served.
423 Blockedthe server rejects the request because the interval is too short (or the number in the Bitrix24 blacklist)empty
480 Temporarily unavailableTemporarily unavailable destination, please try again laterSubscriber <number> temporarily unavailable.
484 This destination is not availablerequest received with incomplete addressA call to number <number> is not possible. This destination is not served.
486 Busysubscriber is busySubscriber <number> is busy on another call.
500 Internal server errora call to a subscriber who is not registered on the network, or turned off the phoneempty
503 This destination is not availablethe server is currently unable to service the call due to overload or maintenanceThe call to number <number> ended. This destination is not available
603 Canceledcall canceled due to network downtimeSubscriber <number> canceled the call.
603-S Call canceledthe called user does not wish to receive incoming calls without specifying a reason for the refusalThe call to number <number> has been canceled.

The final call status is determined by the call result and additional conditions:

Call resultAdditional conditionsStatus BX24
200 SuccessIncoming call unanswered304 Missed call
200 Success200 Successful call
404 Not found404 Wrong number
405 Method not supported405
408 Request timeout304 Missed call
480 Temporarily unavailable304 Missed call
484 Not complete address484 This destination is not available
486 Subscriber is busyIncoming call unanswered304 Missed call
486 Subscriber is busy486 Busy
488 Can't accept484 This destination is not available
500 Server error500 Internal server error
603 Call rejected603 Canceled
0 UnknownAnswered call200 Success call
0 UnknownUnanswered call304 Missed call

Kommo (former amoCRM)

Kommo call statuses are not based on SIP status codes. Instead, they are intended to be filled in by the user:

  1. Left a voice message
  2. Call back later
  3. Out of the office
  4. Conversation commenced
  5. Wrong number
  6. Didn't get through
  7. Number busy

In addition to the status, Kommo has a "Call Result" field that contains arbitrary text. We tried to use this text to make the status more intuitive.

Call data in Kommo is determined by call result as follows:

Call resultAdd conditionsStatus KommoText
200 SuccessIncoming call unanswered6 Didn't get throughMissed call
200 Success4 The conversation took placeSuccess call
404 Not found5 Wrong numberNumber out of service
408 Request timeout
480 Temporarily unavailable
3 Be awaySubscriber did not answer
488 Can't accept5 Wrong numberCarrier error
484 Not complete address5 Wrong numberInvalid number
486 Subscriber is busyIncoming call unanswered6 Didn't get throughNumber busy
486 Subscriber is busy7 Number busyNumber busy
603 Call rejected2 Call back laterCall rejected
0 UnknownAnswered call4 The conversation took place
0 UnknownUnanswered call6 Didn't get through

On this page