Telephony Based Telephony Based Grading SolutionGrading SolutionTelephony Based Telephony Based Grading SolutionGrading Solution
by Svechinsky Ella and by Svechinsky Ella and Simanovich LenSimanovich Len
ProjectProject
DescriptionDescriptionProjectProject
DescriptionDescription
Control Model
TAPIDataBase Main
answering service
Database inteface
DBIF
TAPI interface
ProjectTapiTAPI
GradesDBFeed
Database manager
Students - callers
• Solution enables:– Retrieving their grades using a dial-
phone.
• Server – Answers– Communicates– Retrieves grades
• We used:– TAPI SDKs– SQL DB– C#
Telephony Telephony OperatorOperator
Telephony Telephony OperatorOperator
IntroductionIntroductionto TAPI 3.0to TAPI 3.0
IntroductionIntroductionto TAPI 3.0to TAPI 3.0
• TAPI 3.0– Simple and generic methods for:
• making connections • accessing media streams
– Abstract call-control functionality.
Call Control Model for TAPI 3.0
ITCallHubCall HubAddress
ITAddress
ITTerminalSupport
ITMediaSupport
ITAddressEventNotification
ITCallNotification
TerminalITTerminal
IBasicVideo
ITBasicAudioTerminal
ITMediaSupportITBasicCallControl
ITCallTones
ITCallInfo
ITCallTonesNotification
ITConsultCall
ITParticipantInfo
Call
TAPIITTAPI
ITTAPIEventNotification
ITCallHubEventNotification
Telephony Operator Telephony Operator DesignDesign
Telephony Operator Telephony Operator DesignDesign
• Telephony Operator application:– features for dial-up modem
communication for Telephony Based Grading Solution project.
Definition of Definition of InterfacesInterfaces
Definition of Definition of InterfacesInterfaces
• Generalized solution:– Abstract interfaces.– Different kinds of communication.
• Defined interfaces:– IEngine– ILine– ICall– IDisconnectCallBack
• Enable communication• Support:
– multiple lines.– incoming and outgoing requests.– receiving and sending data.
Communication Control Model
Line WaitForNewCall
GatherOneDigit
PlayMessage GatherDigits
DisconnectCall ClearDigitEvents
Call
Engine Initialize Shutdown GetFirstLine
GetNextLine
DisconnectCallBack
DisconnectCallBack
DisconnectCallBack Interface
• Assigned to the Call object.• Callback interface.• Signals the main server.
Implementation of Implementation of InterfacesInterfaces
Implementation of Implementation of InterfacesInterfaces
• Using TAPI 3.0:– ProjectEngine– ProjectLine– ProjectCall
• Multiple modems.• One TAPI object = Engine object.• Dial-up modem = Line object.• Incoming call = Call object.• Methods:
– multithreaded– callback
ProjectEngine implementation
• ProjectEngine:– TAPI object– ArrayList with Line objects.
ProjectEngine implementation (cont.)• Multithreaded methods allow:
– Registration for Lines.– Listening for TapiEvents.– Receiving events for all.– Identification of Line.– Passing event to the Line.
Project Line implementation
• ProjectLine:– TAPI object– Address of dial-up modem– Call object for a current call– Queue object with DigitEvents
Project Line implementation (cont.)• Multithreaded methods allow:
– Handling TapiEvents.– Getting a new call.
Project Line implementation (cont.)• NOTE:
– Always answering the incoming call.– Delayed disconnection (Visual
Studio .Net 2003)
ProjectCall implementation
• ProjectCall object:– ProjectLine object– CallInfo object.
ProjectCall implementation (cont.)• Multithreaded callback methods
allow:– Gathering one or more DigitEvents.– Playing audio messages.– Disconnecting.
• NOTE:– IsConnected() method is enabled.
Data-Base Side Data-Base Side and Main Serviceand Main Service
Telephony Operator Telephony Operator ProjectProjectData-Base Side and Main Data-Base Side and Main ServiceService
TAPIDataBase Main
answering service
Database inteface
DBIF
TAPI interface
ProjectTapiTAPI
GradesDBFeed
Database manager
Students - callers
Overview
Telephony Operator Project Telephony Operator Project Data-Base Side and Main ServiceData-Base Side and Main Service
• Implemented using Microsoft SQL server 2000.
• The logic of managing the information is done in stored procedures.
Data Base
Telephony Operator Project Telephony Operator Project Data-Base Side and Main ServiceData-Base Side and Main Service
• The queries in the Main Service are done in real time, so it has to be fast. The database is designed to have fast queries, on GradesDBFeed’s expense.
• The database is on one of the lab server. The connection to it is done with a connection string, using SqlConnection object.
Data Base
Telephony Operator Project Telephony Operator Project Data-Base Side and Main ServiceData-Base Side and Main Service
Data Base Tables and Relationships
Telephony Operator Project Telephony Operator Project Data-Base Side and Main ServiceData-Base Side and Main Service
• SP_last_grade_course_occurrence_update - used every time that a grade in changed/deleted.
• SP_last_grade_all_students_course_update - used whenever a course occurrence is changed/deleted, and we have to update the records of all the students that were registered to this course occurrence.
•SP_last_grade_course_update - used every time that a grade is changed/deleted, or the time of a course occurrence is changed/deleted.
Data BaseSpecial Stored Procedures
Telephony Operator Project Telephony Operator Project Data-Base Side and Main ServiceData-Base Side and Main Service
Data Base Data integrity
Change in students table
Change in grades table
Change in course
occurrences table
Change in courses table
Automatic change
Automatic change
Automatic change
Last_grade_all_students_course
Last_grade_courseLast_grade_course_occurrence
Telephony Operator Project Telephony Operator Project Data-Base Side and Main ServiceData-Base Side and Main Service
•MasterForm•StudentsForm•CoursesForm•CourseOccurrencesForm•GradesForm
GradesDBFeed Forms Application
Telephony Operator Project Telephony Operator Project Data-Base Side and Main ServiceData-Base Side and Main Service
GradesDBFeed Data Adapter
DataBase
Data Adapter(operates stored
procedures upon a change in the data set)
insert
select
delete
update
SP1
SP6
SP5
SP4
SP3
SP2
Stored procedures
Data set
Form
Telephony Operator Project Telephony Operator Project Data-Base Side and Main ServiceData-Base Side and Main Service
•This class library has an explicit function for every query.
•This code uses the AutoSProc tool.
DBIF Class Library (Database Interface)
Telephony Operator Project Telephony Operator Project Data-Base Side and Main ServiceData-Base Side and Main Service
// creating a command object with the stored procedure nameSqlCommand cmd = new
SqlCommand("SP_valid_student_password", cnn);cmd.CommandType = CommandType.StoredProcedure;//defining the parameters that the stored procedure getscmd.Parameters.Add("@student_id",SqlDbType.VarChar,50).V
alue=student_id;cmd.Parameters.Add("@student_password",SqlDbType.VarCh
ar,50).Value=student_password;cmd.Parameters.Add("@valid", SqlDbType.Int);cmd.Parameters["@valid"].Direction=ParameterDirection.Out
put;//executing the sql command
DBIF Class Library AutoSProc
public interface ISprocCalls: ISprocBase {
int SP_valid_student_password(string student_id, string student_password, ref int valid);
...}
Telephony Operator Project Telephony Operator Project Data-Base Side and Main ServiceData-Base Side and Main Service
•Most of the operations are allowed for a maximum number of tries.
This service is implemented only for one phone line.
•Has a function for handling grammer of reading a number a loud. It combines a set of messages to one array."the number of points is 99.5" is translated to
"the number of points is ",90","9","and, "a half".
MainService
Telephony Operator Project Telephony Operator Project Data-Base Side and Main ServiceData-Base Side and Main Service
MainService
Entering the system,Initialize
Waitingfor
a call
Data Request
Main menuStudent’s
details
Drop,Dissconnect the system,
Exit
End call
Succeeded Succeeded
Succeeded, valid
User chose one of
the datarequest options
Failed
FailedFailed,
not valid,disconnected
Stop listening to events of attempts to start a call
User chose to give Another
student’sdetails
User asked to end call,disconnected,
failed
Asked to repeat the menu
Note: when a data request failed, it’s one of the possible results for a data request. It does not require a separate state.
Asked toreturnto the
calling menu
Dissconnected
Failed
Succeeded
Start state
Stop state
User asked to repeat the same request
Sub menuUser chose a sub-menu
Asked to repeat the menu
User asked to end call,disconnected,
failed
User asked to repeat to the main menu
Telephony Operator Project Telephony Operator Project Data-Base Side and Main ServiceData-Base Side and Main Service
•System design and Layers of abstractions
•C# and .Net
•Databases: stored procedures and data integrity.
What did we have here? (key learnings)
THE ENDTHE END