Fix voicemail access and ElevenLabs voice loading issues
- Changed create_voicemail_twiml() from private to public method to fix fatal error when accessing voicemail from IVR - Added auto-loading of ElevenLabs voices when switching to TTS option for new workflow steps - Voices now load automatically when user selects "Use Text-to-Speech" radio button 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1701,6 +1701,15 @@ jQuery(document).ready(function($) {
|
|||||||
// Show the appropriate options based on selection
|
// Show the appropriate options based on selection
|
||||||
if (audioType === 'tts') {
|
if (audioType === 'tts') {
|
||||||
$ttsOptions.show();
|
$ttsOptions.show();
|
||||||
|
|
||||||
|
// Auto-load voices if they haven't been loaded yet
|
||||||
|
var $voiceSelect = $ttsOptions.find('.voice-select');
|
||||||
|
if ($voiceSelect.length && $voiceSelect.find('option').length <= 1) {
|
||||||
|
// Check if API key exists before auto-loading
|
||||||
|
if (twp_ajax.has_elevenlabs_key) {
|
||||||
|
loadWorkflowVoices($voiceSelect[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (audioType === 'audio') {
|
} else if (audioType === 'audio') {
|
||||||
$audioOptions.show();
|
$audioOptions.show();
|
||||||
}
|
}
|
||||||
|
@@ -697,7 +697,7 @@ class TWP_Workflow {
|
|||||||
/**
|
/**
|
||||||
* Create voicemail TwiML
|
* Create voicemail TwiML
|
||||||
*/
|
*/
|
||||||
private static function create_voicemail_twiml($step, $elevenlabs) {
|
public static function create_voicemail_twiml($step, $elevenlabs) {
|
||||||
$twiml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><Response></Response>');
|
$twiml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><Response></Response>');
|
||||||
|
|
||||||
// Debug logging
|
// Debug logging
|
||||||
|
Reference in New Issue
Block a user