-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtinyphone_simple.html
More file actions
25 lines (25 loc) · 983 Bytes
/
tinyphone_simple.html
File metadata and controls
25 lines (25 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<html>
<body>
<script type="text/javascript" src="tinyphone_client.js"></script>
<script>
var phoneNumber = "13602260000";
var cr = "<br/>"; //add a line break to each addition to page.
tinyphone.init("yourserver.com",12003,phoneNumber);
tinyphone.on('connect', function(){
document.write("connected to tinyphone with phone number "+tinyphone.phoneNumber+cr);
});
tinyphone.on('new_call', function(caller){
document.write("new caller "+caller.callerNumber+" (label "+caller.callerLabel+"), id "+caller.id+", args ["+caller.args.join(", ")+"]"+cr);
});
tinyphone.on('keypress', function(caller){
document.write("received keypress '"+caller.keypress+"' from "+caller.callerNumber+cr);
});
tinyphone.on('audio_level', function(caller){
document.write("received audio level '"+caller.audioLevel+"' from "+caller.callerNumber);
});
tinyphone.on('hangup', function(caller){
document.write("caller "+caller.callerNumber+"( id "+caller.id+") hung up"+cr);
});
</script>
</body>
</html>