Two members of the Phono/Tropo team, and soon a third member, have recently added new babies to their families. Congratulations Mark, Justin, and John!
All of this excitement got the hacker in me thinking… What would a modern Baby Monitor look like today? Armed with the Phono (http://phono.com) and Tropo (http://tropo.com) APIs, I started hacking and 2 hours later had the following example application to share with you!
Here’s the link to the demo. Let us know what you think! http://phonophone.heroku.com/babymonitor.html
Phono runs in the web browser to monitor activity in the room where it is running. Tropo is used to manage the baby monitor’s conference room (based on the access code) and the dial-in numbers to listen to the baby monitor via PSTN, Skype, SIP, or iNum. The Phono side of the conference is unmuted so you can hear activity while the Tropo side of the conference is muted. You can have many people (Mom, Dad, Grandparents, etc.) dialed in listening to the same baby monitor using any combination of the access channels listed above.
Shhh! This application is using the latest Phono V0.2 release with echo suppression :)
Here is the Phono source used in the demo:
003 | <meta http-equiv= "PRAGMA" content= "NO-CACHE" /> |
004 | <meta http-equiv= "Content-Type" content= "text/html; charset=utf-8" /> |
005 | <link href= "/stylesheets/babymonitor.css" rel= "stylesheet" type= "text/css" /> |
006 | <title>Phono Baby Monitor Demo</title> |
011 | <script type= "text/javascript" > |
014 | var randomnumber=Math.floor(Math.random()* 1001 ) |
015 | $(document).ready(function(){ |
017 | apiKey: "f12dc371538c...b43b6c594d" , |
018 | onReady: function() { |
019 | if ( ! this .audio.permission() ){ |
020 | this .audio.showPermissionBox(); |
022 | $( "a.callme" ).addClass( "phono-ready" ).text( "Start" ); |
025 | onConnect: function(event) { |
027 | onDisconnect: function(event) { |
028 | $(document).trigger( "callHangUp" ); |
034 | $( "a.callme" ).click(function(){ |
035 | $( ".digit-hldr" ).slideDown(); |
037 | $( "a.hangup" ).show().css( "display" , "block" ); |
042 | $( "a.hangup" ).click(function(){ |
043 | $(document).trigger( "callHangUp" ); |
047 | $(document).bind( "callHangUp" , function(){ |
048 | (call) ? call.hangup() : call = null ; |
049 | $( ".digit-hldr" ).slideUp(); |
050 | $( "a.hangup" ).hide(); |
051 | $( "a.callme" ).show(); |
056 | function makeCall() { |
057 | numberToDial = "app:9995555538" ; |
059 | call = phono.phone.dial(numberToDial, { |
071 | onAnswer: function(event) { |
074 | onHangup: function() { |
075 | $(document).trigger( "callHangUp" ); |
077 | onDisconnect: function() { |
078 | $(document).trigger( "callHangUp" ); |
087 | <h1>Baby Monitor Demo</h1><br/> |
088 | <p> Access Code: <script>document.write(randomnumber);</script><br/><br/><br/> |
089 | Voice: ( 267 ) 702 - 4977 <br/> |
090 | Skype Voice: + 990009369991483638 <br/> |
091 | SIP Voice: sip: 9991483638 @sip .tropo.com<br/> |
092 | INum Voice: + 883510001828861 <br/> |
096 | <a class = "callme" href= "#" >Loading...</a> |
097 | <a class = "hangup" href= "#" >Stop</a> |
Here is the Tropo Scripting API source code used in the demo:
01 | web = $currentCall.getHeader( "x-sbc-web" ) |
02 | babycode = $currentCall.getHeader( "x-sbc-babycode" ) |
16 | conferenceID = "babymon" + babycode.to_s |
23 | say 'Baby monitor active.' |
24 | conferenceID = "babymon" + babycode.to_s |
26 | say 'Baby monitor demo.' |
28 | result = ask "Please enter your access code followed by the pound key." , { |
29 | :choices => "[1-4 DIGITS]" , |
32 | conferenceID = "babymon" + result.value |
35 | conference(conferenceID,conferenceOptions) |
That’s all there is to it! This was a fun mini-project and using Phono and Tropo made building the VoIP-based Baby Monitor application a breeze!
No related posts.
Tags: baby monitor, conference, phono, sip, skype, tropo, voip
-->