Share via


Call Media - Hold

Hold participant from the call using identifier.

POST {endpoint}/calling/callConnections/{callConnectionId}:hold?api-version=2024-06-15-preview

URI Parameters

Name In Required Type Description
callConnectionId
path True

string

The call connection id.

endpoint
path True

string (url)

The endpoint of the Azure Communication resource.

api-version
query True

string

Version of API to invoke.

Request Header

Name Required Type Description
Authorization True

string

An Azure Communication Services user access token.

Request Body

Name Required Type Description
targetParticipant True

CommunicationIdentifierModel

operationCallbackUri

string

Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used.

operationContext

string

Used by customers when calling mid-call actions to correlate the request to the response event.

playSourceInfo

PlaySource

Prompt to play while in hold.

Responses

Name Type Description
200 OK

Returns the hold participant response

Other Status Codes

CommunicationErrorResponse

Error

Security

Authorization

An Azure Communication Services user access token.

Type: apiKey
In: header

Examples

CallMedia_Hold

Sample request

POST https://contoso.communications.azure.com/calling/callConnections/18dea47f-b081-4107-9a5c-4300819d2c6c:hold?api-version=2024-06-15-preview

{
  "targetParticipant": {
    "kind": "communicationUser",
    "communicationUser": {
      "id": "8:acs:b9614373-fd0b-480c-8fd2-cb58b70eab9f_0f50d091-5bd3-448b-884d-44be7037d9b9"
    }
  },
  "playSourceInfo": {
    "kind": "file",
    "file": {
      "uri": "https://some.file.azure.com/sample.wav"
    }
  }
}

Sample response

Definitions

Name Description
FileSource
HoldRequest

The request payload for holding participant from the call.

PlaySource
PlaySourceType

Defines the type of the play source

SsmlSource
TextSource
VoiceKind

Voice kind type

FileSource

Name Type Description
uri

string

Uri for the audio file to be played

HoldRequest

The request payload for holding participant from the call.

Name Type Description
operationCallbackUri

string

Set a callback URI that overrides the default callback URI set by CreateCall/AnswerCall for this operation. This setup is per-action. If this is not set, the default callback URI set by CreateCall/AnswerCall will be used.

operationContext

string

Used by customers when calling mid-call actions to correlate the request to the response event.

playSourceInfo

PlaySource

Prompt to play while in hold.

targetParticipant

CommunicationIdentifierModel

PlaySource

Name Type Description
file

FileSource

Defines the file source info to be used for play

kind

PlaySourceType

Defines the type of the play source

playSourceCacheId

string

Defines the identifier to be used for caching related media

ssml

SsmlSource

Defines the ssml(Speech Synthesis Markup Language) source info to be used for play

text

TextSource

Defines the text source info to be used for play

PlaySourceType

Defines the type of the play source

Value Description
file
text
ssml

SsmlSource

Name Type Description
customVoiceEndpointId

string

Endpoint where the custom voice was deployed.

ssmlText

string

Ssml string for the cognitive service to be played

TextSource

Name Type Description
customVoiceEndpointId

string

Endpoint where the custom voice was deployed.

sourceLocale

string

Source language locale to be played Refer to available locales here: <seealso href="https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/language-support?tabs=stt-tts" />

text

string

Text for the cognitive service to be played

voiceKind

VoiceKind

Voice kind type

voiceName

string

Voice name to be played Refer to available Text-to-speech voices here: <seealso href="https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/language-support?tabs=stt-tts" />

VoiceKind

Voice kind type

Value Description
male
female