tell how to enable debug port
[auerswald-callnotifier.git] / README.rst
1 ***************************************
2 Auerswald Callnotifier for COMpact 3000
3 ***************************************
4
5 Connects to the debug port of your Auerswald Compact 3000 telephony switchboard
6 and listens for incoming calls.
7 It will notify you whenever a call comes in.
8
9 It also listens for outgoing calls if you want that, and you can log
10 incoming and/or outgoing calls into a file or a database.
11
12 Callnotifier is able to resolve the names of calls via LDAP and the
13 caller location city names via OpenGeoDb.
14
15 .. contents::
16
17
18 ============
19 Installation
20 ============
21
22 1. Clone the git repository
23 2. Install dependencies
24 3. Configure the tool
25 4. Run ``./callnotifier.php``
26
27
28 Dependencies
29 ============
30 - PEAR's Console_CommandLine package
31 - PEAR's Net_LDAP2 package for LDAP name resolution
32 - curl for the dreambox notifier
33
34
35 =============
36 Configuration
37 =============
38
39 Compact 3000
40 ============
41 Enable the debug port by activating
42
43 - Configuration
44
45   - Server configuration
46
47     -  D channel output via IP D channel output via IP on/off
48
49 German:
50
51 - Einrichtung
52
53   - Serverkonfiguration
54
55     - D-Kanal über IP ausgeben D-Kanal über IP ausgeben ein-/ausschalten
56
57
58 Callnotifier
59 ============
60 Copy ``data/callnotifier.config.php.dist`` to ``data/callnotifier.config.php``
61 (same name, just no ``.dist``), open it in a text editor and adjust it to
62 your needs.
63
64 It contains examples for every plugin.
65 Adjust them as you need and remove the ones you do not need.
66
67
68
69 Call types
70 ==========
71 Logging plugins allow you to specify when calls shall be logged:
72
73 - ``startingCall`` - when the call is coming in, and the telephone rings
74 - ``finishedCall`` - when the call has ended
75
76 Furthermore you may decide which calls to log:
77
78 - ``i`` - Log incoming calls only
79 - ``o`` - Log outgoing calls only
80 - ``io`` - Log both incoming and outgoing calls
81
82
83 =======
84 Plugins
85 =======
86 There are two types of plugins: Detailler and Logger.
87 Detaillers load additional details to a call - e.g. a name - and loggers
88 can do anything, e.g. write a log file or send a XMPP message.
89
90 Detailler
91 =========
92 Plugins that fetch additional details to calls are named "detailler".
93
94 CallMonitor_Detailler_LDAP
95 --------------------------
96 The plugin determines the name for a telephone number by looking up a
97 LDAP directory.
98
99 It retrieves the name of the caller for incoming calls, and the name
100 of the telephonee for outgoing calls.
101
102 It searches the following LDAP attributes:
103
104 - ``companyPhone``
105 - ``homePhone``
106 - ``mobile``
107 - ``otherPhone``
108 - ``telephoneNumber``
109
110 Example configuration::
111
112     $callMonitor->addDetailler(
113         new CallMonitor_Detailler_LDAP(
114             array(
115                 'host' => 'ldap.home.cweiske.de',
116                 'basedn' => 'ou=adressbuch,dc=cweiske,dc=de',
117                 'binddn' => 'cn=readonly,ou=users,dc=cweiske,dc=de',
118                 'bindpw' => 'readonly'
119             )
120         )
121     );
122
123
124 CallMonitor_Detailler_OpenGeoDb
125 -------------------------------
126 The plugin determines the location (city) for a telephone number by
127 checking the area code (prefix number) against a OpenGeoDB SQL database.
128
129 If several locations share the same area code, the one with the most inhabitants
130 is used.
131
132 If you use this plugin, you need to run ``docs/opengeodb-create-my_orte.sql``
133 on the OpenGeoDB database to create an indexed table with all relevant
134 information needed by the plugin.
135
136 Example configuration::
137
138     $callMonitor->addDetailler(
139         new CallMonitor_Detailler_OpenGeoDb(
140             'mysql:host=dojo;dbname=opengeodb',
141             'opengeodb-read',
142             'opengeodb'
143         )
144     );
145
146
147 Logger
148 ======
149 Logger handle react on events like incoming or outgoing calls,
150 if they start or finish, or on any data received from the ISDN bus.
151
152 Available logger:
153
154 CallDb
155   Log calls in a SQL database
156 CallDreambox
157   Send messages on incoming calls to the DreamBox satellite
158   receiver
159 CallEcho
160   Log to the command line. Helpful for debugging.
161 CallFile
162   Log finished calls into a text file
163 CallFileTop
164   Log finished calls into a text file, newest on top
165 CallNotifySend
166   Use the unix ``notify-send`` command on starting and finished calls
167 CallSendXmpp
168   Send an XMPP headline message for incoming calls to one or multiple
169   users.
170
171
172 ============
173 Known issues
174 ============
175 Ctrl+C does not send the disconnect command.
176 This is a problem with PHP since pcntl_signal handling and blocking sockets
177 do not work together. The signal will not be handled.
178
179
180 =======
181 License
182 =======
183 Auerswald callnotifier is licensed under the terms of the GPLv3 or later.
184
185
186 ======
187 Source
188 ======
189 Original git website: http://git.cweiske.de/?p=auerswald-callnotifier.git
190
191 Mirror: https://github.com/cweiske/auerswald-callnotifier