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
| package com.fork4.return2me.twilio; | |
| import com.twilio.sdk.TwilioRestResponse; | |
| public class IvrResponse { | |
| public static String callRedirect(String number) { | |
| StringBuilder response = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); | |
| response.append("<Response>"); | |
| response.append("<Say>Connecting you to your representative.</Say>"); |
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
| package com.fork4.return2me; | |
| import java.io.IOException; | |
| import java.util.HashMap; | |
| import javax.servlet.ServletException; | |
| import javax.servlet.http.HttpServlet; | |
| import javax.servlet.http.HttpServletRequest; | |
| import javax.servlet.http.HttpServletResponse; |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Response> | |
| <Gather action="http://return2me.elasticbeanstalk.com/fetch" | |
| numDigits="5" timeout="10" finishOnKey="#"> | |
| <Say>Return 2 Me Demo</Say> | |
| <Say>Enter the extension for your representative. Press pound to continue.</Say> | |
| </Gather> | |
| <!-- If customer doesn't input anything, prompt and try again. --> | |
| <Say>Sorry, I didn't get your response.</Say> | |
| <Redirect>http://return2me.elasticbeanstalk.com/ivr/incoming.xml</Redirect> |
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
| package com.fork4.return2me.twilio; | |
| import java.util.HashMap; | |
| import java.util.Map; | |
| import com.twilio.sdk.TwilioRestClient; | |
| import com.twilio.sdk.TwilioRestException; | |
| import com.twilio.sdk.TwilioRestResponse; | |
| import com.twilio.sdk.resource.factory.SmsFactory; | |
| import com.twilio.sdk.resource.instance.Account; |
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
| package com.fork4.return2me; | |
| import java.io.IOException; | |
| import java.security.SecureRandom; | |
| import java.util.HashMap; | |
| import javax.servlet.ServletException; | |
| import javax.servlet.http.HttpServlet; | |
| import javax.servlet.http.HttpServletRequest; | |
| import javax.servlet.http.HttpServletResponse; |
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
| package com.fork4.return2me.beans; | |
| public class Extension { | |
| final String repPhone; | |
| final String custPhone; | |
| final String extension; | |
| final boolean oneTimeUse; | |
| final boolean hasCustomerPhone; | |
| public Extension(String repPhone, String extension, String custPhone, boolean oneTimeUse) { |
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
| Twilio = Object.create({}) | |
| Twilio.TwiML = { | |
| build: function(fn) { | |
| var prolog = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; | |
| var Buffer = function(level) { | |
| var buffer = ""; | |
| var indent = function(i) { return new Array((i * 2) + 1).join(" ") } | |
| var level = level || 1; | |
| var append = function(str) { | |
| buffer += indent(++level) + str + "\n"; |
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
| <?php | |
| header('Content-type:text/xml'); | |
| $message = $_REQUEST['Body']; | |
| $response = ''; | |
| //our spreadsheet's key | |
| $key = "0Aoz1Ir-h-0g5dG00N1lDVG1COTFHellrc2o2bDhoeXc"; |
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
| <?php | |
| //set the upload directory for our CSV file | |
| $upload_path = "upload/"; | |
| //append the file name to our path so that we have a complete path | |
| $upload_path = $upload_path . basename( $_FILES['csv_file']['name']); | |
| //test to see if we can successfully move the file into our $upload_path directory | |
| if(move_uploaded_file($_FILES['csv_file']['tmp_name'], $upload_path)) { |
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
| <?php | |
| $ACCOUNT_SID = ''; | |
| $AUTH_TOKEN = ''; | |
| ?> |