Get help with installing, upgrading and running a PBX such as Asterisk.
User avatar
By WelshPaul
#5411
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:
    Image
  3. 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>';
    
  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. 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
    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:
    Image
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:192.168.0.255/snom_dir.php)
  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.

    Image

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.
Pitney Bowes Franking Machine

Im with FP and their tech team is very good with r…

Gigaset N300A IP

The Gigaset N300A IP has been a great way to comb…

Supported Products: OBi504vs OBi508vs Firm…

Supported Products: OBi200 OBi202 OBi300 OB…

Sign up for full membership