FreePBX phone book with yealink phones


#1

Experts,

Is there any way to adopt phone book with yealink phones? I have over hundred extensions and don’t know if there is a manual way to add these ext to phone book or there is a easier way. Thank you


(TheJames) #2

#3

So I have find that code:

      <?php
################################################
#    COMDIF INNOVATION Christian-Zeler@2019    #
# Dynamic XML from Free-PBX Asterisk Phonebook #
################################################
header("Content-Type: text/xml");
// Connect Asterisk Sqlite database
$db = new SQLite3('/var/lib/asterisk/astdb.sqlite3');
// Search cidname datas
$results=$db->query('SELECT * FROM astdb WHERE key like "/cidname/%";');
// make header for XML format
echo'<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n';
// XML doc start
echo'<contactIPPhoneDirectory>\n';
$index = 0;
// Loop to print Directory 
while ($row = $results->fetchArray())
	{
    $num = explode('/',$row[0]);
	$index= $index + 1;
	echo "    <DirectoryEntry>\n";
	echo "        <Name>" . $row[1] . "</Name>\n";
	echo "        <Telephone>" . $num[2] . "</Telephone>\n";
	echo "    </DirectoryEntry>\n";
	}
// End XML doc
echo "</contactIPPhoneDirectory>\n";
// That's all folks :-)
?>

Enjoy

In remote phone book I have choose: PBX IP/var/www/html/book.php

and seem that does not work


#4

for some reason freepbxuser and password from /etc/freepbx does not work


(Dave Burgess) #5

The database is ACLed to just recognize the localhost. If you want to open the database up to contacts within your local network, you’ll need to set up an username and password in the database that allows for the entire local LAN (or specific phone IPs within your LAN).


(system) closed #6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.