[asterisk-users] Script for seeding polycom phones with an extension directory
Anciso, Roy
roy at manistee.org
Fri Jan 25 13:53:53 CST 2008
Hello List,
Not sure if this will be helpful but I made changes to the original
Cisco directory.php.txt script and applied them for use on the Polycom
phones. This will create an extension directory and alphabetize it
based on the sip registrations you have setup in sip.conf. Note that
this only seeds the phones and does not synchronize them. Anyway
thought it might save people some time. To run do: php scriptname >
/home/polycom/000000000000-directory.xml.
<?
header("Content-type: text/xml");
header("Connection: close");
header("Expires: -1");
// location of asterisk config files
$location = "/etc/asterisk/";
// parse sip.conf
$sip_array = parse_ini_file($location."sip.conf", true);
while ($v = current($sip_array))
{ if (isset($v['name']))
{ $directory[] = "<fn>". $v['name']."</fn>\n".
"<ct>".key($sip_array)."</ct>\n";
}
next($sip_array);
}
sort($directory);
echo "<directory>\n";
echo "<item_list>\n";
foreach ($directory as $v) {
echo "<item>\n";
echo $v;
echo "</item>\n";
}
echo "</item_list>\n";
echo "</directory>\n";
?>
Roy Anciso
Director of Technology
Manistee Intermediate School District
1710 Merkey Road
Manistee, MI 49660
Ph: 231-723-4264
Fx: 231-723-1690
roy at manistee.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080125/7011e97f/attachment.htm
More information about the asterisk-users
mailing list