Advertisement
Guest User

Guide to calling phones in Java

a guest
Jun 25th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. Hello! You will have to be decently self-sufficient and at least able to figure out what to do should an error happen or I don't explain something totally.
  2. Have the latest version of Eclipse installed.
  3. Instructions:
  4. 1. Figure out how to add a Maven dependency.
  5. 2. Add this to the list of dependencies:
  6. <dependency>
  7. <groupId>com.twilio.sdk</groupId>
  8. <artifactId>twilio</artifactId>
  9. <version>(7.11.0,7.12.0]</version>
  10. </dependency>
  11. 3. Add Maven Clean plugin to the build path as a referenced library
  12. 4. Right click on the project, Run As -> Maven Build...
  13. 5. In goals, write "clean verify"
  14. 6. Click run
  15. 7. Once it has finished downloading, create a class in src/main/java and paste the following code where appropriate:
  16. public static final String ACCOUNT_SID = "<account sid here>";
  17. public static final String AUTH_TOKEN = "<auth token here>";
  18.  
  19. public static void main(String[] args) throws URISyntaxException {
  20. Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
  21. Call call = Call.creator(new PhoneNumber("<number 1, including +1>"), new PhoneNumber("<number 2, including +1>"),
  22. new URI("http://demo.twilio.com/docs/voice.xml")).create();
  23. System.out.println("Call successful");
  24. }
  25. 8. Create a Twilio account
  26. 9. Find your auth token and account sid at: twilio.com/user/account and put them where appropriate
  27. 10. Add two numbers to https://www.twilio.com/console/phone-numbers/verified by clicking the red plus button and entering necessary information
  28. 11. Put the two numbers in the code where appropriate
  29. 12. Run the program!
  30. 13. Add automation to taste.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement