| CallXML 2.0 Development Guide | Home | Frameset Home |
|
<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="2.0">
<block>
<playaudio value="http://www.myserver.com/greeting.wav"/>
<recordaudio format="audio/wav"
value="mailto:my-email@my-email-server.com"
termdigits="#"
maxtime="60s"
maxsilence="10s"
beep="TRUE"/>
<ontermdigit value="#">
<text> Your message has been sent.</text>
</ontermdigit>
<onmaxtime>
<text> You have reached maxtime. Message sent.</text>
</onmaxtime>
<onmaxsilence>
<text> Maxsilence exceeded. Message sent.</text>
</onmaxsilence>
</block>
</callxml>
<%@ LANGUAGE = VBScript %>
<%
Dim ConnectionToDB, DatabaseRecord
Set ConnectionToDB = Server.CreateObject("ADODB.Connection")
ConnectionToDB.Open "voxeo.community.Lesson.9.db"
SQLStr = "select * from PeopleIKnow Where CallerID = '" & _
Request.QueryString("session.callerid") & "'"
set DatabaseRecord = ConnectionToDB.Execute (SQLStr)
SQLStr -- This is a simple string variable that holds a SQL statement. The SQL statement "select" is when you want to read or load information out of database. If you look at the total syntax of the line, it will read something like this: "select * from <SPECIFIC TABLE> where <SPECIFIC COLUMN> = ' <SPECIFIC VALUE> 'People-I-Know -- This is a TABLE inside the database file itself. While our simple database here only contains one table, professional databases can have many tables, each of which is relational linked to one another. Like everything else in the database, it has to be set up before the script is executed CallerID -- This is a COLUMN inside the database file itself. It contains multiple entries (called ROWS) that each have a caller id valueRequest.QueryString("") -- This is an ASP Object that contains the entire query string. You simply have to reference the variable by name session.callerid -- This is actually a "callxml" variable which is passed along the query string with all of the other variables that callxml keeps in its environment space. As you may have guessed, it contains the value of the current caller id.
TextMessage = DatabaseRecord("Message")
response.write "<assign var=""Message""
value=""" & TextMessage & """/>"
ConnectionToDB.Close
set ConnectionToDB = nothing
<text>$Message;</text>
<%@ LANGUAGE = VBScript %>
<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="2.0">
<%
Dim ConnectionToDB, DatabaseRecord
Set ConnectionToDB = Server.CreateObject("ADODB.Connection")
ConnectionToDB.Open "voxeo.community.Lesson.9.db"
SQLStr = "Select * from PeopleIKnow Where CallerID = '" & _
Request.QueryString("session.callerid") & "'"
set DatabaseRecord = ConnectionToDB.Execute (SQLStr)
TextMessage = DatabaseRecord("Message")
response.write "<assign var=""Message""
value=""" & TextMessage & """/>"
ConnectionToDB.Close
set ConnectionToDB = nothing
%>
<block>
<text>$Message;</text>
<playaudio value="http://www.myserver.com/greeting.wav"/>
<recordaudio format="audio/wav"
value="mailto:my-email@my-email-server.com"
termdigits="#"
maxtime="60s"
maxsilence="10s"
beep="TRUE"/>
<ontermdigit value="#">
<text> Your message has been sent.</text>
</ontermdigit>
<onmaxtime>
<text> You have reached maxtime. Message sent.</text>
</onmaxtime>
<onmaxsilence>
<text> Maxsilence exceeded. Message sent.</text>
</onmaxsilence>
</block>
</callxml>
<callxml> element. This is becuase we want to use the callxml <assign> element from within the ASP section of code. All that you have to do is save this file as "helloworld.asp" (remembering to create and register a database file before trying to run the application).| ANNOTATIONS: EXISTING POSTS |
| login |
|