Fix voicemail and queue announcement issues
- Fixed phone agents getting 'Unauthorized' error when accessing voicemails by checking for twp_access_voicemails capability - Fixed missing ElevenLabs parameter in queue TwiML generation that prevented announcement messages - Fixed IVR voicemail messages not being saved correctly - now properly assigns message field based on action type - Added proper permission checks for both ajax_get_voicemail and ajax_get_voicemail_audio functions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3432,6 +3432,11 @@ class TWP_Admin {
|
||||
public function ajax_get_voicemail() {
|
||||
check_ajax_referer('twp_ajax_nonce', 'nonce');
|
||||
|
||||
if (!current_user_can('manage_options') && !current_user_can('twp_access_voicemails')) {
|
||||
wp_send_json_error('Unauthorized');
|
||||
return;
|
||||
}
|
||||
|
||||
$voicemail_id = intval($_POST['voicemail_id']);
|
||||
|
||||
if (!$voicemail_id) {
|
||||
@@ -3487,7 +3492,7 @@ class TWP_Admin {
|
||||
public function ajax_get_voicemail_audio() {
|
||||
check_ajax_referer('twp_ajax_nonce', 'nonce');
|
||||
|
||||
if (!current_user_can('manage_options')) {
|
||||
if (!current_user_can('manage_options') && !current_user_can('twp_access_voicemails')) {
|
||||
wp_send_json_error('Unauthorized');
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user