📄 rfc3149.txt
字号:
|______________|_|____________________________________________________|
|CARD |:|<card id=STRING> CLUSTERS </card> |
|______________|_|____________________________________________________|
|CARDREFERENCE |:|#STRING |
|______________|_|____________________________________________________|
|CLUSTERS |:|CLUSTER | CLUSTER CLUSTERS |
|______________|_|____________________________________________________|
|CLUSTER |:|CONTROL | TIMER | ECHO | PARAGRAPH COMPONENTS </p> |
|______________|_|____________________________________________________|
|COMPONENTS |:|COMPONENT | COMPONENT COMPONENTS |
|______________|_|____________________________________________________|
|COMPONENT |:|TEXT | INPUTBOX | SELECTBOX | STIME | CALLTIMER |
|______________|_|____________________________________________________|
|CONTROL |:|<do CONDITION> ACTION </do> |
|______________|_|____________________________________________________|
|CONDITION | |type=["accept" | "prev" | "ontimer"] label=STRING | |
| | |type=["accept" | "prev" |"ontimer"] |
|______________|_|____________________________________________________|
|DIGITS |:|DIGIT | DIGIT DIGITS |
|______________|_|____________________________________________________|
|DIGIT |:|0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|______________|_|____________________________________________________|
|DECK |:|<xml id=STRING> CARDS </xml> |
|______________|_|____________________________________________________|
|ECHO |:|<echo/> | <echo ECHOMODE/> |
|______________|_|____________________________________________________|
Srinath, et al. Informational [Page 25]
RFC 3149 MGCP Business Phone Packages September 2001
|ECHOMODE |:|mode=["on" | "off"] |
|______________|_|____________________________________________________|
|HREFSTRING |:|CARDREFERENCE | POSTSTRING |
|______________|_|____________________________________________________|
|INPUTBOX |:|<input INPUTATTRS/> |
|______________|_|____________________________________________________|
|INPUTATTRS |:|INPUTATTR | INPUTATTR INPUTATTRS |
|______________|_|____________________________________________________|
|INPUTATTR |:|name=STRING | type=["text" | "password"] | |
| | | value=STRING |
|______________|_|____________________________________________________|
|NAMEVALUES |:|NAMEVALUE | NAMEVALUE?NAMEVALUES |
|______________|_|____________________________________________________|
|NAMEVALUE |:|NAMEVALUEELEM | NAMEVALUEELEM=NAMEVALUELEM |
|______________|_|____________________________________________________|
|NAMEVALUELEM |:|%TEXT | TEXT |
|______________|_|____________________________________________________|
|OPTIONS |:|OPTION | OPTION OPTIONS |
|______________|_|____________________________________________________|
|OPTION |:|<option value=STRING onpick=HREFSTRING> TEXT |
| | | </option> |
|______________|_|____________________________________________________|
|PARAGRAPH |:|<p TXTFORMAT> | <p> |
|______________|_|____________________________________________________|
|POSTSTRING |:|post?%deck?%id?NAMEVALUES | post?NAMEVALUES |
|______________|_|____________________________________________________|
|SELECTBOX |:|<select SELECTATTRS> OPTIONS </select> |
|______________|_|____________________________________________________|
|SELECTATTRS |:|SELECTATTR | SELECTATTR SELECTATTRS |
|______________|_|____________________________________________________|
|SELECTATTR |:|name=STRING | iname=STRING | type="item" |
|______________|_|____________________________________________________|
|STIME |:|<time STIMEATTRS/> |
|______________|_|____________________________________________________|
|STIMEATTRS |:|STIMEATTR | STIMEATTR STIMEATTRS |
|______________|_|____________________________________________________|
|STIMEATTR |:|value=STRING | format=STRING | ALIGN |
|______________|_|____________________________________________________|
|STRING |:|Any string enclosed in a pair of quotes ("") |
|______________|_|____________________________________________________|
|TEXT |:|TEXTELEM | TEXTELEM TEXT |
|______________|_|____________________________________________________|
|TEXTELEM |:|any string outside of the < .. > and which consists |
| | |of any symbols except '<' and '\n' |
|______________|_|____________________________________________________|
|TIMER |:|<timer value="DIGITS"/> |
|______________|_|____________________________________________________|
Srinath, et al. Informational [Page 26]
RFC 3149 MGCP Business Phone Packages September 2001
|TXTFORMAT |:|ALIGN | TXTMODE | ALIGN TXTMODE | TXTMODE ALIGN |
|______________|_|____________________________________________________|
|TXTMODE |:|mode=["wrap" | "nowrap"] |
|______________|_|____________________________________________________|
______________ _ ____________________________________________________
| | |\t, \n, \r, blank space are separators. |
|______________|_|____________________________________________________|
Appendix B: Sample XML Documents, Renderings and Events
This section presents some sample XML documents and details how they
are translated to a business phone with a simple LCD display.
B.1 Sample Deck 1 (Itemized List Box)
Below is a simple deck containing one card that defines a simple main
menu interface using an itemized list box:
<xml>
<card id="home">
<p mode="nowrap">$dn <time align="right"></time>
<select type="item" name="Menu" iname="StrMenu">
<option value="1" onpick="post?%deck?%id?%name=%value">MENU</option>
</select>
</p>
</card>
</xml>
The card (home) contains three components:
1. A paragraph (<p>). The paragraph contains a variable ($dn)
that shows the phone's extension.
2. A clock (<time>). The clock is aligned to the right.
3. An itemized list (<select>) containing one item (MENU).
An XML request for this deck and card might look like:
S: XML/xml(deck?home?$dn=2344)
After variable substitution, the phone may render the XML to the
display as follows:
--------------------
|2344 11:59|
| MENU |
--------------------
[XX] [XX] [XX]
Srinath, et al. Informational [Page 27]
RFC 3149 MGCP Business Phone Packages September 2001
Here, MENU maps to the first soft key below the display. If the user
presses the first soft key, the following event will be generated:
O: XML/xml(post?basic?home?Menu=1).
B.2 Sample Deck 2 (Enumerated List Box)
The next sample deck defines a simple enumerated list box card:
<xml>
<card id="gelist">
<p>$title
<select name="x-name" iname="x-iname">
<option value="$value1"
onpick="post?%deck?%id?%name=%value?%iname=%x-iname">$opt1
</option>
<option value="$value2"
onpick="post?%deck?%id?%name=%value?%iname=%x-iname">$opt2
</option>
<option value="$value3"
onpick="post?%deck?%id?%name=%value?%iname=%x-iname">$opt3
</option>
<option value="$value4"
onpick="post?%deck?%id?%name=%value?%iname=%x-iname">$opt4
</option>
<option value="$value5"
onpick="post?%deck?%id?%name=%value?%iname=%x-iname">$opt5
</option>
</select>
</p>
<do type="prev">
<prev></prev>
</do>
</card>
</xml>
The card (gelist) contains four components:
1. A paragraph (<p>). The paragraph contains a title variable
describing the list contents.
2. An enumerated list (<select>) containing five items. When an
item is selected, the XML layer sends the XML/xml event to the
Call Agent.
3. A do tag (<do>) indicating that when a "previous" event has
occurred, to go to the previous page (<prev>).
Srinath, et al. Informational [Page 28]
RFC 3149 MGCP Business Phone Packages September 2001
An XML request for this deck and card might look like:
S: XML/xml(list?gelist?$title=Select a Car?
$value1=Item1?$opt1=Porsche?
$value2=Item2?$opt2=Chevrolet?
$value3=Item3?$opt3=Toyota?
$value4=Item4?$opt4=Daewoo?
$value5=Item5?$opt5=Yugo)
After variable substitution, the phone may render the XML to the
display as follows:
--------------------
|SELECT A CAR |
|1. Porsche v|
--------------------
[XX] [XX] [XX]
Here, the display may be scrolled to reveal the additional items that
may be selected and the keypad '1', '2', etc may be used to select
the item. These details are phone-specific. For instance, on a
larger 4-line display containing navigation keys, the XML may be
rendered as follows:
--------------------
|SELECT A CAR |
|=>Porsche<= |
| Chevrolet |
| Toyota v|
--------------------
When the user selects item 1, the following message will be sent to
the Call Agent:
O: XML/xml(post?list?gelist?x-name=Item1?x-iname=1)
B.3 Sample Deck 3 (Text Box)
This sample shows how to implement a simple text box:
<xml>
<card id="generic">
<p>$cldpty</p>
<p>CALL FAILED</p>
</card>
</xml>
Srinath, et al. Informational [Page 29]
RFC 3149 MGCP Business Phone Packages September 2001
The card (generic) contains two paragraphs. The absence of a
selectable list, input box or echo box indicates that this is a text
box.
An XML request for this deck and card might look like:
S: XML/xml(deck?generic?$cldpty=John Doe)
After variable substitution, the phone may render the XML to the
display as follows:
--------------------
|JOHN DOE |
|CALL FAILED |
--------------------
[XX] [XX] [XX]
B.4 Sample Deck 4 (Echo Box)
This sample show how to implement a simple echo box. The XML layer
does not consume any keystrokes.
<xml>
<card id="getdigits">
<p>Dial Number:</p>
<echo mode="$mode" align="left"/>
</card>
</xml>
The card (getdigits) contains a paragraph of text and an echo box.
An XML request for this deck and card might look like:
S: XML/xml(deck?getdigits?$mode=on)
After variable substitution, the phone may render the XML to the
display as follows:
--------------------
|DIAL NUMBER: |
| |
--------------------
[XX] [XX] [XX]
All user input is displayed but not consumed by the XML layer.
Srinath, et al. Informational [Page 30]
RFC 3149 MGCP Business Phone Packages September 2001
B.5 Sample Deck 5 (Input Box)
This sample implements a basic input box:
<xml>
<card id="ginput">
<p>$title
<input name="x-name"/>
</p>
<do type="accept">
<go href="post?%deck?%id?%name=%value"/>
</do>
<do type="prev">
<prev></prev>
</do>
</card>
</xml>
The card (ginput) contains:
1. A paragraph <p>. The paragraph contains a title.
2. An input box <input>. The input box consumes keypad events and
reports them when input is complete.
3. Two event handlers <do>. The first handles the accept event.
This event indicates that the user has completed keypad input
and posts an observed event to the Call Agent. The second
handles the prev event. This event indicates that the user has
re
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -