Skip to content

Instantly share code, notes, and snippets.

@marks
Forked from anonymous/inbound code tropo
Created March 22, 2012 22:19
Show Gist options
  • Save marks/2165044 to your computer and use it in GitHub Desktop.
Save marks/2165044 to your computer and use it in GitHub Desktop.
Tropo code for "hareem" on IRC
answer();
// if its me, ask me for a number to call
if(currentCall.callerID == "_your_phone_number_" || currentCall.callerID == "your_sip_url_"){
var result = ask("Enter the 10 digit phone number now.", {
  choices: "[10 DIGITS]",
  attempts: 3
});
transfer("tel:+1"+result.value,{
callerID : "111",
answerOnMedia : true
});
}
// otherwise, send them to my SIP URL
else {
say("Thank you for contacting Hareem", {voice:"Vanessa"});
say("Please wait while we transfer your call.", {voice:"Vanessa"});
transfer(["sip:hareem@iptel.org"], {
playvalue: "http://commondatastorage.googleapis.com/hmedia/gameshowtheme.mp3",
terminator: "*",
onTimeout: function(event) {
say("Sorry, but nobody answered Your Call");
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment