Commit b203521a6e1ff477618cdc2465b694927a9b2dd1
1 parent
a3d37b06a9
Exists in
master
Process title
Showing 2 changed files with 6 additions and 0 deletions Inline Diff
config.sample.json
1 | { | 1 | { |
2 | "name": "SMS", | ||
3 | |||
2 | "# messaging_url": "messaging service url", | 4 | "# messaging_url": "messaging service url", |
3 | "messaging_url": "http://localhost:32979/", | 5 | "messaging_url": "http://localhost:32979/", |
4 | 6 | ||
5 | "# listen_port": "HTTP port untuk mendapat perintah dari CORE", | 7 | "# listen_port": "HTTP port untuk mendapat perintah dari CORE", |
6 | "listen_port": 16480, | 8 | "listen_port": 16480, |
7 | 9 | ||
8 | "handler_callback_server": { | 10 | "handler_callback_server": { |
9 | "# listen_port": "HTTP port untuk mendapat pesan masuk dari modem handler", | 11 | "# listen_port": "HTTP port untuk mendapat pesan masuk dari modem handler", |
10 | "listen_port": 16481, | 12 | "listen_port": 16481, |
11 | "apikey": "PLEASE_CHANGE_ME" | 13 | "apikey": "PLEASE_CHANGE_ME" |
12 | }, | 14 | }, |
13 | 15 | ||
14 | "number_suffix": "@phonenumber", | 16 | "number_suffix": "@phonenumber", |
15 | 17 | ||
16 | "modems": { | 18 | "modems": { |
17 | "SMS0": { | 19 | "SMS0": { |
18 | "url": "http://localhost:2110/sms", | 20 | "url": "http://localhost:2110/sms", |
19 | "apikey": "PLEASE_CHANGE_ME" | 21 | "apikey": "PLEASE_CHANGE_ME" |
20 | } | 22 | } |
21 | }, | 23 | }, |
22 | 24 | ||
23 | "do_not_trim_long_sms": false, | 25 | "do_not_trim_long_sms": false, |
24 | 26 | ||
25 | "default_modem": "SMS0", | 27 | "default_modem": "SMS0", |
26 | 28 | ||
27 | "# handler_chooser_algorithm": "algoritma untuk memilih modem dalam mengirim SMS. Pilihan: LAST-SEEN, FORCED. Default: LAST-SEEN", | 29 | "# handler_chooser_algorithm": "algoritma untuk memilih modem dalam mengirim SMS. Pilihan: LAST-SEEN, FORCED. Default: LAST-SEEN", |
28 | "handler_chooser_algorithm": "LAST-SEEN", | 30 | "handler_chooser_algorithm": "LAST-SEEN", |
29 | 31 | ||
30 | "# sending handler": "list modem yang dipakai untuk mengirim jika handler_chooser_algorithm === 'FORCED'", | 32 | "# sending handler": "list modem yang dipakai untuk mengirim jika handler_chooser_algorithm === 'FORCED'", |
31 | "sending_handler": [ | 33 | "sending_handler": [ |
32 | "SMS0", | 34 | "SMS0", |
33 | "SMS1" | 35 | "SMS1" |
34 | ], | 36 | ], |
35 | 37 | ||
36 | "redis": { | 38 | "redis": { |
37 | "host": "127.0.0.1" | 39 | "host": "127.0.0.1" |
38 | } | 40 | } |
39 | } | 41 | } |
index.js
1 | "use strict"; | 1 | "use strict"; |
2 | 2 | ||
3 | process.chdir(__dirname); | 3 | process.chdir(__dirname); |
4 | 4 | ||
5 | const fs = require('fs'); | 5 | const fs = require('fs'); |
6 | fs.writeFileSync('pid.txt', process.pid); | 6 | fs.writeFileSync('pid.txt', process.pid); |
7 | 7 | ||
8 | const config = require('komodo-sdk/config'); | ||
9 | process.title = `KOMODO-${(config && typeof config.name === 'string') ? config.name.toUpperCase() : 'SMS'}`; | ||
10 | |||
11 | |||
8 | require('./lib/transport'); | 12 | require('./lib/transport'); |
9 | require('./lib/handler-callback-server'); | 13 | require('./lib/handler-callback-server'); |