Warm transfers
A Rep puts the customer on hold, talks to a colleague, a queue's next Rep or a number, then hands over. The Desk does this with "Consult first" in its Transfer dialog. From your code:
import { number, queue, rep } from '@hcc/sdk';
const consult = await hcc.calls.consult(callId, { repId: 'rep_1', target: rep('rep_2') });
// or target: queue('sales'), or number('+14155550100')
await consult.complete(); // hand over: the customer is with the target, and the Rep leaves
await consult.cancel(); // back to the caller
await consult.merge(); // everyone together- The customer hears hold music and neither Rep hears them.
completeandmergeare refused (409) until the target has joined. - The target fails: back to the caller. Busy, no answer or a queue with nobody takes the customer off hold, and
call.consult.endedsays why. Nothing has been transferred, so nothing is thrown in the flow and there's nocall.transfer.failed. - The Rep leaves. Once the target has joined, the call is handed over. While the target still rings it becomes a blind transfer, and a failure from there is like any other transfer's.
- A consult into a queue isn't a queue visit: no
queue_callsrow and noqueue.call.*Events. It goes to the front of the line, and an Offer unanswered for 60 s fails it. - The call's owner is the first Rep until completion, then the target. Only the owner's disposition lands on the call; anyone else's goes on the Timeline.
disposition.recordedhasowner: trueorfalse. - Recording. The Reps' talk isn't on the recording, which follows the customer's leg. When a recording is live, an external party hears the recording notice alone as they join.
- While one is live, a second consult, a transfer, hold, keypad tones and a supervisor's take-over are refused (409).
- Scopes. Starting and acting on one need
calls:write, reading onecalls:read. A developer's live key can't havecalls:write; their test key runs consults on simulated calls. - Events:
call.consult.started,call.consult.connected,call.consult.mergedandcall.consult.ended(withoutcome:completed,canceled,target_failed,target_leftorcaller_left). A completed one also publishescall.transfer.startedandcall.transfer.completed, withconsultId.