Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@
import reactor.core.publisher.Mono;

import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import static com.azure.core.util.FluxUtil.monoError;
Expand Down Expand Up @@ -395,6 +397,13 @@ Mono<Response<AnswerCallResult>> answerCallWithResponseInternal(AnswerCallOption
= getTranscriptionConfigurationInternal(answerCallOptions.getTranscriptionConfiguration());
request.setTranscriptionConfiguration(transcriptionConfigurationInternal);
}
if (answerCallOptions.getCustomCallingContext().getSipHeaders() != null
|| answerCallOptions.getCustomCallingContext().getVoipHeaders() != null) {
CustomCallingContext customContext = new CustomCallingContext();
customContext.setSipHeaders(answerCallOptions.getCustomCallingContext().getSipHeaders());
customContext.setVoipHeaders(answerCallOptions.getCustomCallingContext().getVoipHeaders());
request.setCustomCallingContext(customContext);
}

return azureCommunicationCallAutomationServiceInternal.answerCallWithResponseAsync(request, context)
.map(response -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

package com.azure.communication.callautomation.models;

import java.util.HashMap;

import com.azure.core.annotation.Fluent;

/**
Expand Down Expand Up @@ -40,6 +42,11 @@ public final class AnswerCallOptions {
*/
private String operationContext;

/*
* Used by customer to send custom calling context to targets when answering On-Behalf-Of call
*/
private CustomCallingContext customCallingContext;

/**
* Constructor
*
Expand All @@ -49,6 +56,7 @@ public final class AnswerCallOptions {
public AnswerCallOptions(String incomingCallContext, String callbackUrl) {
this.incomingCallContext = incomingCallContext;
this.callbackUrl = callbackUrl;
this.customCallingContext = new CustomCallingContext(new HashMap<String, String>(), new HashMap<String, String>());
}

/**
Expand Down Expand Up @@ -148,4 +156,13 @@ public AnswerCallOptions setMediaStreamingConfiguration(MediaStreamingOptions me
this.mediaStreamingOptions = mediaStreamingOptions;
return this;
}

/**
* Get the Custom Calling Context.
*
* @return the customCallingContext.
*/
public CustomCallingContext getCustomCallingContext() {
return customCallingContext;
}
}
Loading