I went on during a series of test, without much success:
*putting the SMS send block with the mode 'When sent' does not help detecting wrong numbers (returns success for unassigned number), but helps detect badly formed number (even if it is an unknown error)
*putting the sms send block with the mode 'when delivered' is perfect for detecting wrong number (not assigned ones) as you get the error 'com.llamalab.android.telephony.SmsPermanentDeliveryException: Incompatible destination'. I'm pretty sure even if i cannot test it right now that it is also the best option to detect a lack of credit on pre-paid subscription. But the issue here is that you block your flow till the sms is delivered to the remote device. ie if someone turns off his phone for 2 days, you flow will stop 2 days, which could be problematic.
I've a couple of questions here: i could easily use a fork to wait for the end of the block, but i suspect that the pilling up of forked process could quickly fill the memory of the phone? how many running fork could a phone handle ?
The other option would be to wait only like a few second to ensure that we did not get an error message and proceed. Is there a way to tell automate to move to next block after a few second of a block being stopped?
I also tested and validated the fact that if you try to send a sms while the GSM connectivity is down, the block will not detect the absence of network and stay stuck, even after the network is back. The best option (as far as i can tell) to solve the issue is to put a mobile service state before the sms send and test if it is in service. if no, you put another mobile service state and wait for service to become available again.
best
steph