Transfert d'appel

Le transfert d'appel permet de déplacer une ligne active vers un nouveau contexte de conversation. Dans les callbacks client, callId reste stable tandis que conversationId changements.

Parmi les cas d'utilisation courants, on peut citer le routage dans les centres d'appels et le transfert des appels depuis le serveur vocal interactif (SVI) vers les agents.

Événement de transfert de client — onCallTransfer

client.on('callTransfer', (callId, newConversationId) => {
  console.log(
    `Call ${callId} was transferred to a new conversation ${newConversationId}`
  );
});
 client.setCallTransferListener { call, conversationId ->
     println("Received Call Transfer for call: $call  into the conversation: $conversationId")
 }
 client.setCallTransferListener((call, conversationId) -> {
     System.out.println("Call " + call + " was transferred to conversation " + conversationId);
     return null;
 });
 class CallTransferExampleDelegate: NSObject, VGVoiceClientDelegate {
     func voiceClient(_ client: VGVoiceClient, didReceiveCallTransferForCall callId: VGCallId, withConversationId conversationId: VGConversationId) {
         print("call: \(callId) has been transferred to conversation: \(conversationId)")
     }
     
     func voiceClient(_ client: VGVoiceClient, didReceiveHangupForCall callId: VGCallId, withQuality callQuality: VGRTCQuality, reason: VGHangupReason) {}
     func voiceClient(_ client: VGVoiceClient, didReceiveInviteForCall callId: VGCallId, from caller: String, with type: VGVoiceChannelType) {}
     func voiceClient(_ client: VGVoiceClient, didReceiveInviteCancelForCall callId: VGCallId, with reason: VGVoiceInviteCancelReason) {}
     func client(_ client: VGBaseClient, didReceiveSessionErrorWith reason: VGSessionErrorReason) {}
 }
 - (void)voiceClient:(VGVoiceClient *)client didReceiveCallTransferForCall:(VGCallId)callId withConversationId:(NSString *)conversationId {
     NSLog(@"Call %@ has been transferred to conversation %@", callId, conversationId);
 }

Attentes de l'État

  • callId: inchangé
  • conversationId: mis à jour dans la conversation de destination
  • session multimédia : se poursuit tout au long du processus de transfert

Transfert NCCO

L'exemple ci-dessous illustre la structure NCCO requise. La mise en œuvre concrète variera en fonction du langage et du framework utilisés pour votre backend.

const transferNcco = [
  {
    action: 'transfer',
    conversation_id: 'CON-destination-conversation-id'
  }
];

res.json(transferNcco);

Référence : Opération de transfert NCCO