Relay operations reference for public inbound processing and forwarding into Corenil.
The relay receives public HTTPS callbacks, stores them safely in a spool, forwards them into Corenil, and exposes relay health for monitoring. The relay does not post to the ledger directly.
Hostname: relay.corenil.com
Endpoint: /inbound/c2b_confirmation
Status JSON: /relay_status.json
/var/www/cgi-bin/c2b_confirmation /usr/local/bin/c2b_forwarder /usr/local/bin/c2b_replay_one /usr/local/bin/c2b_quarantine_one /usr/local/bin/c2b_cleanup_old /usr/local/bin/relay_status /var/www/spool/c2b /var/www/spool/c2b_done /var/www/spool/c2b_failed /var/www/spool/c2b_quarantined /var/log/c2b_forwarder.log /var/www/htdocs/relay_status.json
doas rcctl check httpd doas rcctl check slowcgi
Both should report ok.
Healthy relay state:
doas ls -l /var/www/spool/c2b doas ls -l /var/www/spool/c2b_failed doas tail -20 /var/log/c2b_forwarder.log cat /var/www/htdocs/relay_status.json
Expected:
pending = 0 or low failed = 0 recent log lines show [OK]
doas /usr/local/bin/c2b_forwarder doas /usr/local/bin/relay_status
Use this after testing, after network recovery, or when checking backlog clearance.
List failed files:
doas ls -l /var/www/spool/c2b_failed
Replay one file:
doas /usr/local/bin/c2b_replay_one /var/www/spool/c2b_failed/<file>.json
Success means:
file moves to c2b_done log shows REPLAY_OK
Use quarantine when a failed file has been reviewed and should not be retried.
doas /usr/local/bin/c2b_quarantine_one /var/www/spool/c2b_failed/<file>.json
Success means:
file moves to c2b_quarantined log shows QUARANTINED
Remove old files from c2b_done and c2b_quarantined.
doas /usr/local/bin/c2b_cleanup_old 30
This keeps 30 days of retained files.
doas /usr/local/bin/relay_status cat /var/www/htdocs/relay_status.json
This regenerates the relay health JSON from current spool state.
curl -k -X POST \
-H 'Host: relay.corenil.com' \
-H 'Content-Type: application/json' \
--data '{"TransID":"TEST001","TransAmount":"100.00","MSISDN":"254700000001"}' \
https://192.168.8.2/inbound/c2b_confirmation
Expected response:
{"ResultCode":0,"ResultDesc":"Accepted"}
Public HTTPS ↓ c2b_confirmation CGI ↓ /var/www/spool/c2b ↓ c2b_forwarder ↓ Corenil /api/inbox_ingest ↓ core.inbox_event ↓ queue runner ↓ receipt ↓ ledger
PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin * * * * * /usr/local/bin/c2b_forwarder * * * * * /usr/local/bin/relay_status 15 2 * * * /usr/local/bin/c2b_cleanup_old 30
doas ls -l /var/www/spool/c2b doas ls -l /var/www/spool/c2b_failed doas tail -50 /var/log/c2b_forwarder.log doas /usr/local/bin/c2b_forwarder doas /usr/local/bin/relay_status
doas ls -l /var/www/spool/c2b_failed doas cat /var/www/spool/c2b_failed/<file>.json
Then either replay or quarantine.
doas rcctl check httpd doas rcctl check slowcgi doas pfctl -f /etc/pf.conf
doas /usr/local/bin/relay_status cat /var/www/htdocs/relay_status.json
Do not edit payload files unless absolutely necessary. Prefer replaying or quarantining the original file.
Corenil ingest is idempotent, so replay with the same TransID is safe.
For sandbox C2B testing, the shortcode used during URL registration must match the shortcode used during simulation.
If the shortcodes do not match, the simulator may accept the request, but the callback may not reach the relay endpoint.
Always verify these three together:
Open this page at:
https://relay.corenil.com/relay_ops.html