Skip to content

Instantly share code, notes, and snippets.

@tomlynn
Last active January 9, 2017 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomlynn/265737c7ec0bfc1c510ac86ad21e2279 to your computer and use it in GitHub Desktop.
Save tomlynn/265737c7ec0bfc1c510ac86ad21e2279 to your computer and use it in GitHub Desktop.
Scheduled Reboot of Obi202 VoIP ATA

This node-red flow allows you to restart an Obi202 Voip Analog Telephone Adaptor (and likely other Obi ATAs) on a preset schedule. You must edit the URL in the www-request node to use the IP address of your Obi device, and provide basic http-auth information for this flow to work.

Updated 1/8/2017. Now checks for calls in progress. Will skip this reboot attempt if there is a call in progress, such as a late night 911 call.

Enjoy.

[{"id":"cc44fd6a.aa718","type":"inject","z":"89f05404.787d18","name":"Set Schedule","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"57 03 * * *","once":false,"x":120,"y":40,"wires":[["c72c5578.a42348"]]},{"id":"6b061f09.d7afe","type":"debug","z":"89f05404.787d18","name":"Debug Output","active":true,"console":"false","complete":"payload","x":792,"y":292,"wires":[]},{"id":"1ff33aa4.8ae8d5","type":"www-request","z":"89f05404.787d18","name":"No: Obi 202 Reboot URL","method":"GET","ret":"txt","url":"http://192.168.1.129/rebootgetconfig.htm","tls":"","x":764,"y":169,"wires":[["6b061f09.d7afe"]]},{"id":"c72c5578.a42348","type":"www-request","z":"89f05404.787d18","name":"Check Obi202 Calls Status Page","method":"GET","ret":"txt","url":"http://192.168.1.129/callstatus.htm","tls":"","x":176,"y":118,"wires":[["143e801a.413b1"]]},{"id":"143e801a.413b1","type":"html","z":"89f05404.787d18","name":"Check TD Element for Calls In Prograess","tag":"td","ret":"text","as":"multi","x":195,"y":182,"wires":[["a8ad6dad.cde94"]]},{"id":"a8ad6dad.cde94","type":"switch","z":"89f05404.787d18","name":"No/Yes","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"Number of Active Calls: 0","vt":"str"},{"t":"regex","v":"Number of Active Calls: 1|Number of Active Calls: 2","vt":"str","case":false},{"t":"else"}],"checkall":"true","outputs":3,"x":504,"y":183,"wires":[["1ff33aa4.8ae8d5"],["f0192208.561a4"],[]]},{"id":"f0192208.561a4","type":"change","z":"89f05404.787d18","name":"Yes: Set Failure Message","rules":[{"t":"set","p":"payload","pt":"msg","to":"Failed: Call in progress","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":537.5,"y":293,"wires":[["6b061f09.d7afe"]]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment