diff --git a/plugin/index.js b/plugin/index.js index feeaec5..ea66b2c 100644 --- a/plugin/index.js +++ b/plugin/index.js @@ -2,6 +2,33 @@ const express = require('express') const router = express.Router() +// The following endpoints are supported. +// +// /before_receive +// /route +// /before_route (only for PROTOCOL=ROUTE connectors) +// /before_send +// /after_send +// /before_dlr (gets dlrinfo) +// /after_dlr + +// The req.body contains the following fields. +// +// ccarg - from PLUGIN=pluginname:ccarg of the current connector +// qe - message or delivery report, with field names in uppercase +// result - for after_send and after_dlr +// dlrinfo - custom options for incoming delivery reports +// route - as returned by the previously called plugin + +// Output is a list of key=value entries, one per line. +// The key can be as follows. +// +// result - for before_receive, where non-zero means the message will be rejected +// route - the name of the outgoing connector, used for /route +// qe.OPTION_NAME - new value for a message option called "OPTION_NAME" +// dlrinfo.OPTION_NAME - for before_dlr, to return HLR lookup results: +// - OPTION_NAME can be mnc, mcc, msc, and imsi + router.post('/before_receive', (req, res) => { console.log('in before_receive') //, body:', req.body) const qe = req.body.qe