B. CPL Grammar
application ::= statedef { statedef | procdef | eventdef }*
statedef ::= stateheader statebody
stateheader ::= "state" statename
statename ::= string
statebody ::= "{" {eventdef}+ "}"
eventdef ::= "on" eventspec procbody
eventspec ::= { [ "ascii" ] "dtmf" matchpattern |
"speech" matchpattern |
"timer" timername | "enter" | "disconnect" }
matchpattern ::= stringexpr
timername ::= string
procdef ::= procheader procbody
procheader ::= "proc" procname
procname ::= string
procbody ::= "{" {statement}* "}"
statement ::= { "accept" | hangupcmd | invitecmd |
reccmd | statetrans | logcmd |
fwdcmd | timercmd | cvtcmd | tclcmd }
hangupcmd ::= "hangup" [ reasoncode ]
reasoncode ::= stringexpr
statetrans ::= "enter" statename
reccmd ::= "audiorec" filename
filename ::= stringexpr
logcmd ::= "log" stringexpr
fwdcmd ::= "redirect" destination
destination ::= phone-url | rtp-url
phone-url ::= "phone://" [ "+" countrycode "-" ] phoneno
countrycode ::= {digit}+
phoneno ::= digit { digit | '-' }*
rtp-url ::= "rtp://" hostspec [ ":" portnumber ]
hostspec ::= string
portnumber ::= {digit}+
cvtcmd ::= "cvt" varname stringexpr stringexpr
invitecmd ::= "invite" from info media
from ::= stringexpr
info ::= stringexpr
media ::= stringexpr
timercmd ::= "timer" timername { timerstart | "stop" }
timerstart ::= { "local" | "global" } timeout
timeout ::= hours":"minutes":"seconds
hours ::= integer
minutes ::= integer
seconds ::= seconds
tclcmd ::= branchcmd | execcmd | "exit" | incr |
procname | setcmd | whilecmd }
setcmd ::= "set" varname stringexpr
execcmd ::= "exec" command
branchcmd ::= "if" condition procbody [ "else" procbody ]
condition ::= "{" stringexpr operator stringexpr "}"
operator ::= ">", "<", "==", ">=", "<=", "!="
incr ::= "incr" varname [ increment ]
increment ::= stringexpr
whilecmd ::= "while" condition procbody
varname ::= string
stringexpr ::= """ string """ | "$" varname | integer
varname ::= string
string ::= {alphadigit}+
alphadigit ::= digit | alpha
integer ::= [ "-" ] {digit}+
digit ::= "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"
Repetition of curly bracketed groups are indicated by an asterisk (*) or
plus sign (+). An asterisk indicates that the group is optional and can be
further repeated any number of times; a plus sign indicates that the group must
by present and can by further repeated any number of times. Optional elements
are grouped using square brackets ([ ]).
File was created Wed Feb 26 18:31:47 1997 by tex2html