Cisco-IPPhone
view release on metacpan or search on metacpan
- fixed parsing bugs in nfl.cgi
- modified execute.cgi to push objects to IPPhones
0.04 Tue Nov 5 14:14:26 2002
- Added Pure Perl graphics capability to convert images to CIP
and CIP to images using Perl GD module. Code contributed by
Nate Mueller - nate@cs.wisc.edu
- Added all header fields recognized by the phone including
Refresh, URL, Location, Cookie, Location, Expires, Date
0.05 Tue Dec 3 12:00:34 2002
- Changed expires header to lower case
- Fixed bug in IconMenu
my $self = shift;
my $options = shift if (@_);
push @{$self->{xmlobject}},"<CiscoIPPhoneText>\n";
push @{$self->{xmlobject}}, "<Title>$options->{Title}</Title>\n";
push @{$self->{xmlobject}}, "<Prompt>$options->{Prompt}</Prompt>\n";
push @{$self->{xmlobject}}, "<Text>$options->{Text}</Text>\n";
push @{$self->{xmlobject}}, "</CiscoIPPhoneText>\n";
return @{$self->{xmlobject}};
}
sub Menu {
# Takes Title, Prompt and optional softkeyitems or menuitems
my $self = shift;
my $options = shift if (@_);
push @{$self->{xmlobject}},"<CiscoIPPhoneMenu>\n";
push @{$self->{xmlobject}},"<Title>$options->{Title}</Title>\n";
push @{$self->{xmlobject}},"<Prompt>$options->{Prompt}</Prompt>\n";
# Insert Menu Options using AddMenuItem
push @{$self->{xmlobject}},"</CiscoIPPhoneMenu>\n";
return @{$self->{xmlobject}};
}
sub MenuItem {
# Input: Name and URL (or URI)
# A maximum of 99 MenuItem tags are allowed
my $self = shift;
my $options = shift if (@_);
push @{$self->{xmlobject}},"<MenuItem>\n";
push @{$self->{xmlobject}}, "<IconIndex>$options->{IconIndex}</IconIndex>\n" if $options->{IconIndex};
push @{$self->{xmlobject}}, "<Name>$options->{Name}</Name>\n";
push @{$self->{xmlobject}}, "<URL>$options->{URL}</URL>\n";
push @{$self->{xmlobject}},"</MenuItem>\n";
return @{$self->{xmlobject}};
}
sub AddMenuItem {
# Input: Name and URL (or URI)
# Adds the MenuItem to the Object that called this method
my $self = shift;
my $options = shift if (@_);
# Pop off the Close Menu Tag
my $lastline = pop @{$self->{xmlobject}};
push @{$self->{xmlobject}},"<MenuItem>\n";
push @{$self->{xmlobject}}, "<IconIndex>$options->{IconIndex}</IconIndex>\n" if $options->{IconIndex};
push @{$self->{xmlobject}},"<Name>$options->{Name}</Name>\n";
push @{$self->{xmlobject}},"<URL>$options->{URL}</URL>\n";
push @{$self->{xmlobject}},"</MenuItem>\n";
# Push the Close Menu Tag Back onto the Menu Object
push @{$self->{xmlobject}}, $lastline;
# Returns array if called in list context, or returns scalar
if (wantarray) { return @{$self->{xmlobject}} };
return 1;
}
sub AddMenuItemObject {
# Input: MenuItem Object
# Adds the MenuItem Object to the Object that called this method
my $line;
my $self = shift;
my $options = shift if (@_);
# Pop off the Close Menu Tag
my $lastline = pop @{$self->{xmlobject}};
# Push the MenuItems onto the menu
foreach $line (@{$options->{MenuItem}->{xmlobject}}) {
push @{$self->{xmlobject}},$line;
}
# Push the Close Menu Tag Back onto the Menu Object
push @{$self->{xmlobject}}, $lastline;
return @{$self->{xmlobject}};
}
sub Input {
# Input: Title, Prompt, URL
my $self = shift;
my $options = shift if (@_);
push @{$self->{xmlobject}},"<CiscoIPPhoneInput>\n";
push @{$self->{xmlobject}}, "<Title>$options->{Title}</Title>\n";
push @{$self->{xmlobject}},"</InputItem>\n";
return @{$self->{xmlobject}};
}
sub AddInputItem {
# Input: DisplayName, QueryStringParam, DefaultValue, InputFlags
# Valid Input Tags: see inputFlags hash defined above
my $self = shift;
my $options = shift if (@_);
# Pop off the Close Menu Tag
my $lastline = pop @{$self->{xmlobject}};
push @{$self->{xmlobject}},"<InputItem>\n";
push @{$self->{xmlobject}}, "<DisplayName>$options->{DisplayName}</DisplayName>\n";
push @{$self->{xmlobject}}, "<QueryStringParam>$options->{QueryStringParam}</QueryStringParam>\n";
push @{$self->{xmlobject}}, "<DefaultValue>$options->{DefaultValue}</DefaultValue>\n";
push @{$self->{xmlobject}}, "<InputFlags>$options->{InputFlags}</InputFlags>\n";
push @{$self->{xmlobject}},"</InputItem>\n";
# Push the Close Tag Back onto the Calling Object
sub AddInputItemObject {
# Input: InputItem Object
# Adds the InputItem Object to the Object that called this method
my $line;
my $self = shift;
my $options = shift if (@_);
# Pop off the Close Tag
my $lastline = pop @{$self->{xmlobject}};
# Push the MenuItems onto the menu
foreach $line (@{$options->{InputItem}->{xmlobject}}) {
push @{$self->{xmlobject}},$line;
}
# Push the Close Tag Back onto the Calling Object
push @{$self->{xmlobject}}, $lastline;
return @{$self->{xmlobject}};
}
sub SoftKeyItem {
# Input: Name, URL (or URI), and Position
push @{$self->{xmlobject}},"</SoftKeyItem>\n";
return @{$self->{xmlobject}};
}
sub AddSoftKeyItem {
# Input: Name and URL (or URI), and Position
# Adds the SoftKeyItem Object to the Object that called this method
my $self = shift;
my $options = shift if (@_);
# Pop off the Close Menu Tag
my $lastline = pop @{$self->{xmlobject}};
push @{$self->{xmlobject}},"<SoftKeyItem>\n";
push @{$self->{xmlobject}},"<Name>$options->{Name}</Name>\n";
push @{$self->{xmlobject}},"<URL>$options->{URL}</URL>\n";
push @{$self->{xmlobject}},"<Position>$options->{Position}</Position>\n";
push @{$self->{xmlobject}},"</SoftKeyItem>\n";
# Push the Close Menu Tag Back onto the Menu Object
push @{$self->{xmlobject}}, $lastline;
return @{$self->{xmlobject}};
}
sub AddSoftKeyItemObject {
# Input: SoftKeyItem Object
# Adds the SoftKeyItem Object to the Object that called this method
my $line;
my $self = shift;
my $options = shift if (@_);
push @{$self->{xmlobject}},"<LocationX>$options->{LocationX}</LocationX>\n";
push @{$self->{xmlobject}},"<LocationY>$options->{LocationY}</LocationY>\n";
push @{$self->{xmlobject}},"<Width>$options->{Width}</Width>\n";
push @{$self->{xmlobject}},"<Height>$options->{Height}</Height>\n";
push @{$self->{xmlobject}},"<Depth>$options->{Depth}</Depth>\n";
push @{$self->{xmlobject}},"<Data>$options->{Data}</Data>\n";
push @{$self->{xmlobject}},"</CiscoIPPhoneImage>\n";
return @{$self->{xmlobject}};
}
sub GraphicMenu {
# Input: Title,Prompt,LocationX,LocationY,Width,Height,Depth,Data
my $self = shift;
my $options = shift if (@_);
push @{$self->{xmlobject}},"<CiscoIPPhoneGraphicMenu>\n";
push @{$self->{xmlobject}},"<Title>$options->{Title}</Title>\n";
push @{$self->{xmlobject}},"<Prompt>$options->{Prompt}</Prompt>\n";
push @{$self->{xmlobject}},"<LocationX>$options->{LocationX}</LocationX>\n";
push @{$self->{xmlobject}},"<LocationY>$options->{LocationY}</LocationY>\n";
push @{$self->{xmlobject}},"<Width>$options->{Width}</Width>\n";
push @{$self->{xmlobject}},"<Height>$options->{Height}</Height>\n";
push @{$self->{xmlobject}},"<Depth>$options->{Depth}</Depth>\n";
push @{$self->{xmlobject}},"<Data>$options->{Data}</Data>\n";
push @{$self->{xmlobject}},"</CiscoIPPhoneGraphicMenu>\n";
return @{$self->{xmlobject}};
}
sub IconMenu {
# Takes Title, Prompt and optional softkeyitems or menuitems
my $self = shift;
my $options = shift if (@_);
push @{$self->{xmlobject}},"<CiscoIPPhoneIconMenu>\n";
push @{$self->{xmlobject}},"<Title>$options->{Title}</Title>\n";
push @{$self->{xmlobject}},"<Prompt>$options->{Prompt}</Prompt>\n";
# Insert Menu Options using AddMenuItem
# Insert SoftKey Options using AddSoftKeyItem
# Insert Icon Options using AddIconItem
push @{$self->{xmlobject}},"</CiscoIPPhoneIconMenu>\n";
return @{$self->{xmlobject}};
}
sub IconItem {
# Input: Index, Height, Width, Depth, Data
# Build IconItem Object
my $self = shift;
my $options = shift if (@_);
push @{$self->{xmlobject}},"<IconItem>\n";
push @{$self->{xmlobject}},"<Width>$options->{Width}</Width>\n";
push @{$self->{xmlobject}},"<Depth>$options->{Depth}</Depth>\n";
push @{$self->{xmlobject}},"<Data>$options->{Data}</Data>\n";
push @{$self->{xmlobject}},"</IconItem>\n";
return @{$self->{xmlobject}};
}
sub AddIconItem {
# Input: Index, Height, Width, Depth, Data
# Adds the IconItem Object to the IconMenu Object that called this method
my $self = shift;
my $options = shift if (@_);
# Pop off the Close IconMenu Tag
my $lastline = pop @{$self->{xmlobject}};
push @{$self->{xmlobject}},"<IconItem>\n";
push @{$self->{xmlobject}},"<Index>$options->{Index}</Index>\n";
push @{$self->{xmlobject}},"<Height>$options->{Height}</Height>\n";
push @{$self->{xmlobject}},"<Width>$options->{Width}</Width>\n";
push @{$self->{xmlobject}},"<Depth>$options->{Depth}</Depth>\n";
push @{$self->{xmlobject}},"<Data>$options->{Data}</Data>\n";
push @{$self->{xmlobject}},"</IconItem>\n";
# Push the Close IconMenu Tag Back onto the Menu Object
push @{$self->{xmlobject}}, $lastline;
return @{$self->{xmlobject}};
}
sub AddIconItemObject {
# Input: IconItem Object
# Adds the IconItem Object to the Object that called this method
my $line;
my $self = shift;
my $options = shift if (@_);
- Go to Feature -> Cisco IP Phone Services
- Give the service a name and specify a URL such as:
http://www.myorg.com/cgi-bin/menu.cgi
Where menu.cgi is a Perl program that displays the menu
- use the CCMUser URL to allow the user subscribe their phone to the service
or have the Administrator assign the service to the phone using the
phone device configuration.
=head2 Methods
The following sections provide definitions and descriptions of each Cisco IP phone XML object: CiscoIPPhoneMenu, CiscoIPPhoneText, CiscoIPPhoneInput, CiscoIPPhoneDirectory, CiscoIPPhoneImage, CiscoIPPhoneGraphicMenu, CiscoIPPhoneIconMenu, CiscoIPPhon...
=over 4
=item * $object->Text
B<This method takes a title, prompt, and text as input.>
$mytext = new IPPhone;
$mytext->Text( { Title => "My Title",
Prompt => "My Prompt",
Text => "My Text" });
=item * $object->Menu
B<This method takes a title, prompt, and text as input.>
# Create Menu Object
$mymenu = new IPPhone;
$mymenu->Menu( { Title => "My Title",
Prompt => "My Prompt",
Text => "My Text" });
=item * $object->MenuItem
$mymenu = new IPPhone;
$mymenuitem = new IPPhone;
# Create a menu object
$mymenu->Menu( { Title => "My Title",
Prompt => "My Prompt",
Text => "My Text" });
# Create a menuitem object
$mymenuitem->MenuItem({ Name => "Item1",
URL => "http://www.mydomain.com" });
# Add the menuitem object to the menu object
$mymenu->AddMenuItemObject( { MenuItem => $mymenuitem });
=item * $object->AddMenuItem
$mymenu = new IPPhone;
# Create a menu object
$mymenu->Menu( { Title => "My Title",
Prompt => "My Prompt",
Text => "My Text" });
# Add a menuitem to the menu object
$mymenu->AddMenuItem({ Name => "Item 2",
URL => "http://www.mydomain.com" });
=item * $object->AddMenuItemObject
$mymenu = new IPPhone;
$mymenuitem = new IPPhone;
# Create a menu object
$mymenu->Menu( { Title => "My Title",
Prompt => "My Prompt",
Text => "My Text" });
# Create a menuitem object
$mymenuitem->MenuItem({ Name => "Item1",
URL => "http://www.mydomain.com" });
# Add the menuitem object to the menu object
$mymenu->AddMenuItemObject( { MenuItem => $mymenuitem });
$mymenu->AddMenuItemObject( { MenuItem => $mymenuitem });
=item * $object->Input
$myinput = new IPPhone;
# Create Input Object
$myinput->Input( { Title => "Title Text",
Prompt => "Prompt Text",
URL => "The target URL for the completed input" });
InputFlags => "A"} );
=item * $object->AddInputItem
$myinput = new IPPhone;
# Create Input Object
$myinput->Input( { Title => "Title Text",
Prompt => "Prompt Text",
# Add an input item to the Menu Object
$myinput->AddInputItem({ DisplayName => "Name of Input field to display",
QueryStringParam => "Parameter to be added to target URl",
DefaultValue => "Default Display Name",
InputFlags => "A"} );
=item * $object->AddInputItemObject
$myinput = new IPPhone;
$myinputitem = new IPPhone;
=item * $object->AddSoftKeyItemObject
# Add the softkeyitem object to the object being built
$object->AddInputItemObject( { SoftKeyItem => $mysoftkeyitem });
=item * $object->Directory
$mydirectory = new IPPhone;
# Create Menu Object
$mydirectory->Directory( { Title => "My Title",
Prompt => "My Prompt" });
=item * $object->DirectoryEntry
# Add Directory Entries to Directory Object
$mydirectoryentry->DirectoryEntry( { Name => "Entry1",
Telephone => "555-1212" } );
=item * $object->AddDirectoryEntry
$mydirectory->AddDirectoryEntryObject( { DirectoryEntry => $mydirectoryentry });
=item * $object->Image
$myimage = new IPPhone;
# LocationX & LocationY: Position of the graphic (-1, -1 centers the graphic)
# Height and Width define the number of pixels high and wide
# Depth - number of bits per pixel (this number should be 2)
# Create Menu Object
$myimage->Image( { Title => "Some Image", Prompt => "View the image",
LocationX => "-1", LocationY => "-1", Width => "120",
Height => "44", Depth => "2", Data => "$data" });
=item * $object->GraphicMenu
# Data is the data portion of a CIP image. Use gif2cip or the photoshop
# plugin to generate the data portion of an image.
use IPPhone;
$mygraphicmenu = new IPPhone;
$data = "FFFFFFFFFFFFFFFFFFFF";
# Create Menu Object
$mygraphicmenu->GraphicMenu( { Title => "My Image",
Prompt => "View the image",
LocationX => "-1", LocationY => "-1",
Width => "10",
Height => "10",
Depth => "2",
Data => "$data" });
print $mygraphicmenu->Content;
=item * $object->IconMenu
use Cisco::IPPhone;
$myiconmenu = new Cisco::IPPhone;
$data = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF";
# Create Icon Menu
$myiconmenu->IconMenu( { Title => "Icon Menu",
Prompt => "Select an icon" });
$myiconmenu->AddMenuItem({ IconIndex => "1",
Name => "Menu Item 1",
URL => "http://192.168.250.31/cgi-bin/metavante/text.cgi" });
$myiconmenu->AddMenuItem({ IconIndex => "1",
Name => "Menu Item 2",
URL => "http://192.168.250.31/cgi-bin/metavante/text.cgi" });
$myiconmenu->AddMenuItem({ IconIndex => "1",
Name => "Menu Item 3",
URL => "http://192.168.250.31/cgi-bin/metavante/text.cgi" });
# Index is the numeric index of the icon to be displayed
# Up to 10 instances of iconitem can be displayed
$myiconmenu->AddIconItem ({ Index => "1",
Width => "10",
Height => "10",
Depth => "2",
Data => "$data" });
<URL>SoftKey:Update</URL>
<Position>1</Position>
</SoftKeyItem>
<SoftKeyItem>
<Name>Exit</Name>
<URL>SoftKey:Exit</URL>
<Position>2</Position>
</SoftKeyItem>
</CiscoIPPhoneText>
B<Example showing IP Phone Menu>
#!/usr/bin/perl
use IPPhone;
$mymenu = new IPPhone;
$mymenuitem = new IPPhone;
# Create Menu Object
$mymenu->Menu( { Title => "My Title",
Prompt => "My Prompt",
Text => "My Text" });
# Add Menu Items to Menu Object
$mymenuitem->MenuItem( { Name => "Item1",
URL => "http://www.mydomain.com" } );
# Add Menu Item Object to the Menu
$mymenu->AddMenuItemObject( { MenuItem => $mymenuitem });
# Instead of creating a separate menu item object using MenuItem and
# adding the object to the menu using AddMenuItemObject,
# you can simply use AddMenuItem to do it in one step
$mymenu->AddMenuItem({ Name => "Item 2",
URL => "http://www.mydomain.com" });
$mymenu->AddSoftKeyItem({ Name => "Select", URL => "SoftKey:Select",
Position => "1" });
$mymenu->AddSoftKeyItem({ Name => "Exit", URL => "SoftKey:Exit",
Position => "2" });
# Print the Menu Object to the Phone
print $mymenu->Content;
Content-Type: text/xml
<CiscoIPPhoneMenu>
<Title>My Title</Title>
<Prompt>My Prompt</Prompt>
<MenuItem>
<Name>Item1</Name>
<URL>http://www.mydomain.com</URL>
</MenuItem>
<MenuItem>
<Name>Item 2</Name>
<URL>http://www.mydomain.com</URL>
</MenuItem>
<SoftKeyItem>
<Name>Select</Name>
<URL>SoftKey:Select</URL>
<Position>1</Position>
</SoftKeyItem>
<SoftKeyItem>
<Name>Exit</Name>
<URL>SoftKey:Exit</URL>
<Position>2</Position>
</SoftKeyItem>
</CiscoIPPhoneMenu>
B< Example using Execute object to push messages to the phone>
#!/usr/bin/perl
# Mark Palmer - markpalmer@us.ibm.com
# Must use authentication when POSTING an object to a Cisco IPPhone.
# User should be a user in the global directory associated with the phone
# Can use this script to send messages to IPPhones
use Cisco::IPPhone;
examples/directory.cgi view on Meta::CPAN
#!/usr/bin/perl
use Cisco::IPPhone;
$mydirectory = new Cisco::IPPhone;
# Create Menu Object
$mydirectory->Directory( { Title => "My Title",
Prompt => "My Prompt" });
# Add Directory Entries to Directory Object
$mydirectory->AddDirectoryEntry({ Name => "Entry 1",
Telephone => "555-1212" });
$mydirectory->AddDirectoryEntry({ Name => "Entry 2",
Telephone => "555-1234" });
# Add SoftKeyItems
$mydirectory->AddSoftKeyItem({ Name => "Dial", URL => "SoftKey:Dial",
Position => "1" });
$mydirectory->AddSoftKeyItem({Name => "EditDial", URL => "SoftKey:EditDial",
Position => "2" });
$mydirectory->AddSoftKeyItem({ Name => "Cancel", URL => "SoftKey:Cancel",
Position => "3" });
# Print the Menu Object to the Phone
print $mydirectory->Content;
__END__
examples/graphicmenu.cgi view on Meta::CPAN
#!/usr/bin/perl
use Cisco::IPPhone;
$mygraphicmenu = new Cisco::IPPhone;
$data = "FFFFFFFFFFFFFFFFFFFF";
# Create Menu Object
$mygraphicmenu->GraphicMenu( { Title => "My Image",
Prompt => "View the image",
LocationX => "-1", LocationY => "-1",
Width => "10",
Height => "10",
Depth => "2",
Data => "$data" });
$mygraphicmenu->AddMenuItem({ Name => "Image IBM Logo",
URL => "http://192.168.25.1/cgi-bin/idle.cgi" });
$mygraphicmenu->AddSoftKeyItem( { Name => "Update", URL => "SoftKey:Update",
Position => "1" });
$mygraphicmenu->AddSoftKeyItem( { Name => "Select", URL => "SoftKey:Select",
Position => "2" });
$mygraphicmenu->AddSoftKeyItem( { Name => "Exit", URL => "SoftKey:Exit",
Position => "3" });
print $mygraphicmenu->Content;
examples/iconmenu.cgi view on Meta::CPAN
#!/usr/bin/perl
use Cisco::IPPhone;
$myiconmenu = new Cisco::IPPhone;
$data = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF";
# Create Icon Menu
$myiconmenu->IconMenu( { Title => "Icon Menu",
Prompt => "Select an icon" });
$myiconmenu->AddMenuItem({ IconIndex => "1",
Name => "Menu Item 1",
URL => "http://192.168.250.31/cgi-bin/text.cgi" });
$myiconmenu->AddMenuItem({ IconIndex => "1",
Name => "Menu Item 2",
URL => "http://192.168.250.31/cgi-bin/text.cgi" });
$myiconmenu->AddMenuItem({ IconIndex => "1",
Name => "Menu Item 3",
URL => "http://192.168.250.31/cgi-bin/text.cgi" });
# Index is the numeric index of the icon to be displayed
# Up to 10 instances of iconitem can be displayed
$myiconmenu->AddIconItem ({ Index => "1",
Width => "10",
Height => "10",
Depth => "2",
Data => "$data" });
examples/image.cgi view on Meta::CPAN
#!/usr/bin/perl
use Cisco::IPPhone;
$myimage = new Cisco::IPPhone;
$mysoftkeyitem = new Cisco::IPPhone;
$data = "AAAAAAAAAA0AA8AAAAAAAAAAAA2A0000A0AAAAAAAA00000000A0AAAAAAAAAAAAAAAAAA0AA8AAAAAAAAAAAA820200A0AAAAAAAA0000000088AAAAAAAAAAAAAAAAAA0AA8AAAAAAAAAAAAAA0A00A0AAAAAAAA02000000A8AAAAAAAA0000000000000000000000000000000000000000000000000000000000000...
# Create Menu Object
$myimage->Image( { Title => "IBM Image", Prompt => "View the image",
LocationX => "-1", LocationY => "-1", Width => "120",
Height => "44", Depth => "2", Data => "$data" });
# Add SoftKeyItems to Menu Object
$mysoftkeyitem->SoftKeyItem( { Name => "Select", URL => "SoftKey:Select",
Position => "1" } );
$myimage->AddSoftKeyItemObject( { SoftKeyItem => $mysoftkeyitem });
$myimage->AddSoftKeyItem({ Name => "Exit", URL => "SoftKey:Exit",
Position => "2" });
# Print the Menu Object to the Phone
print $myimage->Content;
__END__
~;
examples/image_ibm.cgi view on Meta::CPAN
#!/usr/bin/perl
use Cisco::IPPhone;
$myimage = new Cisco::IPPhone;
$data = 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1F001000001F00FF0F40FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF010001000001401F00F4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF01FF011FF001F401F4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1FF01F00401F000F40FFFFFFFFF...
# Create Menu Object
$myimage->Image( { Title => "IBM Image", Prompt => "View the image",
LocationX => "-1", LocationY => "-1", Width => "53",
Height => "23", Depth => "2", Data => "$data" });
# Add SoftKeyItems to Menu Object
$myimage->AddSoftKeyItem({ Name => "Select", URL => "SoftKey:Select",
Position => "1" });
$myimage->AddSoftKeyItem({ Name => "Exit", URL => "SoftKey:Exit",
Position => "2" });
# Print the Menu Object to the Phone
print $myimage->Content;
__END__
~;
examples/input.cgi view on Meta::CPAN
#!/usr/bin/perl
use Cisco::IPPhone;
$myinput = new Cisco::IPPhone;
# Create Menu Object
$myinput->Input( { Title => "My Title",
Prompt => "My Prompt",
URL => "My URL" });
# Add Input Items to Input Object
$myinput->AddInputItem({ DisplayName => "Display Name1",
QueryStringParam => "QueryString1",
DefaultValue => "Default1",
InputFlags => "A"} );
$myinput->AddInputItem({ DisplayName => "Display Name2",
examples/menu.cgi view on Meta::CPAN
#!/usr/bin/perl
use Cisco::IPPhone;
$mymenu = new Cisco::IPPhone;
# Create Menu Object
$mymenu->Menu( { Title => "My Title", Prompt => "My Prompt", Text => "My Text" });
# Add Menu Item to Menu Object
$mymenu->AddMenuItem({ Name => "Item 1", URL => "http://www.mydomain1.com" });
# Add another menu item to Menu Object
$mymenu->AddMenuItem({ Name => "Item 2", URL => "http://www.mydomain2.com" });
# Add SoftKeyItems to Menu Object
$mymenu->AddSoftKeyItem({ Name => "Select", URL => "SoftKey:Select",
Position => "1" });
$mymenu->AddSoftKeyItem({ Name => "Exit", URL => "SoftKey:Exit",
Position => "2" });
# Print the Menu Object to the Phone
print $mymenu->Content;
__END__
examples/tickerinput.cgi view on Meta::CPAN
#!/usr/bin/perl
use Cisco::IPPhone;
$myinput = new Cisco::IPPhone;
$myinputitem = new Cisco::IPPhone;
# Create Menu Object
$myinput->Input( { Title => "Stock Quote - Yahoo! Finance",
Prompt => "Enter Stock Ticker",
URL => "http://$ENV{'SERVER_ADDR'}/cgi-bin/ticker.cgi" });
# Add Input Items to Input Object
$myinput->AddInputItem({ DisplayName => "Enter Ticker",
QueryStringParam => "ticker",
DefaultValue => "",
InputFlags => "A"} );
examples/weatherinput.cgi view on Meta::CPAN
#!/usr/bin/perl
use Cisco::IPPhone;
$myinput = new Cisco::IPPhone;
$myinputitem = new Cisco::IPPhone;
$SERVER = $ENV{'SERVER_ADDR'};
# Create Menu Object
$myinput->Input( { Title => "Weather Program",
Prompt => "Enter Zip Code",
URL => "http://$SERVER/cgi-bin/weather.cgi" });
# Add Input Items to Input Object
$myinput->AddInputItem({ DisplayName => "Enter Zip",
QueryStringParam => "zip",
DefaultValue => "",
InputFlags => "N"} );
( run in 2.027 seconds using v1.01-cache-2.11-cpan-49f99fa48dc )