Google Contacts to playSMS Phonebook


(Edrico Duero) #1

I’ve just ported the googlecontacts.py for Asterisk to playSMS. It allows you to centrally manage your phonebook in playSMS from Google Contacts.

  1. Setup Google 2-step verification.
  2. Install Python and mysql connector
    sudo apt-get install python python-mysql.connector
  3. Download and install argparse
  4. Download and install tlslite
  5. Download and install Gdata python client
  6. Download and install oauth2client
  7. Download gcontacts script googlecontacts.py (12.7 KB)
  8. Login to Google Developers Console
  • Create a new project
  • Enable the “Contacts API”
  • In the Credentials, download the json file by clicking the download icon
  • Save the file in googlecontacts.py folder and rename it as ‘client_secret.json’
  1. update MYSQL_USER and MYSQL_PWD in googlecontacts.py
  2. Test the script with the following command ./googlecontacts.py --noauth_local_webserver
  3. If you get a list of your contacts then run ./googlecontacts.py --playsms --noauth_local_webserver to actually load your contacts into the playSMS phone book.

Note:
Phonebook contacts are created under admin account. You can use --username to switch to different account.
If you are using Groups, you have to manually create in playSMS to sync with group membership.