GS/* phonebook v0.8a http://lxtek.de/gsphonebook/ Copyright 2008-2011 by Lars Bensmann (gsphonebook@almosthappy.de) Italian language file copyright 2011 by Fabio Muzzi Licenced under the terms of the GNU GPL v2 or later. 1. Set up PostgreSQL-database: Execute the following as the PostgreSQL superuser (normally this is the user 'postgres'): $ createuser --no-superuser --no-createdb --no-createrole --pwprompt gsphonebook Enter password for new role: Enter it again: CREATE ROLE $ createdb --encoding=UTF-8 --owner gsphonebook gsphonebook CREATE DATABASE $ psql gsphonebook < database-0.5.pgsql You might have to adjust the DSN in 'config.php' to access the PostgreSQL server. 2. Copy directory 'html' somewhere into your webserver tree. e.g. # cp -r gsphonebook-0.8a/html/* /var/www/gsphonebook/ 3. Rename 'config.sample.php' to 'config.php' and make sure that the file is not world-readable. 4. Download 'xajax' from http://sourceforge.net/project/showfiles.php?group_id=139736 (I tested with xajax 0.5 beta 4). Point the variable $xajaxdir in 'config.php' to the installation (relative pathname). $xajaxdir + '/xajax_core/xajax.inc.php' should point to the respective file. Now the phonebook should be usable. Username and password are both 'admin'. Please change this as soon as possible. Read on for Grandstream XML phonebook generation, custom ring tone selection and Asterisk click-to-dial integration, call information and call history. 5. *OPTIONAL* for Grandstream XML phonebook generation: Set the 'Phonebook XML Server Path' in you Grandstream phone(s) to the gsget.php script in the installation directory: Enable Phonebook XML Download: 'YES, HTTP' Phonebook XML Server Path: 'myserver.lan/gsphonebook/gsget.php' For automatic phonebook updates also set 'Phonebook Download Interval' to some value > 0. (This number is in minutes) For this feature to work the IP address or hostname has to be known to the phonebook application. Every user has a 'GS hostname' field that can be set for his phone. The application will then generate that users XML phonebook for this IP address. 6. *OPTIONAL* for user-selectable ring tones and GS idle screen info: Set the 'Firmware Server Path' entry in all Grandstream phones to the gsget.php script in the directory you just created: Upgrade Via 'HTTP' Firmware Server Path: 'myserver.lan/gsphonebook/gsget.php' Be sure that the fields 'Firmware File Prefix' and 'Firmware File Postfix' are empty. Copy your ringtones into the ringtone directory. Filename suffix has to be '.ring'. If you want to to hear the ring tones in your browser you can generate WAV-files and put them in the same directory with the same name but the suffix '.wav'. (See http://grandstream.com/ringtone.html for ring tone generation for Grandstream phones.) Unfortunately I don't have any free ringtones that I can distribute as examples so you have to do this yourself. Additionally you can also put the Grandstream firmware files in the 'firmware' subdirectory if you want to serve them through this tool. You can also serve config files if you set 'Config Server Path' in the phone to the same gsget.php-URL. They are also searched for in the 'firmware' subdirecory. 7. *OPTIONAL* for click-to-dial, BLF, call information, call history and GS idle screen info: Add a user to your /etc/asterisk/manager.conf A sample entry might look like this: [gsphonebook] secret = xYRmSHJS2LYahMKiGpFt deny = 0.0.0.0/0.0.0.0 permit = 127.0.0.1/255.255.255.255 read = call,system write = call,command,originate Under "Administration->Preferences" setup GS/* phonebook to match the newly created Asterisk Manager user. You also need to assign a SIP-extension and a CallerID (phone number for this extension) to each user to let her/him dial out and use the BLF pickup/steal functionality. Click the phone-icon next to a number or request the following URL to test: http://myserver.lan/gsphonebook/dial.php?dest=123456 (A user with a correctly configured extension has to be logged in for this to work.) 8. *OPTIONAL* for BLF, call information, call history and GS idle screen info: Copy the contents of the 'python' directory somewhere (not within your web root). Copy 'config.sample.py' to 'config.py' (it needs to be in the same directory as gsphonebookd.py) and edit the file so it matches your database settings. Make sure that the file is not world-readable. Start 'gsphonebookd.py'. You might want to do this automatically on system startup. 9. *OPTIONAL* for GS idle screen info: For this feature to work you need at least firmware version 1.1.6.37 on your Grandstream phones. Earlier versions do not support the SIP notification to force a reload of the idle screen. Create a SIP NOTIFY event for Asterisk: To do this you have ta add the following lines to /etc/asterisk/sip_notify.conf: [grandstream-idle-screen-refresh] Event=>x-gs-screen Content-Length=>0 Set the 'Idle Screen XML Download' in you Grandstream phone(s) to the gsget.php script in the installation directory: Enable Idle Screen XML Download: 'YES, HTTP' Idle Screen XML Server Path: 'myserver.lan/gsphonebook/gsget.php' Each phonebook user can set under Preferences->Callinfo which phones are allowed to see her/his incoming calls. In the directory 'idlescreens' are idle screens you can customize for the different GS phones. Take a look at 'gs_screen.xml.php' if you want to change the default screens. Examples for GXP-2000, GXP-2010 and GXP-2020 are included. Have a look at them and the documentation from Grandstream (http://grandstream.com/documents/XML_Application_Guide_Rev1.1.pdf) if you want to customize the display.