Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

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

Logic

Update must be done 2 times a day according to schedule in Cron format - `* 1 * * *`

...

Configuration

Process configuration


ParameterDescriptionValue
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 lifetime35

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()


$status
Field nameSourceDescription 
id

phone_number

body 
SMS text, for verifications SMS body='VERIFICATION' gateway_id
type
('verification', 'medication_request')
gateway_id
status_id from response
gateway_status$statusSMS Status (see the table above)
status_changed_at$datedate from status response (date when status was changed)
updated_at:timestampTIMESTAMP
inserted_at
TIMESTAMP

...