No subject


Thu Jul 12 09:23:04 CDT 2007


created you must place it in your web directory on the server.
=20
I chained the command and also wrote the output to an xml file in the
web directory.  The command looks like this:
=20
'php /etc/asterisk/directory.php.txt > /var/www/html/directory.xml'
=20
System Speeddials using Services Button   =20
=20
For speed dials I modified the php code to look to a specific file in
the asterisk directory called speeddials.conf.  This file only contains
attributes that the php script will look for.  This is great because you
only need to specify the number and name fields.  Below is my example of
speeddial.php.txt (php code) and speeddials.conf (speed dials):
=20
Speeddial.php.txt
<?
header("Content-type: text/xml");
header("Connection: close");
header("Expires: -1");
=20
// location of asterisk config files
$location =3D "/etc/asterisk/";
$dirname =3D "System Speed Dial";
=20
// parse speeddials.conf
$ssd_array =3D parse_ini_file($location."speeddials.conf", true);
while ($v =3D current($ssd_array))
{ if (isset($v['name']))
{ $directory[] =3D "<Name>". $v['name']."</Name>\n".
    "<Telephone>".key($ssd_array)."</Telephone>\n";
}
next($ssd_array);
}
=20
sort ($directory);
=20
echo "<CiscoIPPhoneDirectory>\n";
echo "<Title>".$dirname."</Title>\n";
foreach ($directory as $v) {
  echo "\n<DirectoryEntry>\n";
  echo $v;
  echo "</DirectoryEntry>\n";
}
echo "\n<Prompt>Choose Name and Press Dial</Prompt>\n";
echo "</CiscoIPPhoneDirectory>\n";
?>

=20
Speeddials.conf
;System Speed Dial File
;This is used in conjuction with speeddial.php.txt
;
[9,7234264]
name=3DMISD Admin Office
[9,7236205]
name=3DMISD Special Ed Office
[9,7233521]
name=3DMAPS Supintendent Office
[9,7232547]
name=3DMAPS MHS
=20
Once these files are create just run the php command:
'php speeddials.php.txt > /var/www/html/speeddial.xml'

This will generate the speed dial file and place it in your web
directory. =20
=20
You can also schedule this to run just like the extension directory
script.  =20
=20
Creating the Main Services Menu
To display these two items when the user presses the Services button you
first we need to create a file that contains the menus.  I created a
file called services.xml and placed in the web directory /var/www/html/.
=20
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:
=20
<CiscoIPPhoneMenu>
<Title>Information Services</Title>
<Prompt>Press to Enter</Prompt>
<MenuItem>
<Name>Extension Directory</Name>
<URL>http://192.168.1.94/directory.xml</URL>
</MenuItem>
<SoftKeyItem>
<Name>Dir</Name>
<URL></URL>
<Position></Position>
</SoftKeyItem>
=20
<Prompt>Press to Enter</Prompt>
<MenuItem>
<Name>System Speed Dial</Name>
<URL>http://192.168.1.94/speeddial.xml</URL>
</MenuItem>
<SoftKeyItem>
<Name>Dir</Name>
<URL></URL>
<Position></Position>
</SoftKeyItem>
=20
</CiscoIPPhoneMenu>
=20
As you can see the example above uses the <CiscoIPPhoneMenu> tag.  I
created a couple of menu items called "Extension Directory" & "System
Speed Dial" which points to the directory.xml and speeddial.xml files we
created earlier. =20

=20

For photos of how this looks on the phone visit:
http://picasaweb.google.com/ranciso/AsteriskImagesCiscoPhones/photo#5135
353621777248450
<http://picasaweb.google.com/ranciso/AsteriskImagesCiscoPhones/photo>=20


One major caveat is for some reason Cisco has a limit on how many
numbers you can display using the <CiscoIPPhoneDirectory> directive.  I
believe it is 32. So to keep things sane I created a directory
"/etc/asterisk/sip" and departmentalized my sip registrations there.
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:

#include "/etc/asterisk/sip/*.conf

=20

After creating separate sip files I also duplicated the php script to
point to each sip file and adjusted the Cisco XML files accordingly. =20

=20


Cisco Resources & Links for SIP Configuration (You need a Cisco Login to
Access)



Description: This link is to the documentation for all the Cisco phones:
http://cisco.com/en/US/customer/products/hw/phones/ps379/prod_maintenanc
e_guides_list.html
=20
Description: This link is for setting up the 7906 & 7911 phones with SIP

http://cisco.com/en/US/customer/products/hw/phones/ps379/products_admini
stration_guide_book09186a00807307c8.html

=20

=20

=20

=20

=20

=20

=20

=20

=20

=20

________________________________

From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of satish
patel
Sent: Sunday, January 06, 2008 9:58 AM
To: email at mattruby.com; Asterisk Users Mailing List - Non-Commercial
Discussion
Subject: Re: [asterisk-users] Cisco 79xx XML services

=20

I am useing Cisco 7975 with Asterisk on SIP protocol and its working gr8


=20

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=20

=20

I need LDAP base directory for my Cisco 7975 have u work on it ???

Matthew Rubenstein <email at mattruby.com> wrote:

	I Googled for CMXML_App_Guide.pdf . The first result was the
voip-info
	wiki article "Asterisk phone cisco 79xx" at
	http://www.voip-info.org/wiki-Asterisk+phone+cisco+79xx . That
article
	mentions CMXML_App_Guide.pdf in the "Company Telephone
Directory"
	section, with a link to the "Asterisk Cisco 79XX XML Services"
wiki
	article at
http://www.voip-info.org/wiki/view/Asterisk+Cisco+79XX+XML
	+Services . Which in turn mentions that the relevant Cisco doc
is called
	"Cisco IP Phone Services Application Development Notes (Cisco IP
Phone
	XML Objects)". So I Googled for "Cisco IP Phone XML Objects"
which
	turned up several results for a 2002 O'Reilly book, followed by
the doc
	itself at
=09
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.
=09
	I'm interested to see how well the feature works on the 7970s
with
	Asterisk instead of CallManager. Please keep me posted on your
progress.
=09
=09
	On Fri, 2008-01-04 at 17:08 -0600,
	asterisk-users-request at lists.digium.com wrote:
	> Date: Fri, 04 Jan 2008 13:41:31 -0800
	> From: Edwin Lam=20
	> Subject: [asterisk-users] Cisco 79xx XML services
	> To: Asterisk Users Mailing List - Non-Commercial Discussion
	>=20
	> Message-ID: <477EA80B.5070302 at officegeneral.com>
	> Content-Type: text/plain; charset=3DUTF-8; format=3Dflowed
	>=20
	>=20
	> hi guys.
	>=20
	> i'm writing some simple applications for the cisco 7970
	> services button. i read the asterisk wiki and it mention
	> there's a CMXML_App_Guide.pdf file but there's nowhere
	> can i find a link for it. does anybody know where can
	> i find it?
	>=20
	> regards.
	> --=20
	> Edwin Lam=20
	--=20
=09
	(C) Matthew Rubenstein
=09
=09
	_______________________________________________
	--Bandwidth and Colocation Provided by
http://www.api-digital.com--
=09
	asterisk-users mailing list
	To UNSUBSCRIBE or update options visit:
	http://lists.digium.com/mailman/listinfo/asterisk-users




----PGP Signature--

Satish Patel
mobile:- +91-9818875535

http://www.linuxbug.org

 =20

________________________________

Never miss a thing. Make Yahoo your homepage.
<http://us.rd.yahoo.com/evt=3D51438/*http:/www.yahoo.com/r/hs> =20


------_=_NextPart_001_01C85172.9934E677
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

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

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"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=3DEN-US link=3Dblue vlink=3Dblue>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'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=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><b><font size=3D3 =
face=3DGeorgia><span
style=3D'font-size:12.0pt;font-family:Georgia;font-weight:bold'>Cisco =
Phone
Extension Directory Using Services Button<br>
</span></font></b><font face=3DGeorgia><span =
style=3D'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=3DMsoNormal style=3D'text-autospace:none'><i><font size=3D3 =
face=3DGeorgia><span
style=3D'font-size:12.0pt;font-family:Georgia;font-style:italic'>Director=
y.php.txt</span></font></i><font
face=3DGeorgia><span style=3D'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 =3D &quot;/etc/asterisk/&quot;;<br>
$dirname =3D &quot;MISD Directory&quot;;<br>
&nbsp;<br>
// parse sip.conf<br>
$sip_array =3D parse_ini_file($location.&quot;sip.conf&quot;, true);<br>
while ($v =3D current($sip_array))<br>
{ if (isset($v['name']))<br>
{ $directory[] =3D &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>


More information about the asterisk-users mailing list