[EVENT]

A Call's State Changes

A call_new_state event occurs any time the state of a call is changed - for example, when it is answered, or when it ends. This event contains information about the call, the operator responsible for the call at the time, the new state, and assorted other relevant details. If the call has ended, this event will also list a code and description for the reason it ended.

Parameters

operator_id number

The unique number associated with the operator currently responsible for the call.

Calls may simultaneously have multiple states if there is more than one operator involved.

For example, if a call is allocated to one operator, but they have initiated an enquiry call to another operator, a separate call_new_state event is raised for each operator involved.

operator_call_end_reason_code number If the call has ended, this code indicates the reason why.
operator_call_end_reason_text string A short description of why the call ended, as dictated by operator_call_end_reason_code.
call_id number

The unique number allocated to the call by TelXL.

new_state number A number representing the call state.
status_text string A short message associated with the new_state, describing that state in human-readable terms.
recording_audio object

Details relating to any audio recording of the call.

Refer to The recording_audio Object for details.

The recording_audio Object

recording_audio_status number

1 if recording

0 if not recording

recording_audio_status_desc string

"In progress" if recording

"Not recording" otherwise

recording_audio_control number

1 When control is allowed

0 When control is not allowed

recording_audio_control_desc string

Corresponds with recording_audio_control.

Can be "Allowed" or "Not allowed".

recording_audio_suspended number

1 if suspended (only applicable to calls with recording in progress, where control is allowed)

0 otherwise

recording_audio_suspended_desc string

Corresponds with recording_audio_suspended.

Either "Suspended", or an empty string if not suspended.

recording_audio_highlighted number

1 if the call is highlighted (which can only be done if it is being recorded)

0 otherwise

recording_audio_highlighted_desc string

Corresponds with recording_audio_highlighted.

Either "Highlighted", or an empty string if not highlighted.

recording_audio_last_message string A description of what caused this event, such as "Started recording", "Resumed", and similar.

Example Response

Copy
{"event":{"event_type":"call_new_state","operator_id":5577,"operator_call_end_reason_code":27,"operator_call_end_reason_text":"Operator hung up","call_id":105395,"new_state":200,"status_text":"Operator hung up at 11:24:31","recording_audio":{"recording_audio_status":0,"recording_audio_status_desc":"Not recording","recording_audio_control":1,"recording_audio_control_desc":"Allowed","recording_audio_suspended":0,"recording_audio_suspended_desc":"","recording_audio_highlighted":0,"recording_audio_highlighted_desc":"","recording_audio_last_message":"Not being recorded (cannot resume)"}}}