ЕСОЗ - публічна документація
SMS statuses update
Purpose
In order to receive the final SMS status there is must be a job which automatically send request to IP2SMS and update status in verification.sms_log
Configuration
Process configuration
Parameter | Description | Value |
---|---|---|
SMS_STATUSES_SCHEDULE | (Cron Format) How often to perform termination (as for now it should be 1 minute) | `* * * * *` |
SMS_STATUSES_EXPIRATION | (Mins, integer > 0) sms lifetime | 35 |
Specification
Search candidates
1. Read SMS_STATUSES_EXPIRATION parameter value
2. Fetch records from VERIFICATION.sms_logs, where:
- status in ('Accepted', 'Enroute')
- inserted_at < now() - SMS_STATUSES_EXPIRATION
Change status
1. Update status and status_changed_at for all searched records:
- gateway_status = $status
- status_changed_at = $date
- updated_at = now()
Field name | Source | Description |
---|---|---|
id | ||
phone_number | ||
body | SMS text | |
type | ('verification', 'medication_request') | |
gateway_id | status_id from response | |
gateway_status | $status | SMS Status |
status_changed_at | $date | date from status response () |
updated_at | :timestamp | TIMESTAMP |
inserted_at | TIMESTAMP |
ЕСОЗ - публічна документація