root/apps/python/trunk/README
@
543
| Revision 543, 6.4 kB (checked in by nadya, 4 years ago) |
|---|
| Line | |
|---|---|
| 1 | PyTel v0.1 |
| 2 | ========== |
| 3 | by Andrew McDonald <admcd.tel> |
| 4 | |
| 5 | PyTel is a collection of python bits and bobs for using .tel domains. |
| 6 | |
| 7 | The two main applications provided here are: |
| 8 | - E-mail lookup from .tel for the mutt mail client |
| 9 | - Telephone number and SIP URI lookup for Snom SIP phones |
| 10 | |
| 11 | The contents of the collection are: |
| 12 | pytel.py - main commandline tool |
| 13 | telsnom.py - cgi script for snom minibrowser |
| 14 | telsoap.py - library functions for telfriends SOAP services |
| 15 | telquery.py - library functions for .tel DNS queries |
| 16 | |
| 17 | Dependencies that are not part of the standard python distribution |
| 18 | are: |
| 19 | dnspython (found on Debian Linux in the python-dnspython package) |
| 20 | M2Crypto (found on Debian Linux in the python-m2crypto package) |
| 21 | |
| 22 | This file is the only documentation. Comments in the code are |
| 23 | more-or-less non-existant. |
| 24 | |
| 25 | pytel.py |
| 26 | -------- |
| 27 | |
| 28 | pytel.py is the main command line tool, and supports five commands: |
| 29 | init |
| 30 | refresh |
| 31 | query |
| 32 | emailquery |
| 33 | snomurl |
| 34 | |
| 35 | Configuration for telfriends access to private data |
| 36 | --------------------------------------------------- |
| 37 | |
| 38 | init initialises credentials and data for telfriends services. It |
| 39 | prompts the user for the telfriends web username and password, |
| 40 | displays the challenge and prompts for the response. (These pieces of |
| 41 | information can alternatively be provided on the command line). init |
| 42 | creates three files in ~/.pytel which are: |
| 43 | soapuser - telfriends member soap username/password |
| 44 | telkey.pem - RSA private key |
| 45 | friendlist.csv - CSV file containing friend domains and labels for |
| 46 | private data locations |
| 47 | |
| 48 | refresh uses the previously acquired credentials to refresh the |
| 49 | friendlist.csv file. |
| 50 | |
| 51 | General lookups |
| 52 | --------------- |
| 53 | |
| 54 | The pytel.py query command performs a query for any records for a |
| 55 | telname. If the .tel name is in the previously acquired friend list |
| 56 | then private entries are also shown. The output is presented in a tab |
| 57 | separated format. |
| 58 | |
| 59 | E-mail lookups for mutt |
| 60 | ----------------------- |
| 61 | |
| 62 | The pytel.py emailquery command queries for e-mail addresses for a |
| 63 | telname. If the .tel name is in the previously acquired friend list |
| 64 | then private entries are also shown. The output is in the format |
| 65 | required for external address query tools for the mutt mail client, |
| 66 | e.g.: |
| 67 | pytel.py emailquery henri.tel |
| 68 | henri.tel found 2 e-mail addresses: |
| 69 | henri@asseily.com Henri Asseily Main Contact |
| 70 | hasseily@telnic.org Henri Asseily Work (Telnic) |
| 71 | To use it from mutt add a setting to your .muttrc file: |
| 72 | set query_command="pytel.py emailquery %s" |
| 73 | |
| 74 | Snom SIP phone minibrowser |
| 75 | -------------------------- |
| 76 | |
| 77 | The Snom range of SIP phones contain a minibrowser capable of |
| 78 | interacting with the user using XML files supplied by a web server. |
| 79 | |
| 80 | To use the snom minibrowser service for .tel lookup the telsnom.py and |
| 81 | telquery.py scripts must be placed in the cgi-bin directory of the |
| 82 | webserver, and telsnom.py must be executable. |
| 83 | |
| 84 | The pytel.py snomurl command provides a URL for a snom phone to use |
| 85 | for the .tel search minibrowser service (telsnom.py). The hostname |
| 86 | where the CGI script must be provided on the command-line. In its |
| 87 | simplest form this URL will be of the form: |
| 88 | http://example.com/cgi-bin/telsnom.py |
| 89 | If credentials and friendlist have been previously acquired with the |
| 90 | init command, then the RSA key and friendlist are also encoded into |
| 91 | the URL: |
| 92 | http://example.com/cgi-bin/telsnom.py?telkey=-----BEGIN%20RSA%20PRIVAT |
| 93 | E%20KEY-----%0AMII ... %0A-----END%20RSA%20PRIVATE%20KEY-----%0A&frien |
| 94 | ds=henri.tel%2Ca1 ... |
| 95 | |
| 96 | If the "-n" or "--nopriv" option is given on the commandline then the |
| 97 | key and friendlist are omitted. |
| 98 | |
| 99 | To manually configure the phone: |
| 100 | On the web interface for the phone, go to the function keys page. Pick |
| 101 | a key (e.g. P12) and set the 'Type' to 'Action URL'. Paste the URL |
| 102 | provided by snomurl in the text box. Save the settings. |
| 103 | |
| 104 | To automatically configure the phone: |
| 105 | When running the snomurl command including the -u, -p, -t and -f |
| 106 | options to provide the phone username, password, hostname and function |
| 107 | key number respectively. The function key number from 1 to 12 will |
| 108 | select one of the function keys on the phone to configure. If these |
| 109 | options are provided then the action url is automtically set on that |
| 110 | function key on the phone. Note that in order for this to work "Use |
| 111 | hidden tags" must be set to "no" in the QoS/Security section of the |
| 112 | Advanced configuration. |
| 113 | |
| 114 | To use the .tel search facility: |
| 115 | On the phone, press the function key chosen. The ".tel Search" page |
| 116 | will appear. Enter a .tel domain name (the .tel extension may be |
| 117 | omitted) and press the OK (tick) key. Any voice:tel: or sip: URIs will |
| 118 | be displayed and may be selected. If a friendlist was available and |
| 119 | included in the action URL then pressing OK with an empty search will |
| 120 | display the list of known friends. |
| 121 | |
| 122 | If the friendlist is updated with the pytel.py refresh command, the |
| 123 | action URL should be regenerated with the snomurl command and |
| 124 | reconfigured on the phone. |
| 125 | |
| 126 | NB: the supported length of the action URL (and hence maximum |
| 127 | friendlist length is unknown). |
| 128 | |
| 129 | This has only been tested on a Snom 360. |
| 130 | |
| 131 | Changelog |
| 132 | --------- |
| 133 | v0.1 2009-09-26 - Initial public release |
| 134 | |
| 135 | Copyright notice |
| 136 | ---------------- |
| 137 | |
| 138 | Copyright (c) 2009, Andrew McDonald |
| 139 | All rights reserved. |
| 140 | |
| 141 | Redistribution and use in source and binary forms, with or without |
| 142 | modification, are permitted provided that the following conditions |
| 143 | are met: |
| 144 | |
| 145 | * Redistributions of source code must retain the above copyright |
| 146 | notice, this list of conditions and the following disclaimer. |
| 147 | |
| 148 | * Redistributions in binary form must reproduce the above |
| 149 | copyright notice, this list of conditions and the following |
| 150 | disclaimer in the documentation and/or other materials provided |
| 151 | with the distribution. |
| 152 | |
| 153 | * The name of the author may not be used to endorse or promote |
| 154 | products derived from this software without specific prior |
| 155 | written permission. |
| 156 | |
| 157 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 158 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 159 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 160 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 161 | COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 162 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 163 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 164 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 165 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 166 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
| 167 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 168 | POSSIBILITY OF SUCH DAMAGE. |
Note: See TracBrowser
for help on using the browser.








