Auto Reminder

For developer

Introduction

In the Auto Reminder sample application, we can import appointments with one click. The contacts in the appointments will be contacted in several ways. Before the appointment in a given time the program can call and read notification messages, send SMS messages or e-mails to the participants according to the contact’s details in Microsoft Outlook. While the program is running, the scheduled reminders will inform the participants of the appointment at the right time.

Software requirements

  • Microsoft Windows 7, 8, 10, Vista
  • Microsoft Visual Studio 2012, .NET 4.0

Installation and Configuration of Ozeki Phone System XE

In order to connect to the server, Ozeki Phone System XE has to be installed. A Setup Guide can be found here: How to install and configurate your Ozeki Phone System XE, the installation package can be downloaded from the following page: Download. After the installation, the main page of the PBX can be accessed on the http://localhost:7777/Home address.

ozeki phone system xe login screen
Figure 1 - Ozeki Phone System XE login screen

For the first login attempt, use the username and password, which was provided during the installation process.

New user can be added to the system with the Add user button. It can be found under the Office users menu item in the Connections menu.

add new user
Figure 2 - Add new user

The username and password specified here can be used to connect to the system, in the OPSClient LoginAsync method.

new user configuration panel
Figure 3 - New user configuration panel

How to use the sample program

At the start, the login screen appears where the address and port of the Ozeki Phone System SDK service have to be provided with the username and password, which was created in the office users menupoint in Ozeki Phone System XE.

Settings

After the login click on the Settings menupoint to provide the basic operation settings. On the General tab, the setting of the API extension is required for calling and message sending. An API extension has to be installed (Extensions/Install new) in Ozeki Phone System XE, which will be used by this sample program. Next the ID of this extension has to be added.

At the Email settings on the E-mail tab, the sender’s e-mail address has to be provided. This e-mail address will be displayed as the sender ID in the outgoing message. It can be specified that the program should send the reminder to the recipient’s first or all e-mail addresses.In the parameterised e-mail template, the content of the sent e-mail can be specified by using the contact data. These options can also be applied to the phone number of the person, the SMS message content and the content of the read text. The options can be set on the SMS and Call tabs.

For sending the various reminder types (calls, SMSs, e-mails), the Auto Reminder uses the template of the given reminder type, which can be found at the settings of that particular reminder type. These templates can be freely parameterised, which results that the received text will be personal and informative. The used parameters gain information from the events, which belong to the reminder and from the data of the reminded party. The complete paramter list and the report that belongs to it is listed below:

Parameters related to the event

  • $location - The location of the event
  • $subject - The subject of the event
  • $duration - The duration of the event in minutes
  • $description - The description of the event
  • $startTime – The startingdate of the event
  • $endTime – The endingdate of the event
  • $creationTime – The creation time of the event

Parameters related to the reminded party

  • $emailAddress - The e-mail address of the reminded party
  • $phoneNumber - The phone number of the reminded party
  • $address - The address of the reminded party
  • $firstName –The first name of the reminded party
  • $lastName - The last name of the reminded party
  • $fullName - The full name of the reminded party

Operation

By clicking on the Import from Outlook… menupoint of the File menu, the data of the appointments, which were added in Outlook will be loaded to the program. Before starting the import, there have to be set accounts, contacts and added appointments. After the successful import, the appointments will be displayed on the main screen.

On the Reminders tab, which is in Settings menupoint, three kinds of reminders can be specified for these appointments: SMS, Email and call. It is required to set the time amount, which will determin when the program should call or send a reminder before the appointment starts. Clicking on the Add and then on the OK button the reminder will be saved. While the program is running it automatically executes the scheduled calls and message sendings at the appropriate time. The status change of the reminders can also be seen on the main screen. In case the time of the reminder is the same as the time before the start of the appointment, the reminder is immediately executed so the behavior can be tested right away.

Implementation

The implementation refers, uses the OzCommon projects in the project on which the GUI elements of the AutoReminder are partly built. There are further functionalities, which are used by the sample program from the common projects.

Model

In the App.xaml background code of the program, the required classes at the start are initialised, the shared components are registered to the IOC container. For example the OutlookCalendarParser, which will contact MS. Outlook, the UserInfoSettingsRepository, which stores the settings or the Client, which is the surface class of Ozeki Phone System XE SDK client. The warning windows pop up from here in case of an error occurs, the LoginWindow, at the start, the AutoReminderMainWindow, which belongs to the MainViewModelafter the login.

In the MainViewModelmodel class, the Reminder class is instantiated, which will schedule the set reminders, handle the calls and message sendings. It requests the settings in the InitSettings()method, which are stored in the IGenericSettingsRepository, if necessary it creates the default values as well. The AppPreferences class is a model, which stores settings. The followings are stored in it: set reminders (ReminderActionEntry), entries displayed in the table (ReminderActionEntry), previously imported appointments, template texts etc. Start the import process in the InitStart()method, after the import process is completed (OutlookParserOnAppointmentsParsed()) the waiting window disappears, the appointment list is updated on the main screen and then the appointments are saved to the settings.

  • OutlookCalendarParser

  • Settings given to the Start() method, the import process starts on a separate thread (InternalStart()). Here, it connects to the Outlook COM interface then requests the actual appointments and the related contactsvia the Outlook COM interface. TheOutlookCalendarParser gathers the contact data: names, phone numbers, email addresses. The completed data class, which contains the appointments and the data of the related contacts (Appointment class) will be shown as an event by the parser (AppointmentFound). Furthermore it indicates when the parsing is completed.

  • Reminder

	var call = apiExtension.CreateCall(number.Replace(" ", ""));
	…
	call.Start();

	callDone.WaitOne();

	TextToSpeech speech = newTextToSpeech();
	speech.Stopped += (o, eventArgs) =>call.HangUp();
	call.ConnectAudioSender(speech);
	var message = settings.CallTemplate;
	var context = _templateModifier.CreateCurrentContext(appointment, attendee);
	message = _templateModifier.Modify(message, context);
	speech.AddAndStartText(message);

More information