Last active
May 25, 2016 16:03
-
-
Save ObjectIsAdvantag/97c2edd9d956958743e92a2df267bfa7 to your computer and use it in GitHub Desktop.
Tropo Script which test SMS end-to-end and bi-directional SMS connectivity for Europe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Is it an incoming call ? | |
if (currentCall) { | |
log("TROPO_EU_TESTERS, incoming call"); | |
log("TROPO_EU_TESTERS, callId: " + currentCall.id); | |
log("TROPO_EU_TESTERS, sessionId: " + currentCall.sessionId); | |
if (currentCall.channel == "VOICE") { | |
log("TROPO_EU_TESTERS, incoming call, network:VOICE"); | |
say("Thanks for joining Tropo Europe Testers service."); | |
wait(1000); | |
say("We welcome your responses via SMS only for now"); | |
wait(1000); | |
say("Please text your message to this number !"); | |
wait(1000); | |
} | |
else { | |
if (currentCall.channel == "TEXT") { | |
log("TROPO_EU_TESTERS, incoming call, network:SMS"); | |
log("TROPO_EU_TESTERS, incoming call, text: " + currentCall.initialText); | |
say("Thanks for joining Tropo Europe Testers service."); | |
} | |
else { | |
log("TROPO_EU_TESTERS, incoming call, network:UNKNOWN"); | |
say("Sorry we cannot process your message"); | |
hangup(); | |
} | |
} | |
} | |
// No call active, a new session will be started | |
else { | |
log("TROPO_EU_TESTERS, no session yet, this is an outgoing call"); | |
// Start an SMS session | |
call(testerNumber, { network:"SMS" }); | |
log("TROPO_EU_TESTERS, callId: " + currentCall.id); | |
log("TROPO_EU_TESTERS, sessionId: " + currentCall.sessionId); | |
// say("Hi Tropo Europe Tester, this SMS with trackID: " + trackID + " was delivered via: " + country + ". Please check the sender number is " + troponumber + ". If yes, respond and include your trackID. For example: received " + trackID + ". If no, send an SMS to XXXX"); | |
say("Tropo test: " + testID + ", sms sent from: " + tropoCountry + ", please check sender is: +" + tropoNumber + ", and respond CORRECT or WRONG. Thank you"); | |
hangup(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment