It appears the SMS send tool does not serialize sends. Meaning if I send three SMS send commands simultaneously, it will not lock the LTE card and some of them are missed. The first one I find works almost every time, after that it is a hit or a miss whether they work or not.
I noticed that the failures seems to be more prevalent if I use the API to send the sms rather than the Mikrotik terminal.
For example, say I create a user account “sms” with password “sms”, and I have the miniLTE at 192.168.0.1 with LTE card at USB3 channel 3, with the recipient’s cell phone being 555-555-5555.
If I run this multiple times with three different phone numbers, the first one will always be received, but the other two are a hit or a miss whether they get the message or not.
/usr/bin/curl -k -u sms:sms -X POST “https://192.168.0.1/rest/tool/sms/send” -H “content-type: application/json” --data ‘{“port”:“usb2”,“channel”:“3”,“phone-number”:“+15555555555”,“message”:“This is a test”}’
I can resolve this by putting an flock around the command with a sleep 1 at the end, however, I have multiple servers that need to send SMS messages, so the flock won’t be effective in these situations, and I need the Mikrotik OS/API to handle the queuing and synchronization of the SMS sends.
Does anyone know a bit about this, and if there’s a way to control this?