Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added machineDetection to the call method

  • Loading branch information...
commit 92eb00435a53ec6a2f5c65d3483ddb56259e7c2c 1 parent 6200d8a
@kevinbond kevinbond authored
Showing with 15 additions and 3 deletions.
  1. +8 −1 lib/base.js
  2. +7 −2 lib/tropo-webapi.js
View
9 lib/base.js
@@ -19,7 +19,7 @@ Ask = function(choices, attempts, bargein, minConfidence, name, recognizer, requ
this.speechIncompleteTimeout = speechIncompleteTimeout;
};
-Call = function(to, answerOnMedia, channel, from, headers, name, network, recording, required, timeout, allowSignals) {
+Call = function(to, answerOnMedia, channel, from, headers, name, network, recording, required, timeout, allowSignals, machineDetection) {
this.to = to;
this.answerOnMedia = answerOnMedia;
this.channel = channel;
@@ -31,6 +31,7 @@ Call = function(to, answerOnMedia, channel, from, headers, name, network, record
this.required = required;
this.timeout = timeout;
this.allowSignals = allowSignals;
+ this.machineDetection = machineDetection;
};
Choices = function(value, mode, terminator) {
@@ -64,6 +65,11 @@ LeavePrompt = function(value, voice){
this.voice;
}
+MachineDetection = function(introduction, voice){
+ this.introduction = introduction;
+ this.voice = voice;
+}
+
Message = function(say, to, answerOnMedia, channel, from, name, network, required, timeout, voice) {
this.say = serializeProperty(say);
this.to = to;
@@ -228,6 +234,7 @@ exports.Conference = Conference;
exports.Hangup = Hangup;
exports.JoinPrompt = JoinPrompt;
exports.LeavePrompt = LeavePrompt;
+exports.MachineDetection = MachineDetection;
exports.Message = Message;
exports.On = On;
exports.Record = Record;
View
9 lib/tropo-webapi.js
@@ -13,8 +13,8 @@ TropoWebAPI.prototype.ask = function(choices, attempts, bargein, minConfidence,
this.tropo.push({"ask": ask});
};
-TropoWebAPI.prototype.call = function(to, answerOnMedia, channel, from, headers, name, network, recording, required, timeout, allowSignals) {
- var call = new base.Call(to, answerOnMedia, channel, from, headers, name, network, recording, required, timeout, allowSignals);
+TropoWebAPI.prototype.call = function(to, answerOnMedia, channel, from, headers, name, network, recording, required, timeout, allowSignals, machineDetection) {
+ var call = new base.Call(to, answerOnMedia, channel, from, headers, name, network, recording, required, timeout, allowSignals, machineDetection);
this.tropo.push({"call": call});
};
@@ -38,6 +38,11 @@ TropoWebAPI.prototype.leavePrompt = function(value, voice) {
this.tropo.push({"leavePrompt": leavePrompt});
};
+TropoWebAPI.prototype.machineDetection = function(introduction, voice) {
+ var machineDetection = new base.machineDetection(introduction, voice);
+ this.tropo.push({"machineDetection": machineDetection});
+};
+
TropoWebAPI.prototype.message = function(say, to, answerOnMedia, channel, from, name, network, required, timeout, voice) {
var message = new base.Message(say, to, answerOnMedia, channel, from, name, network, required, timeout, voice);
this.tropo.push({"message": message});
Please sign in to comment.
Something went wrong with that request. Please try again.