Skip to content

Instantly share code, notes, and snippets.

@dtolb
Created October 23, 2015 16:02
Show Gist options
  • Save dtolb/cc0518ec62a4b6f57fda to your computer and use it in GitHub Desktop.
Save dtolb/cc0518ec62a4b6f57fda to your computer and use it in GitHub Desktop.
Create a simple transfer with speak sentence with NodeJS XML
var xml = require('node-bandwidth').xml;
/// Start the XML response
var response = new xml.Response();
// Create the sentence
var speakSentence = new xml.SpeakSentence({sentence: "Thank you for calling, please wait while we connect you.",
voice: "paul", gender: "male", locale: "en_US"});
var transfer = new xml.Transfer({
transferTo: "+19198281234"
});
//Push all the XML to the response
response.push(speakSentence);
response.push(transfer);
// Create the xml to send
var bxml = response.toXml();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment