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

[EMAIL PROTECTED]

 

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to