Commit Graph
9 Commits
Author SHA1 Message Date
arystanbek 16ce9659db Merge pull request 'feat: L1->L2 agent pool and routing engine for voice escalation' (#4) from feature/l1-l2-routing-engine into main
deploy / deploy (push) Successful in 32s
2026-08-29 08:31:40 +00:00
didar 09bcf7457c feat: add AI_VOICE_AI_TIMEOUT_SECONDS for configurable voice timeout
deploy / deploy (push) Successful in 30s
2026-08-29 00:50:08 +05:00
Hermes Agent 2243f305b8 feat: L1->L2 agent pool and routing engine for voice escalation
Replaces the hardcoded single-extension redirect for AI->human call
escalation with a real Agent Pool + Routing Engine:

- agents/escalations/routing_rules tables (migration 0031), asterisk_call_links
  gains tenant_id/current_level/required_skills_json/priority.
- services/routing_service/engine.py: level/tenant/skill filtered agent
  selection with atomic (CAS) reservation, no double-booking.
- routing-service: /agents CRUD + /internal/routing/reserve-agent and
  /internal/routing/release-agent.
- asterisk-bridge-service: voice_ai.request_handoff now uses the Routing
  Engine automatically for any queue_code configured in
  ASTERISK_QUEUE_LEVEL_MAP_JSON (all other queue_codes keep the existing
  static ASTERISK_TRANSFER_TARGET_MAP_JSON behavior unchanged); new
  POST /asterisk/live-calls/{call_id}/escalations entrypoint; agent is
  released back to AVAILABLE and the escalation closed when the call ends.

Targets the Tele2 Kazgaz DID +77476456048 (from-tele2-kazgaz context) as the
first queue wired to real L2 routing instead of AI-only.

Known gap (documented in docs/architecture/l1-l2-routing-engine.md):
automatic no-answer retry-to-next-agent needs a small, separately reviewed
dialplan change and is left for a follow-up MR rather than guessed at blind.

Tests: services/routing_service/engine.py covered by
tests/test_routing_engine.py (selection filtering, atomic reservation,
release); existing test_asterisk_bridge_service.py and
test_routing_service_pg_counter.py suites still pass unmodified.
2026-08-28 16:22:32 +05:00
Magzhan Zhumabayev 866d96e560 Implement sales tenant pipeline events 2026-05-10 18:24:06 +05:00
arys f53af1f7dc sales fix 2026-05-09 09:16:06 +05:00
Yera All 1ff8fd7102 docs: recreate documentation structure with updated specs 2026-04-06 23:19:24 +05:00
Yera All 1497bb0feb feat(ai): Finalize voice operator persona and voice name flow 2026-04-06 23:19:24 +05:00
Your Name 6cebd8216c Automate source deployment on main 2026-04-04 03:10:08 +05:00
Yera All 5374c202d9 Initial import with GitLab CI/CD and registry deploy flow 2026-04-02 17:05:45 +05:00