Get help with installing, upgrading and running a PBX such as Asterisk.
User avatar
By WelshPaul
Posts Signature Likes Avatar Topics
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
  1. Log in to your FreePBX server and install the following modules:
    • Phonebook
    • Phonebook Directory
  2. Navigate to Admin > Asterisk Phonebook and add your contacts to the phonebook directory as shown in the example below:
  3. Create a new file using notepad++ called Snom_dir.php and copy and paste the following code within it:
    Code: Select all
    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()) {
        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>';
  4. Upload the file you created above to the /var/www/html directory on your FreePBX server.
  5. Run the following command via SSH to install SQLite3:
    • sudo apt-get install php5-sqlite
  6. 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.

    If it's not working or not accessible, make sure the file permissions are set as shown below:
    • permissions: 664
    • Owner/Group: asterisk:asterisk
    You can set the above permissions by running the following three commands via SSH:
    • cd /var/www/html
    • sudo chown asterisk:asterisk snom_dir.php
    • sudo chmod 664 snom_dir.php
    You should now see a web page displaying all your contacts in XML format as shown in the example below:
Configuring the Snom
  1. In the Snom web interface, click ‘Function Keys’ on the left hand navigation.
  2. On one of the available keys change the ‘Type’ to be ‘Action URL’
  3. Also on the keys row enter the Address Book URL you created above into the ‘Number’ field. (e.g. http:
  4. Scroll to the bottom of the Snom Web Interface and click ‘Apply’ then click ‘Save’ at the top of the screen.
  5. 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.
Very impressive. I did not need to do steps 1 or 2, since I already have a phonebook for Caller ID lookup. And I did not need to do step 5 because it is already installed on the current version of freepbx.

Unfortunately, my phonebook is rather long and painful to scroll through. It would be great if someone could suggest a way to do a search.

A Hook Flash is nothing more than hanging up and picki…

Thank-you extremely helpful. What would I do if for s…

Am not sure where my Grandstream HT813 was sourced from…

My HT801 was configured for another UK provider. I rea…

Sign up for VIP membership