⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 phoneoverview.html

📁 JTAPI_html 用于JTAPI的HTML文档.
💻 HTML
字号:
<HTML><HEAD><TITLE>The Java Telephony API Phone Package</TITLE><!-- Changed by: , 22-Sep-1996 --><!-- Changed by: Jordan M. Slott, 22-Jan-1997 --><! FRAMESET COLS="120%,*"></HEAD><BODY BGCOLOR=#ffffff><IMG SRC="images/jtapi-1.1.logo.gif" ALIGN="left"><BR><BR><BR><BR><BR><BR><H1><CENTER>Java Telephony API</CENTER></H1><H2><EM><CENTER>Phone Extension Package<BR><BR>January 28, 1997<BR>Version 1.1</CENTER></EM></H2><BR><BR><BR><BR><BR><H2>Introduction<HR></H2><P>This document provides an overview of the <EM>Phone Extension Package</EM> tothe Java Telephony API. The Phone Extension Package permits implementationsto describe physical Terminals in terms of standardized components.Applications may query each Terminal, using this package, for the componentsof which it is made and control certain attributes of these components.</P><P><HR><FONT SIZE=+1><STRONG>Note:</STRONG><EM>The Phone Extension Package was previously named the <STRONG>Set ExtensionPackage</STRONG> in Version 1.0 of this specification. Because of overwelmingfeedback on this specification, the Java Telephony Specification workingpartners decided the term <STRONG>Set</STRONG> was ambiguous and has manymeanings. Additionally, backwards compatability to the name <STRONG>Set</STRONG>will <STRONG>NOT</STRONG> be maintained. We apologize for any inconvienience thismay have caused.</EM></FONT><HR></P><P>The Phone Extension Package defines a number of components standard totraditional telephone-set hardware. These components include speakerphone,microphone, display, buttons, ringer, handset, andlamp. Each component exports a standard interface to control its attributes.For example, the ringer permits applications to control its volume, whilethe buttons permit applications to simulate pressing buttons.</P><BR><H3>Overview Document Organization</H3><P>This overview document is organized into the following sections:</P><TABLE CELLPADDING=10 WIDTH="100%"><TR><TD WIDTH="30%"><A HREF="PhoneOverview.html#ARCHITECTURE">Phone Package Architecture</A></TD><TD WIDTH="70%">This section summarizes the architecture used by the Phone Extension Packageto describe Terminals in term of the standard telephone-set components.</TD></TR><TR><TD WIDTH="30%"><A HREF="PhoneOverview.html#TERMINAL">Extending the Terminal interface</A></TD><TD WIDTH="70%">The section summarizes the <STRONG><EM>java.telephony.PhoneTerminal</EM></STRONG>interface. This interface extends the core Terminal interfaces to permitapplications to query for the number and kinds of components of which it iscomposed.</TD></TR><TR><TD WIDTH="30%"><A HREF="PhoneOverview.html#COMPONENTS">Phone Package Standard Components</A></TD><TD WIDTH="70%">This section describes the standard components in this package used todescribed traditional telephone-set hardware.</TD></TR></TABLE><H3>Java Specifications and Related Overview Documents</H3>The specification for the Phone Extension Package may be found at:<BR><A HREF="java.telephony.phone-packages.html">The Java Telephony Phone ExtensionPackage</A><BR><BR>The specification for the Java Telephony API may be found at:<BR><A HREF="java.telephony-packages.html">The Java Telephony API Specification</A><BR><BR>The Roadmap Overview to the Java Telephony API may be found at:<BR><A HREF="Roadmap.html">The Java Telephony API Roadmap</A><BR><BR>The primary Overview document to the Java Telephony API may be found at:<BR><A HREF="Overview.html">The Java Telephony API Overview</A><BR><BR><BR><BR><H2><A NAME="ARCHITECTURE">Phone Package Architecture.</A><HR></H2><P>This section explains how the Phone package describes Terminals in terms oftheir individual components.</P><H3>Component Interface</H3><P>The Phone package consists of approximately a half-dozen interfaces, eachmodelling some physical feature of a traditional telephone hardware set. Thereexists interfaces to model buttons, displays, lamps, ringers, hookswitches,speakers, and microphones. Each of these distinct interfaces provide methodsto control the attributes inherent to each component type.</P><P>Each individual component extends the <STRONG>Component</STRONG> interface. Thesecorresponding individual component interfaces are: <STRONG>PhoneButton</STRONG>,<STRONG>PhoneDisplay</STRONG>, <STRONG>PhoneLamp</STRONG>, <STRONG>PhoneRinger</STRONG>,<STRONG>PhoneHookswitch</STRONG>, <STRONG>PhoneSpeaker</STRONG>, and<STRONG>PhoneMicrophone</STRONG>. Each component is identified by its type anda string name.</P><H3>ComponentGroup Interface</H3><P>One or more individual components are organized into component groups. Thesecomponent groups represent an association between components as they existon the actual, physical hardware. Applications obtain an array of thecomponents associated with a component group via the <EM>getComponents()</EM>method on this interface.</P><P>There may be more than one ComponentGroup associated with a single Terminalobject. Applications obtain an array of the component groups associated witha Terminal via the <EM>getComponentGroups()</EM> method on the<STRONG>PhoneTerminal</STRONG> interface.</P><P>Terminals may have more than one ComponentGroup for the following reasons: attimes an implementation may want to model a physical endpoint (i.e. Terminal)with two groups of components. One of these groups may model a telephonehardware set sitting on a person's desktop, while the other group may modela "virtual" telephone set drawn on the person's workstation's display.</P><P>Only a single ComponentGroup may be "activated" on a Terminal at a time. Theact of activating a ComponentGroup enables its components to become activelypart of the telephone call. For example, if a speaker component is part ofa ComponentGroup which is activated, that speaker will receive all of themedia sent to it. Applications activated a ComponentGroup with the<EM>activate()</EM> method and deactivate a group with the <EM>deactivate()</EM>method.</P><BR><BR><H2><A NAME="TERMINAL">Extending the Terminal Interface</A><HR></H2><P>The Phone Extension Package extends the core Terminal interface with the<STRONG>PhoneTerminal</STRONG> interface. This interface permitsapplications to query for the components which make up the Terminal object.</P><P>As described in the previous section, each Terminal is composed of zero ormore <EM>ComponentGroups</EM>. These groups are obtained via the<STRONG>PhoneTerminal.getComponentGroups()</STRONG> method. The following codesegment queries for the Terminal named "5551212" and for the groups ofcomponents associated with this Terminal.</P><PRE>try {  Terminal terminal = myprovider.getTerminal("5551212");  ComponentGroup groups[];  if (terminal instanceof PhoneTerminal) {    groups = ((PhoneTerminal)terminal).getComponentGroups();  }} catch (Exception excp) {  // Handle exceptions}</PRE><P>Once an application obtains a list of groups, it may choose to activate oneof these groups. The meaning of activating and deactivating a group ofcomponents was described in the previous section. The following code segmentchooses the first group and activates it.</P><PRE>if (groups != null &amp;&amp; groups.length >= 1) {  try {    groups[0].activate();  } catch (Exception excp) {    // Handle exceptions  }}</PRE><P>Next, applications may query for the array of individual components in thecomponent group. An application may iterate through this array and control theattributes of each component-type. In the code sample below, the applicationlooks for the microphone component and sets it on the maximum volume.</P><PRE>Component components[] = groups[0].getComponents();for (int i = 0; i < components.length; i++) {  if (components[i] instanceof MicrophoneComponent) {    MicrophoneComponent mic = (MicrophoneComponent)components[i];    mic.setVolume(MicrophoneComponent.FULL);  }}</PRE><BR><BR><H2><A NAME="COMPONENTS">Phone Package Standard Components</A><HR></H2><P>The Phone Extension Package defines a number of standard components found ontraditional telephone hardware. Each component exports its own interfaces andcontrols over its attributes. Each component also has specific events indicating when its attributes change. This section briefly describes eachcomponent, the methods available on its interfaces, and the event associatedwith them.</P><H3><IMG SRC="images/magenta-ball.gif">Button Component</H3><OL><P>The <STRONG>PhoneButton</STRONG> component models a button on a telephone keypad.Applications may "press" this button via the <EM>buttonPress()</EM> on thePhoneButton interface. Each button has an indentifying piece of informationassociated with it (e.g. the text label on the telephone keypad button).Applications may obtain and set this information via the <EM>getinfo()</EM>and <EM>setInfo()</EM> methods, repsectively. Additionally, there may bea lamp-component associated with a button, obtained via the<EM>getAssociatedPhoneLamp()</EM> method.</P><P>Applications receive the <EM>ButtonPressEv</EM> event when the button componenthas been pressed and the <EM>ButtonInfoEv</EM> when the identifyinginformation on the button has changed.</P></OL><H3><IMG SRC="images/magenta-ball.gif">Display Component</H3><OL><P>The <STRONG>PhoneDisplay</STRONG> component models the display on thetelephone hardware set. This display is composed of a certain number ofrows and columns. Applications may set and obtain the text displayed ata particular coordinate via the <EM>setDisplay()</EM> and <EM>getDisplay()</EM>methods, respectively.</P><P>When any information on the display has changed, the application receives the<EM>DisplayUpdateEv</EM>.</P></OL><H3><IMG SRC="images/magenta-ball.gif">Hookswitch Component</H3><OL><P>The <STRONG>PhoneHookswitch</STRONG> component models the physical hookswitch ona telephone hardware set. (A <EM>hookswitch</EM> is the level component on thetelephone set on which the handset rests, which is depressed when the phoneis on-hook.) The Hookswitch component can either be in an ON_HOOK state or anOFF_HOOK state. The application may set and obtain the hookswitch state viathe <EM>setHookswitchState()</EM>) and <EM>getHookswitchState()</EM> methods,respectively.</P><P>Applications receive the <EM>HookswitchStateEv</EM> event when the state ofa hookswitch changes.</P></OL><H3><IMG SRC="images/magenta-ball.gif">Lamp Component</H3><OL><P>The <STRONG>PhoneLamp</STRONG> component models a light-indicator on the telephonehardware set. Often, this lamp is a single green-color or red-color LED. Lampcomponents have a "mode" attribute which indicate the pattern of its flashinglight. For example, the lamp mode can be LAMPMODE_FLUTTER, LAMPMODE_STEADY,or LAMPMODE_WINK, to name a few. Applications may set and obtain the lampmode via the <EM>setMode()</EM> and <EM>getMode()</EM> methods, respectively.Additionally, lamp components may be associated with a button component. Thisbutton component is obtained via the <EM>getAssociatedPhoneButton()</EM> method.</P><P>Applications receive the <EM>LampModeEv</EM> when the mode of the lamp componenthas changed.</P></OL><H3><IMG SRC="images/magenta-ball.gif">Microphone Component</H3><OL><P>The <STRONG>PhoneMicrophone</STRONG> component represents the audio input deviceon a telephone hardware set. The microphone has a single attribute: its gain.Applications may set or obtain the microphone's gain via the <EM>setGain()</EM>and <EM>getGain()</EM> methods, respectively.</P><P>Applications receive the <EM>MicrophoneGainEv</EM> event when the gain of amicrophone component has changed.</P></OL><H3><IMG SRC="images/magenta-ball.gif">Ringer Component</H3><OL><P>The <STRONG>PhoneRinger</STRONG> component represents the audible ringing deviceon a telephone hardware set. The ringer component has several attributes.First, applications may control the ringing pattern of the ringer component.In order to control the ringing pattern, applications obtain the number ofringing patterns via the <EM>getNumberOfRingPatterns()</EM> method. Applicationsthen set the ringing pattern via the <EM>setRingerPattern()</EM>. It uses aninteger index value between zero and the number of ringing patterns minusone. Applications may obtain the current ringing pattern via the<EM>getRingingPattern()</EM> method, and the number of rings which have alreadyhappened via the <EM>getNumberOfRings()</EM> method.</P><P>The ringer component also has a volume attribute that may be set or obtainedvia the <EM>setRingerVolume()</EM> and <EM>getRingerVolume()</EM> methods,respectively.</P><P>Applications receive the <EM>RingerPatternEv</EM> when the ringing pattern haschanged on the ringer component and the <EM>RingerVolumeEv</EM> when the ringervolume has changed.</P></OL><H3><IMG SRC="images/magenta-ball.gif">Speaker Component</H3><OL><P>The <STRONG>PhoneSpeaker</STRONG> component represents the audio output deviceon a telephone hardware set. The speaker has a single attribute: its volume.Applications may set or obtain the speaker's volume via the <EM>setVolume()</EM>and <EM>getVolume()</EM> methods, respectively.</P><P>Applications receive the <EM>SpeakerVolumeEv</EM> event when the volume of aspeaker component has changed.</P></OL></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -