- Wed 26th Sep 2018, 08:43
#5411
- Appreciate my support? Feel free to buy me a coffee.
- Voipfone are offering you the chance to trial their VoIP service for free for 30 days. Sign me up!
- Tired of shared hosting? You're not alone! Grab a high performance server and get $100 in free credit. Sign me up!
If you're using Snom IP phones with a FreePBX server and you would like a global phonebook that is managed via FreePBX then read on...
Configuring the FreePBX Server
Using the Address Book
Press the line button on your Snom phone to display your Voipfone Address Book.
Use the Up and Down buttons on the navigation pad to scroll through the list of contacts, and then press the Confirm (Tick) button to dial the highlighted entry.
Please note: the Directory button will display contacts that are stored on the phone and not the entries that are in your Voipfone address book.
Configuring the FreePBX Server
- Log in to your FreePBX server and install the following modules:
- Phonebook
- Phonebook Directory
- Navigate to Admin > Asterisk Phonebook and add your contacts to the phonebook directory as shown in the example below:
- Create a new file using notepad++ called Snom_dir.php and copy and paste the following code within it:
Code: Select all
<?php header ("Content-type: text/xml"); echo '<?xml version="1.0" encoding="UTF-8"?>'; echo '<SnomIPPhoneDirectory speedselect="select">'; echo '<Title>Snom Address Book</Title>'; echo '<Prompt />'; $db = new SQLite3('/var/lib/asterisk/astdb.sqlite3'); $results = $db->query('SELECT * FROM astdb;'); while ($row = $results->fetchArray()) { //find $find='/cidname/'; if(strpos($row['key'], $find)!==false) { echo '<DirectoryEntry>'; echo '<Name>'.htmlspecialchars($row['value']).'</Name>'; echo '<Telephone>'.str_replace($find, '', $row['key']).'</Telephone>'; echo '</DirectoryEntry>'; } } echo '</SnomIPPhoneDirectory>';
- Upload the file you created above to the /var/www/html directory on your FreePBX server.
- Run the following command via SSH to install SQLite3:
- sudo apt-get install php5-sqlite
- Let's check that the file we uploaded is accessible and working. Open your web browser and enter the IP address of your FreePBX server followed by /snom_dir.php. (e.g. http://192.168.0.255/snom_dir.php)
If it's not working or not accessible, make sure the file permissions are set as shown below:- permissions: 664
- Owner/Group: asterisk:asterisk
- cd /var/www/html
- sudo chown asterisk:asterisk snom_dir.php
- sudo chmod 664 snom_dir.php
- In the Snom web interface, click ‘Function Keys’ on the left hand navigation.
- On one of the available keys change the ‘Type’ to be ‘Action URL’
- Also on the keys row enter the Address Book URL you created above into the ‘Number’ field. (e.g. http:192.168.0.255/snom_dir.php)
- Scroll to the bottom of the Snom Web Interface and click ‘Apply’ then click ‘Save’ at the top of the screen.
- Check that everything is working by pressing the line button on your Snom phone - you should now see all your contacts listed there.
Using the Address Book
Press the line button on your Snom phone to display your Voipfone Address Book.
Use the Up and Down buttons on the navigation pad to scroll through the list of contacts, and then press the Confirm (Tick) button to dial the highlighted entry.
Please note: the Directory button will display contacts that are stored on the phone and not the entries that are in your Voipfone address book.
- Appreciate my support? Feel free to buy me a coffee.
- Voipfone are offering you the chance to trial their VoIP service for free for 30 days. Sign me up!
- Tired of shared hosting? You're not alone! Grab a high performance server and get $100 in free credit. Sign me up!
How did this post make you feel?