Now comes the time to support and grow your application: you want to track user activity in real-time and regularly check that your script executes properly on Tropo servers. To do this you’ ll have to create a custom dashboard, or dig into Tropo script logs (which can be detailed).
This is where Cisco Spark can help. We’ll show you how to push your Tropo script activity into a Cisco Spark room in (near) real-time. At the end of the article, you’ll have your INFO and DEBUG log levels pushed to Spark.
Tropo DevOps with Cisco Spark
If you care about DevOps, you’ve already connected most of your critical backend applications and strategic delivery processes to your favorite real-time messaging platform to raise alerts or to simply share information instantly with colleagues. Let’s extend your DevOps practices to Tropo in 3 steps:
1. Create a Spark incoming webhook
From the Spark Web client, create a room to be used exclusively for Tropo Logs or pick an existing room.
In the right hand panel of the Spark Room, click “add Integrations” and choose “incoming integration”.
“If you do not see the “incoming integration panel”, there’s good chance you are not in the Spark WEB client, but a Desktop or Mobile Spark client.”
Name your integration. Tis name will be used to publish messages to the Spark Room as new log entries are created by your Tropo script.
Finally, copy your webhook URI suffix.
Copy/paste the Spark4Tropo.js code snippet at the top of your Tropo script.
Insert your Spark integrations suffix into the “YOUR_INTEGRATION_SUFFIX” placeholder. You may also want to identify your logs as they are pushed to the Spark room by changing the APPNAME.
3. Enhance your Script Business Logic
Replace your script’s logs by the debug() and info() functions provided by the Spark4Tropo.js code snippet.
Now run your code again, and watch Tropo logs showing up in Spark as your script gets executed.
You may create 2 Spark Rooms : one to follow Business activity (info logs in the example above), and the other one for Debugging Purposes (fine grained logs).