6.6 KiB
6.6 KiB
.env.production Checklist (Track 9/11 QA Lab)
Use this checklist before enabling ASTERISK_BRIDGE_ENABLED=1.
1) File handling and secret hygiene
- Create local
.env.productionfrom.env.production.template. - Keep
.env.productionout of git (it is ignored in.gitignore). - Replace all placeholder values:
<replace-me><asterisk-linux-vm-host><platform_queue_id><platform_ai_queue_id_or_same_queue_id><postgres-host><rabbitmq-host>
- Verify that AMI/SFTP credentials are not copied into docs, commits, or screenshots.
2) Required environment variables
Core
DATABASE_URLpoints to PostgreSQL (not SQLite).INTERACTION_SERVICE_URLis reachable fromasterisk-bridge-service.VOICE_ADAPTER_SERVICE_URLis reachable.RECORDING_SERVICE_URLis reachable.
Track 9 bridge
ASTERISK_BRIDGE_ENABLED=1ASTERISK_AMI_HOST/ASTERISK_AMI_PORTare correct.ASTERISK_AMI_USERNAME/ASTERISK_AMI_SECRETare correct.ASTERISK_AMI_EVENT_PREFIX=MVPCCunless your dialplan intentionally changed it.ASTERISK_QUEUE_MAP_JSONcontains valid JSON object.- Every
queue_codein dialplan has a mapped platformqueue_id. ASTERISK_BRIDGE_AUTH_MODEchosen intentionally:legacy_headersfor Track 9 QA baselinebearer_firstfor transition hardeningbearerfor strict service-token mode
- If bearer mode is used,
APP_TOKEN_SECRETis the same across gateway/services/bridge runtime. ASTERISK_BRIDGE_AUTH_USER/ASTERISK_BRIDGE_AUTH_ROLEmatch expected service identity.VOICE_ADAPTER_TRUSTED_SERVICE_SUBJECTSincludessvc:asterisk-bridge.RECORDING_IMPORT_TRUSTED_SERVICE_SUBJECTSincludessvc:asterisk-bridge.- For strict Track 9.1 mode, set
RECORDING_IMPORT_ALLOW_ADMIN=0.
Track 11 call-control
ASTERISK_CALLCONTROL_ENABLED=1(в QA, если проверяете операторское управление звонком).ASTERISK_CALLCONTROL_ACTION_TIMEOUT_SECONDSзадан (рекомендуемо10).ASTERISK_OPERATOR_EXTENSION_MAP_JSONсодержит mappingoperator -> extension.- пример:
{"operator_a":"2001","operator_b":"2002"}
- пример:
ASTERISK_TRANSFER_TARGET_MAP_JSONсодержит mappingqueue_code -> extensionдля blind transfer.- пример:
{"voice_lab":"2001"}
- пример:
ASTERISK_CALLCONTROL_CLAIM_CONTEXTиASTERISK_CALLCONTROL_TRANSFER_CONTEXTсовпадают с dialplan contexts.
SFTP pickup
ASTERISK_SFTP_HOST/ASTERISK_SFTP_PORTare correct.ASTERISK_SFTP_USERNAME/ASTERISK_SFTP_PASSWORDare correct.ASTERISK_SFTP_BASE_PATHpoints to the recording directory (default/var/spool/asterisk/monitor).
Voice AI V1 staging
AI_VOICE_ENABLED=1only for the pilot queues you intend to test.AI_VOICE_QUEUE_CONFIG_JSONcontains the AI-first queue code from the dialplan.- example:
{"voice_lab_ai":{"mode":"ai_first","agent_profile":"voice_support","handoff_queue_code":"voice_lab","language":"ru"}}
- example:
AI_VOICE_RUNTIME_SERVICE_URLpoints to the HTTP runtime service, not the AudioSocket media endpoint.AI_VOICE_RUNTIME_TRUSTED_SERVICE_SUBJECTSincludessvc:ai-voice-runtime.AI_VOICE_ASR_PROVIDER/AI_VOICE_TTS_PROVIDERare set intentionally.ASTERISK_TRANSFER_TARGET_MAP_JSONincludes both the human and AI queue codes when they can hand off to the same operator group.- example:
{"voice_lab":"2001","voice_lab_ai":"2001"}
- example:
- On the Asterisk VM, leave
MVPCC_AI_AUDIOSOCKET_SERVICE=blank until the media listener is ready. - After the media listener is available, verify
app_audiosocket.sois loaded andMVPCC_AI_AUDIOSOCKET_SERVICE=<media-host>:<port>uses the raw AudioSocket address.
Event bus baseline (Track 8 compatibility)
EVENT_BUS_ENABLED=1in QA.EVENT_BUS_URLresolves to reachable RabbitMQ.
3) Preflight checks before first call
- Run migrations:
python scripts\migrate_core_db.py
- Run full regression:
pytest -q
- Start stack with production env loaded:
powershell -ExecutionPolicy Bypass -File scripts\start_track9_qa.ps1
- Bridge health:
GET /proxy/asterisk-bridge/healthreturnsok
- Bridge status:
GET /proxy/asterisk-bridge/asterisk/statusshowsami_connected=true
4) Acceptance checks after test call 1001 -> 7000
voiceinteraction created from Asterisk event flow.voice_eventscontain:call.startedwithpayload.source = "asterisk"call.endedfor the samecall_id
MVPCCRecordingReadyled to uploaded recording inrecording-service.- Playback works in
supervisor. - Для Track 11:
- оператор видит звонок в
/operator-> блокЖивые звонки claimработает и пишет action loghangupработаетblind transferработает
- оператор видит звонок в
- Run:
python scripts\asterisk_lab_smoke.py --base-url <gateway> --database-url <db> --require-recordingpython scripts\track9_check.py --base-url <gateway> --database-url <db> --require-recordingpython scripts\track9_collect_evidence.py --base-url <gateway> --database-url <db> --run-checks --require-recording
4.1) Voice AI control-plane smoke after test call 1001 -> 7100
MVPCCCallStartedusedQueueCode=voice_lab_ai.voice_ai_sessionsrow created for the call.ai_sessionsrow created withchannel=voice.- Interaction timeline contains
ai.session_started. - Operator UI shows an AI badge on the live or recent voice call card.
GET /proxy/asterisk-bridge/asterisk/live-calls/{call_id}/ai-summaryreturns200once the AI summary exists.- Human fallback path still works if
MVPCC_AI_AUDIOSOCKET_SERVICE=is blank.
5) Failure policy
- If failed bridge events exist, inspect:
GET /proxy/asterisk-bridge/asterisk/events?status=failed
- Retry after fixing root cause:
POST /proxy/asterisk-bridge/asterisk/events/{bridge_event_id}/retry
- Do not mark Track 9 accepted until failed bridge events are resolved or explicitly waived.
6) Track 9.2 cutover handoff
- Prepare track9-cutover-sheet.template.md.
- Follow track9-2-production-cutover.md for controlled Helm rollout.
- Use
scripts\track9_2_cutover.ps1first in dry-run mode, then with-Executeduring the approved window.