<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Georgia;
        panose-1:2 4 5 2 5 4 5 2 3 3;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Although it&#8217;s not LDAP I used a
script that I found on the voip wiki and changed it so it looked at only sip
configuration files. It also alphabetizes the output so it can be displayed
that way on the phone. Below are my notes on the subject.&nbsp; If someone is
willing to post this to the wiki and send me a link, that would be awesome.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><b><font size=3 face=Georgia><span
style='font-size:12.0pt;font-family:Georgia;font-weight:bold'>Cisco Phone
Extension Directory Using Services Button<br>
</span></font></b><font face=Georgia><span style='font-family:Georgia'>I used a
PHP script that I found on the Internet and rewrote it to fit our needs.&nbsp;
Original code is found at:<br>
http://users.marshall.edu/~twohig5/directory.php.txt<br>
The new code only looks at the sip.conf file since we are only using sip
phones. My version also alphabetizes the directory.&nbsp; Below is the source
code:<br>
<br>
<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><i><font size=3 face=Georgia><span
style='font-size:12.0pt;font-family:Georgia;font-style:italic'>Directory.php.txt</span></font></i><font
face=Georgia><span style='font-family:Georgia'><br>
&lt;?<br>
header(&quot;Content-type: text/xml&quot;);<br>
header(&quot;Connection: close&quot;);<br>
header(&quot;Expires: -1&quot;);<br>
&nbsp;<br>
// location of asterisk config files<br>
$location = &quot;/etc/asterisk/&quot;;<br>
$dirname = &quot;MISD Directory&quot;;<br>
&nbsp;<br>
// parse sip.conf<br>
$sip_array = parse_ini_file($location.&quot;sip.conf&quot;, true);<br>
while ($v = current($sip_array))<br>
{ if (isset($v['name']))<br>
{ $directory[] = &quot;&lt;Name&gt;&quot;.
$v['name'].&quot;&lt;/Name&gt;\n&quot;.<br>
&nbsp;&nbsp;&nbsp;
&quot;&lt;Telephone&gt;&quot;.key($sip_array).&quot;&lt;/Telephone&gt;\n&quot;;<br>
}<br>
next($sip_array);<br>
}<br>
&nbsp;<br>
sort ($directory);<br>
&nbsp;<br>
echo &quot;&lt;CiscoIPPhoneDirectory&gt;\n&quot;;<br>
echo &quot;&lt;Title&gt;&quot;.$dirname.&quot;&lt;/Title&gt;\n&quot;;<br>
foreach ($directory as $v) {<br>
&nbsp; echo &quot;\n&lt;DirectoryEntry&gt;\n&quot;;<br>
&nbsp; echo $v;<br>
&nbsp; echo &quot;&lt;/DirectoryEntry&gt;\n&quot;;<br>
}<br>
echo &quot;\n&lt;Prompt&gt;Choose Name and Press Dial&lt;/Prompt&gt;\n&quot;;<br>
echo &quot;&lt;/CiscoIPPhoneDirectory&gt;\n&quot;;<br>
?&gt;<br>
<br>
&nbsp;<br>
>From here you can schedule this to run every so often.&nbsp; Once the file is
created you must place it in your web directory on the server.<br>
&nbsp;<br>
I chained the command and also wrote the output to an xml file in the web
directory.&nbsp; The command looks like this:<br>
&nbsp;<br>
&#8216;php /etc/asterisk/directory.php.txt &gt;
/var/www/html/directory.xml&#8217;<br>
&nbsp;<br>
<b><span style='font-weight:bold'>System Speeddials using Services Button</span></b>&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;<br>
For speed dials I modified the php code to look to a specific file in the
asterisk directory called speeddials.conf.&nbsp; This file only contains
attributes that the php script will look for.&nbsp; This is great because you
only need to specify the number and name fields.&nbsp; Below is my example of
speeddial.php.txt (php code)&nbsp;and speeddials.conf (speed dials):<br>
&nbsp;<br>
<i><span style='font-style:italic'>Speeddial.php.txt<br>
</span></i>&lt;?<br>
header(&quot;Content-type: text/xml&quot;);<br>
header(&quot;Connection: close&quot;);<br>
header(&quot;Expires: -1&quot;);<br>
&nbsp;<br>
// location of asterisk config files<br>
$location = &quot;/etc/asterisk/&quot;;<br>
$dirname = &quot;System Speed Dial&quot;;<br>
&nbsp;<br>
// parse speeddials.conf<br>
$ssd_array = parse_ini_file($location.&quot;speeddials.conf&quot;, true);<br>
while ($v = current($ssd_array))<br>
{ if (isset($v['name']))<br>
{ $directory[] = &quot;&lt;Name&gt;&quot;. $v['name'].&quot;&lt;/Name&gt;\n&quot;.<br>
&nbsp;&nbsp;&nbsp;
&quot;&lt;Telephone&gt;&quot;.key($ssd_array).&quot;&lt;/Telephone&gt;\n&quot;;<br>
}<br>
next($ssd_array);<br>
}<br>
&nbsp;<br>
sort ($directory);<br>
&nbsp;<br>
echo &quot;&lt;CiscoIPPhoneDirectory&gt;\n&quot;;<br>
echo &quot;&lt;Title&gt;&quot;.$dirname.&quot;&lt;/Title&gt;\n&quot;;<br>
foreach ($directory as $v) {<br>
&nbsp; echo &quot;\n&lt;DirectoryEntry&gt;\n&quot;;<br>
&nbsp; echo $v;<br>
&nbsp; echo &quot;&lt;/DirectoryEntry&gt;\n&quot;;<br>
}<br>
echo &quot;\n&lt;Prompt&gt;Choose Name and Press Dial&lt;/Prompt&gt;\n&quot;;<br>
echo &quot;&lt;/CiscoIPPhoneDirectory&gt;\n&quot;;<br>
?&gt;<br>
<br>
&nbsp;<br>
<i><span style='font-style:italic'>Speeddials.conf<br>
</span></i>;System Speed Dial File<br>
;This is used in conjuction with speeddial.php.txt<br>
;<br>
[9,7234264]<br>
name=MISD Admin Office<br>
[9,7236205]<br>
name=MISD Special Ed Office<br>
[9,7233521]<br>
name=MAPS Supintendent Office<br>
[9,7232547]<br>
name=MAPS MHS<br>
&nbsp;<br>
Once these files are create just run the php command:<br>
&#8216;php speeddials.php.txt &gt; /var/www/html/speeddial.xml&#8217;<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=3 face=Georgia><span
style='font-size:12.0pt;font-family:Georgia'>This will generate the speed dial
file and place it in your web directory.&nbsp;&nbsp;<br>
&nbsp;<br>
You can also schedule this to run just like the extension directory
script.&nbsp;&nbsp;&nbsp;<br>
&nbsp;<br>
<b><span style='font-weight:bold'>Creating the Main Services Menu<br>
</span></b>To display these two items when the user presses the Services button
you first we need to create a file that contains the menus.&nbsp; I created a
file called services.xml and placed in the web directory /var/www/html/.<br>
&nbsp;<br>
Then I wrote the menu structure using XML. I used the information found on the
Cisco website as guide to do this. Below is my services.xml file:<br>
&nbsp;<br>
&lt;CiscoIPPhoneMenu&gt;<br>
&lt;Title&gt;Information Services&lt;/Title&gt;<br>
&lt;Prompt&gt;Press to Enter&lt;/Prompt&gt;<br>
&lt;MenuItem&gt;<br>
&lt;Name&gt;Extension Directory&lt;/Name&gt;<br>
&lt;URL&gt;http://192.168.1.94/directory.xml&lt;/URL&gt;<br>
&lt;/MenuItem&gt;<br>
&lt;SoftKeyItem&gt;<br>
&lt;Name&gt;Dir&lt;/Name&gt;<br>
&lt;URL&gt;&lt;/URL&gt;<br>
&lt;Position&gt;&lt;/Position&gt;<br>
&lt;/SoftKeyItem&gt;<br>
&nbsp;<br>
&lt;Prompt&gt;Press to Enter&lt;/Prompt&gt;<br>
&lt;MenuItem&gt;<br>
&lt;Name&gt;System Speed Dial&lt;/Name&gt;<br>
&lt;URL&gt;http://192.168.1.94/speeddial.xml&lt;/URL&gt;<br>
&lt;/MenuItem&gt;<br>
&lt;SoftKeyItem&gt;<br>
&lt;Name&gt;Dir&lt;/Name&gt;<br>
&lt;URL&gt;&lt;/URL&gt;<br>
&lt;Position&gt;&lt;/Position&gt;<br>
&lt;/SoftKeyItem&gt;<br>
&nbsp;<br>
&lt;/CiscoIPPhoneMenu&gt;<br>
&nbsp;<br>
As you can see the example above uses the &lt;CiscoIPPhoneMenu&gt; tag.&nbsp; I
created a couple of menu items called &#8220;Extension Directory&#8221; &amp;
&#8220;System Speed Dial&#8221; which points to the directory.xml and
speeddial.xml files we created earlier.&nbsp; <o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=3 face=Georgia><span
style='font-size:12.0pt;font-family:Georgia'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=3 face=Georgia><span
style='font-size:12.0pt;font-family:Georgia'>For photos of how this
looks&nbsp;on the phone visit: <a
href="http://picasaweb.google.com/ranciso/AsteriskImagesCiscoPhones/photo">http://picasaweb.google.com/ranciso/AsteriskImagesCiscoPhones/photo#5135353621777248450</a><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=3 face=Georgia><span
style='font-size:12.0pt;font-family:Georgia'><br>
One major caveat is&nbsp;for some reason Cisco has a limit on how
many&nbsp;numbers you can display using the &lt;CiscoIPPhoneDirectory&gt;
directive.&nbsp; I believe it is 32.&nbsp;So to keep things&nbsp;sane I created
a directory &quot;/etc/asterisk/sip&quot; and departmentalized my sip
registrations there.&nbsp; You can tell asterisk to load the sip config files
by inserting the following in your main /etc/asterisk/sip.conf file under the
general settings:<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=3 face=Georgia><span
style='font-size:12.0pt;font-family:Georgia'>#include
&quot;/etc/asterisk/sip/*.conf<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=3 face=Georgia><span
style='font-size:12.0pt;font-family:Georgia'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=3 face=Georgia><span
style='font-size:12.0pt;font-family:Georgia'>After creating separate sip files
I also duplicated the php script to point to each sip file and adjusted the
Cisco XML files accordingly.&nbsp; <o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=3 face=Georgia><span
style='font-size:12.0pt;font-family:Georgia'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=3 face=Georgia><span
style='font-size:12.0pt;font-family:Georgia'><br>
<b><span style='font-weight:bold'>Cisco Resources &amp; Links for SIP
Configuration (You need a Cisco Login to Access)<br>
<br>
<o:p></o:p></span></b></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=3 face=Georgia><span
style='font-size:12.0pt;font-family:Georgia'>Description: This link is to the
documentation for all the Cisco phones:<br>
http://cisco.com/en/US/customer/products/hw/phones/ps379/prod_maintenance_guides_list.html<br>
&nbsp;<br>
Description: This link is for setting up the 7906 &amp; 7911 phones with SIP <br>
http://cisco.com/en/US/customer/products/hw/phones/ps379/products_administration_guide_book09186a00807307c8.html<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] <b><span style='font-weight:
bold'>On Behalf Of </span></b>satish patel<br>
<b><span style='font-weight:bold'>Sent:</span></b> Sunday, January 06, 2008
9:58 AM<br>
<b><span style='font-weight:bold'>To:</span></b> email@mattruby.com; Asterisk
Users Mailing List - Non-Commercial Discussion<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [asterisk-users]
Cisco 79xx XML services</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>I am useing Cisco 7975 with Asterisk on SIP protocol and its working
gr8 <o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>I have also implemeted SCCP but i got problem of Hangup and my asterisk
got hang i dont know what was it but it is working fine with SIP <o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>I need LDAP base directory for my Cisco 7975 have&nbsp;u work on it ???<br>
<br>
<b><i><span style='font-weight:bold;font-style:italic'>Matthew Rubenstein
&lt;email@mattruby.com&gt;</span></i></b> wrote:<o:p></o:p></span></font></p>

</div>

<blockquote style='border:none;border-left:solid #1010FF 1.5pt;padding:0in 0in 0in 4.0pt;
margin-left:3.75pt;margin-top:5.0pt;margin-bottom:5.0pt'>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>I Googled for CMXML_App_Guide.pdf . The first result was the voip-info<br>
wiki article &quot;Asterisk phone cisco 79xx&quot; at<br>
http://www.voip-info.org/wiki-Asterisk+phone+cisco+79xx . That article<br>
mentions CMXML_App_Guide.pdf in the &quot;Company Telephone Directory&quot;<br>
section, with a link to the &quot;Asterisk Cisco 79XX XML Services&quot; wiki<br>
article at http://www.voip-info.org/wiki/view/Asterisk+Cisco+79XX+XML<br>
+Services . Which in turn mentions that the relevant Cisco doc is called<br>
&quot;Cisco IP Phone Services Application Development Notes (Cisco IP Phone<br>
XML Objects)&quot;. So I Googled for &quot;Cisco IP Phone XML Objects&quot;
which<br>
turned up several results for a 2002 O'Reilly book, followed by the doc<br>
itself at<br>
http://www.cisco.com/univercd/cc/td/doc/product/voice/vpdd/cdd/5_0/5_0_1/ipphsv/ip503ch2.htm
. Along the way there were several other docs and examples, including
differences between SIP/SCCP version of the service.<br>
<br>
I'm interested to see how well the feature works on the 7970s with<br>
Asterisk instead of CallManager. Please keep me posted on your progress.<br>
<br>
<br>
On Fri, 2008-01-04 at 17:08 -0600,<br>
asterisk-users-request@lists.digium.com wrote:<br>
&gt; Date: Fri, 04 Jan 2008 13:41:31 -0800<br>
&gt; From: Edwin Lam <br>
<ELAM@OFFICEGENERAL.COM>&gt; Subject: [asterisk-users] Cisco 79xx XML services<br>
&gt; To: Asterisk Users Mailing List - Non-Commercial Discussion<br>
&gt; <br>
<ASTERISK-USERS@LISTS.DIGIUM.COM>&gt; Message-ID:
&lt;477EA80B.5070302@officegeneral.com&gt;<br>
&gt; Content-Type: text/plain; charset=UTF-8; format=flowed<br>
&gt; <br>
&gt; <br>
&gt; hi guys.<br>
&gt; <br>
&gt; i'm writing some simple applications for the cisco 7970<br>
&gt; services button. i read the asterisk wiki and it mention<br>
&gt; there's a CMXML_App_Guide.pdf file but there's nowhere<br>
&gt; can i find a link for it. does anybody know where can<br>
&gt; i find it?<br>
&gt; <br>
&gt; regards.<br>
&gt; -- <br>
&gt; Edwin Lam <br>
<EDWIN.LAM@OFFICEGENERAL.COM>-- <br>
<br>
(C) Matthew Rubenstein<br>
<br>
<br>
_______________________________________________<br>
--Bandwidth and Colocation Provided by http://www.api-digital.com--<br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
http://lists.digium.com/mailman/listinfo/asterisk-users<o:p></o:p></span></font></p>

</blockquote>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br>
<br>
----PGP Signature--<br>
<br>
Satish Patel<br>
mobile:- +91-9818875535<br>
<br>
http://www.linuxbug.org<o:p></o:p></span></font></p>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp; <o:p></o:p></span></font></p>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=1 width="100%" align=center>

</span></font></div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Never miss a thing. <a
href="http://us.rd.yahoo.com/evt=51438/*http:/www.yahoo.com/r/hs">Make Yahoo your
homepage.</a> <o:p></o:p></span></font></p>

</div>

</body>

</html>