Reply on " send SMS "

Post your questions and help other users.

Moderator: Martin

Post Reply
Tordenfod
Posts: 32
Joined: 18 Sep 2014 15:20

Reply on " send SMS "

Post by Tordenfod » 27 Jan 2020 17:47

I want to send an SMS ( wake up SMS) on a specific time of the day and if no response, send it again until response is received.
Response could just be an SMS return... how do I approach the waiting time til new SMS is send and how to listen for response ?


Sorry if The anser to this is already in herre som where, but search Wont look for "SMS" witch leaves me with a s..t load of possibilities :shock:

ariloc
Posts: 109
Joined: 05 Jun 2016 21:36

Re: Reply on " send SMS "

Post by ariloc » 28 Jan 2020 04:36

Included in the Send SMS action, there's an option called Request delivery report, which when enabled, will return a delivery message back to the sender when it is received by the receiver. In order to detect this, when that report is activated, you can choose Synchronous with timeout, that will keep your flow stopped in that action until the delivery report arrives or the specified timeout runs out. When this option is enabled, there's a variable sms_delivery_report_status that gets created, so you can put an Expression condition after the action and check whether the message was delivered or not. As the help of AM suggests, values of that variable between 0 to 31 mean a successful delivery, and otherwise pending or error. So if you determine after that condition, that the SMS wasn't delivered, you can loop back to the Send SMS action, and it will keep running until the receiver gets the message. For the timeout, I think you're good with 5-10m.

Also, you can limit the SMS attempts within the action, and so when surpassing that limit, it will throw an exception which you can use to get notified with a notification, for example.

I attach a flow that may do what you need.

http://automagic4android.com/flow.php?i ... 89bd6bea5d

Tordenfod
Posts: 32
Joined: 18 Sep 2014 15:20

Re: Reply on " send SMS "

Post by Tordenfod » 29 Jan 2020 21:46

Bingo , that kinda nails it. Thanks a lot ! Couldn't quite understand the <31 thing in the help provided. A flow put the pieces together.. really appriciated the help !

Could the same thing be done with :time/call number / speak output.
So that, if the "speak output " is not delivered / the call is not answered, the flow will try again after a specified
time.. ?

ariloc
Posts: 109
Joined: 05 Jun 2016 21:36

Re: Reply on " send SMS "

Post by ariloc » 30 Jan 2020 04:56

Tordenfod wrote:
29 Jan 2020 21:46
Couldn't quite understand the <31 thing in the help provided.
You can check out the help of an action, condition or trigger if you click the '?' icon to the left of the action type, inside the UI for editing it. There, it specifies that the value written to the variable I mentioned before, which gets created when you request the delivery report, will be between 0-31 if it was delivered, otherwise means it's pending (32-63) or threw error (>64). So all values above 31, in your case, mean that the message wasn't delivered, so I check for that.
Tordenfod wrote:
29 Jan 2020 21:46
Could the same thing be done with :time/call number / speak output.
So that, if the "speak output " is not delivered / the call is not answered, the flow will try again after a specified
time.. ?
You can maybe use trigger Outgoing Call with phone state Ended. The problem with that is, as far as I know, will trigger not only in call not answered, but also when it finished after it was answered. Maybe you can adjust it to your purpose with the variables it provides (mentioned in the help). I also think about measuring time between off-hook and ended state, or look if the first state wasn't triggered, or similar, to determine that the call was ended because it wasn't answered (I haven't done much flows around calls, so I may need to do a little bit of testing to see the behavior of AM in those states).

Tordenfod
Posts: 32
Joined: 18 Sep 2014 15:20

Re: Reply on " send SMS "

Post by Tordenfod » 25 Feb 2020 20:43

Thanks for your answer, helped me a lot... 👍

With help provided I meant the "help file" 😏 not your answer... That made totally sense
Why 1 to 31? Just out of cure curiosity....

Would it be possible to build an extra layer on the first message. Saying- if reply by a 8 then send X message
If 9 reply by Y message...
Sort of related to the "I don't understand the 1-31 frame"

ariloc
Posts: 109
Joined: 05 Jun 2016 21:36

Re: Reply on " send SMS "

Post by ariloc » 27 Feb 2020 01:16

I tried to search for information about it and I couldn't find anything that explains it, other than there are many we error messages about SMS delivery report given by carriers, but as it's stated in the AM documentation like fixed ranges, it doesn't justify it. Maybe @Martin can answer that peculiar decision around making that variable take those specific range of values.

Post Reply