sms host change
This commit is contained in:
@ -372,14 +372,14 @@ async function commitMessage(now, logDevice) {
|
|||||||
const rawMsg = `${nopol} | OVERSPEED | ${time} | ${logDevice.speed} km/h | ${address}`.substring(0, 150).trim()
|
const rawMsg = `${nopol} | OVERSPEED | ${time} | ${logDevice.speed} km/h | ${address}`.substring(0, 150).trim()
|
||||||
// const rawMsg = `${nopol} | OVERSPEED | ${time} | ${logDevice.speed} km/h`.trim()
|
// const rawMsg = `${nopol} | OVERSPEED | ${time} | ${logDevice.speed} km/h`.trim()
|
||||||
const countryCode = process.env.SMS_COUNTRY_CODE ?? "670"
|
const countryCode = process.env.SMS_COUNTRY_CODE ?? "670"
|
||||||
const smsHost = process.env.SMS_HOST ?? "http://192.168.40.2:8181"
|
const smsHost = process.env.SMS_HOST ?? "http://192.168.40.2:8181/submitsm/ka"
|
||||||
|
|
||||||
await Promise.allSettled(
|
await Promise.allSettled(
|
||||||
users
|
users
|
||||||
.filter(u => u.phone)
|
.filter(u => u.phone)
|
||||||
.map(async (user) => {
|
.map(async (user) => {
|
||||||
try {
|
try {
|
||||||
await axios.get(`${smsHost}/mobicents/sendSms`, {
|
await axios.get(`${smsHost}`, {
|
||||||
params: { to: `${countryCode}${user.phone}`, msg: rawMsg, sender: "Overspeed FROTA" },
|
params: { to: `${countryCode}${user.phone}`, msg: rawMsg, sender: "Overspeed FROTA" },
|
||||||
})
|
})
|
||||||
} catch (smsErr) {
|
} catch (smsErr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user