chore: push remaining local changes

This commit is contained in:
Yera All
2026-04-16 02:31:57 +05:00
parent 5af47991dc
commit 1206ff91ac
2 changed files with 67 additions and 1 deletions
+50
View File
@@ -104,6 +104,56 @@ def test_browser_softphone_config_route_returns_403_when_mapping_missing(monkeyp
assert response.json()["detail"] == "Browser softphone is not configured for this user"
def test_ai_voice_config_for_queue_promotes_legacy_ivr_ai_queues_to_voice_start(monkeypatch):
monkeypatch.setenv("AI_VOICE_ENABLED", "1")
monkeypatch.setenv(
"AI_VOICE_QUEUE_CONFIG_JSON",
json.dumps(
{
"ivr_support_ai_ru": {
"mode": "ai_first",
"agent_profile": "voice_support",
"handoff_queue_code": "ivr_support",
"language": "ru",
}
}
),
)
monkeypatch.setenv("ASTERISK_QUEUE_MAP_JSON", '{"ivr_support":"que_ivr_support"}')
config = bridge_module._ai_voice_config_for_queue("ivr_support_ai_ru")
assert config is not None
assert config["agent_profile"] == "voice_start"
assert config["stage"] == "voice_start"
assert config["handoff_queue_id"] == "que_ivr_support"
def test_ai_voice_config_for_queue_preserves_non_ivr_profiles(monkeypatch):
monkeypatch.setenv("AI_VOICE_ENABLED", "1")
monkeypatch.setenv(
"AI_VOICE_QUEUE_CONFIG_JSON",
json.dumps(
{
"voice_lab_ai": {
"mode": "ai_first",
"agent_profile": "voice_support",
"handoff_queue_code": "voice_lab",
"language": "ru",
}
}
),
)
monkeypatch.setenv("ASTERISK_QUEUE_MAP_JSON", '{"voice_lab":"que_voice_lab"}')
config = bridge_module._ai_voice_config_for_queue("voice_lab_ai")
assert config is not None
assert config["agent_profile"] == "voice_support"
assert config["stage"] is None
assert config["handoff_queue_id"] == "que_voice_lab"
def test_post_json_bearer_first_falls_back_to_legacy(monkeypatch):
class DummyResponse:
def __init__(self, status_code: int, body: dict):