This commit is contained in:
Lizandro Guarnizo
2026-01-26 00:04:12 -05:00
parent b0107df7f2
commit 4b9c74e5d7
4 changed files with 90 additions and 35 deletions
+4 -7
View File
@@ -1082,15 +1082,12 @@ class BotService {
if (function_exists('writeLog')) writeLog('INFO', "Operator {$operatorId} finished attending for {$phoneNumber}, survey={$template}");
// Ensure consistent behavior: release hold / clear flags when finishing attend
// Do NOT send the main menu nor notify the user that the conversation is resumed.
try {
// Release hold silently to avoid duplicate notification after finishing attend
$this->releaseHold($phoneNumber, false);
// Re-send main menu/topic so the user sees the menu after the advisor finishes
try {
$this->showMainMenu($phoneNumber);
} catch (Exception $e) {
error_log('finishAttendConversation: showMainMenu failed: ' . $e->getMessage());
}
// Send notification that conversation has been resumed, but do NOT auto-send the menu.
$this->releaseHold($phoneNumber, true);
// Intentionally not calling showMainMenu or sending a 'conversation resumed' message here.
} catch (Exception $e) {
error_log('finishAttendConversation: releaseHold failed: ' . $e->getMessage());
}