*** id: 654a4127-b81b-4478-b979-790043519d20 title: promptRingtone slug: /node/reference/voice/call/prompt-ringtone description: promptRingtone method for the Call class. max-toc-depth: 3 ---------------- [callprompt-7]: /docs/server-sdk/v3/node/reference/voice/call-prompt [types-1]: /docs/server-sdk/v3/node/reference/voice/types#collectdigitsconfig [types-2]: /docs/server-sdk/v3/node/reference/voice/types#collectspeechconfig [types-3]: /docs/server-sdk/v3/node/reference/voice/types#ringtonename ### promptRingtone * **promptRingtone**(`params`): `Promise` - See [CallPrompt][callprompt-7] for more details. Play a ringtone while collecting user input from the call, such as `digits` or `speech`. #### Parameters | Name | Type | Description | | :----------------------- | :------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------- | | `params` | `Object` | - | | `params.name` | [`RingtoneName`][types-3] | The name of the ringtone. | | `params.digits?` | [`CollectDigitsConfig`][types-1] | Configuration for collecting digits. You must either set this, or speech. | | `params.speech?` | [`CollectSpeechConfig`][types-2] | Configuration for collecting speech. You must either set this, or digits. Pass an empty object to use the default configuration. | | `params.duration?` | `number` | Duration of ringtone to play. Defaults to 1 ringtone iteration. | | `params.initialTimeout?` | `number` | Initial timeout in seconds. Default is 4 seconds. | | `params.volume?` | `number` | Volume value between -40dB and +40dB where 0 is unchanged. Default is 0. | #### Returns `Promise` - See [CallPrompt][callprompt-7] for more details. #### Examples Prompting for digits and waiting for a result: ```js const prompt = await call.promptRingtone({ name: "it", duration: 10, digits: { max: 5, digitTimeout: 2, terminators: "#*", }, }); const { type, digits, terminator } = await prompt.ended(); ``` Prompting for speech and waiting for a result: ```js const prompt = await call.promptRingtone({ name: "it", duration: 10, speech: { endSilenceTimeout: 1, speechTimeout: 60, language: "en-US", hints: [], }, }); const { type, text, terminator } = await prompt.ended(); ``` Prompting for speech and listening for results using the events: ```js call.on("prompt.started", (p) => { console.log("prompt.started", p.id); }); call.on("prompt.updated", (p) => { console.log("prompt.updated", p.id); }); call.on("prompt.failed", (p) => { console.log("prompt.failed", p.id, p.reason); }); call.on("prompt.ended", (p) => { console.log(prompt.ended, p.id, p.text); }); const prompt = await call.promptRingtone({ name: "it", duration: 10, speech: {}, }); ```