Guest User

Untitled

a guest
Feb 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. pi@raspberrypi:~/virtualenvironment/my_new_app/bin
  2.  
  3. sudo apt-get install libxslt
  4. sudo apt-get install libxml2
  5.  
  6. pip install plivo
  7.  
  8. (my_new_app) pi@raspberrypi:~/virtualenvironment/my_new_app/bin $ whereis libxslt
  9. libxslt: /usr/include/libxslt /usr/share/man/man3/libxslt.3.gz
  10.  
  11. import sys,os
  12. sys.path.insert(0, '/usr/include')
  13. sys.path.append('/usr/include')
  14. import plivo, plivoxml
  15.  
  16. auth_id = "Your AUTH_ID"
  17. auth_token = "Your AUTH_TOKEN"
  18.  
  19. p = plivo.RestAPI(auth_id, auth_token)
  20.  
  21. params = {
  22. 'to': '2222222222', # The phone numer to which the call will be placed
  23. 'from' : '1111111111', # The phone number to be used as the caller id
  24. # answer_url is the URL invoked by Plivo when the outbound call is answered
  25. # and contains instructions telling Plivo what to do with the call
  26. 'answer_url' : "https://s3.amazonaws.com/static.plivo.com/answer.xml",
  27. 'answer_method' : "GET", # The method used to call the answer_url
  28.  
  29. # Example for asynchronous request
  30. # callback_url is the URL to which the API response is sent.
  31. #'callback_url' => "http://myvoiceapp.com/callback/",
  32. #'callback_method' => "GET" # The method used to notify the callback_url.
  33. }
  34.  
  35. # Make an outbound call and print the response
  36. response = p.make_call(params)**Error:**
  37.  
  38. Python 2.7.13 (default, Jan 19 2017, 14:48:08)
  39. [GCC 6.3.0 20170124] on linux2
  40. Type "copyright", "credits" or "license()" for more information.
  41. >>>
  42. ===== RESTART: /home/pi/virtualenvironment/my_new_app/bin/make_calls.py =====
  43.  
  44. Traceback (most recent call last):
  45. File "/home/pi/virtualenvironment/my_new_app/bin/make_calls.py", line 4, in <module>
  46. import plivo, plivoxml
  47. ImportError: No module named plivoxml
  48. >>>
Add Comment
Please, Sign In to add comment