Hi all
after sending SMS when a movement is detected, I would like to make a phone call instead! :=)
On my Twilio dashboard, the following json request makes a phone call :
{
"sid": "CA76ed3f291e6738edbc85a8f1a5fbeec5",
"date_created": null,
"date_updated": null,
"parent_call_sid": null,
"account_sid": "ACddd5df3d096d9daf908cb1f07e553900",
"to": "+33676801613",
"to_formatted": "+3367xxx613",
"from": "+33644605349",
"from_formatted": "+336xxx5349",
"phone_number_sid": "PN8ca405d90817xxxxxf0ec3ac",
"status": "queued",
"start_time": null,
"end_time": null,
"duration": null,
"price": null,
"price_unit": "USD",
"direction": "outbound-api",
"answered_by": null,
"api_version": "2010-04-01",
"annotation": null,
"forwarded_from": null,
"group_sid": null,
"caller_name": null,
"uri": "/2010-04-01/Accounts/ACddd5df3d096d9daf90xxxxx6ed3f291e6738edbc85a8f1a5fbeec5.json",
"subresource_uris": {
"notifications": "/2010-04-01/Accounts/ACddd5df3d096d9daf908cb1f07e5539xxxxd3f291e6738edbc85a8f1a5fbeec5/Notifications.json",
"recordings": "/2010-04-01/Accounts/ACddd5df3d096d9daf908cb1f07e553900/Calls/xxxxx38edbc85a8f1a5fbeec5/Recordings.json"
}
}
Using this, could you help me to create the right webhook and firmware code allowing me do that ? the firmware code I used to send a SMS was the following, but not sure what I need to modify to do a phone call :
void setup() {
pinMode(A0, INPUT);
}
void loop() {
if (digitalRead(A0) == HIGH) {
Spark.publish("twiliosms", "something just happens", 60, PRIVATE);
while (digitalRead(D0) == HIGH); // hang tight here until motion stops
}
}
Thanks a lot for your great help ! It could be a great tutorial at the end of the day, and for sure I will write if we success to make it happen, thanks !