Speak command
The Speak command converts the given text to speech and plays it to the other party of the current API extension call. In case of third-party call control, it can also play it to the caller, callee or all. It is used when a spoken text has hundreds or thousands of outcomes and it would be too expensive to make pre-recorded sounds for every outcome. You can just put in variables in the text and they will be spoken. It is widely used in IVRs using variables, for example, it reads back the account number of the client.
Request parameters
Parameter name | Example value | Description | Mandatory |
CallId | 345fad34 | ID of the call to read the text to. If this command is in a response to a call notification, this parameter will be the ID of that call and can be omitted. | no |
Language | en-us | Select the language of the read text from the installed text-to-speech packages. | no |
Party | caller | Which party will hear the text read by the text-to-speech engine. It's value can be 'caller', 'callee' or 'all'. | no |
Text | Hello world | Text that the text-to-speech engine will read. | yes |
Voice | Microsoft Anna | Select the voice of the read text from the installed text-to-speech packages. | no |
Username | admin | Specifies the username. The username and password parameters are used to authenticate the user. | yes |
Password | abc123 | Specifies the password. The username and password parameters are used to authenticate the user. | yes |
Response parameters
Parameter name | Example value | Description | Mandatory |
Code | 200 | Returns the status code of the response. | yes |
Message | Command successfully executed | Returns th description of the response code. | yes |
NotificationName | CallConnected | Name of the notification request type. | no |
OzML example
This OzML example script below shows how easily you can use the Speak command to read out texts in different languages. You can also split the sentences that you want to hear by using the Delay command. With the Language attribute your speak engine has got the ability to read out texts written in different languages.
<?xml version="1.0"?> <Response> <Delay>1</Delay> <Speak>Congratulations, this is your first OzML Response command.</Speak> <Delay>2</Delay> <Speak>Have a nice day!</Speak> <Speak Language="en-UK"> Hello, this text will be read out in English language. </Speak> <Speak Language="pt-BR"> Olá, este texto será lido em Português. </Speak> <Hangup></Hangup> </Response>
Example request and response
URL request
Response
<?xml version="1.0"?> <Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Code>200</Code> <Message>Command successfully executed</Message> </Response>
More information
- Comando de transferencia asistida
- Comando de transferencia ciega
- Comando de llamada
- Comando de reenvío de llamada
- Comando para listar historial de llamadas
- Comando para colgar
- Comando para poner en espera
- Comando para listar llamadas activas
- Comando para listar extensiones
- Comando para listar tipos de extensión
- Comando para reproducir
- Comando para grabar
- Comando de solicitud
- Comando para enviar DTMF
- Hablar
- Comando para quitar de espera
- Comando para recibir mensaje
- Comando para enviar correo
- Comando para enviar mensaje
- Comando para enviar SMS
- Comando de arreglo
- Comando para emitir tono
- Comando para retraso
- Comando para eliminar archivo
- Comando para cada
- Comando para ir a
- Comando para mover archivo
- Comando para rechazar
- Comando para enrutar
- Comando para enviar notificación de alarma
- Comando para enviar mensaje
- Comando para entrada de usuario
- Comando para variable
- Comando para esperar mensaje
- Comando para configuración de llamada
- Comando para salir
- Listar contactos de agenda
- Comando para listar nombres de agenda
- Recibir notificación de alarma