You are here:

ActiveXperts.com > SMS Messaging Server > Case Studies > St. Joseph College

ActiveXperts SMS Messaging Server Send, receive and automate SMS messages

Quicklinks


SMS Notification System (St. Joseph)

This case study is included in the evaluation version of the SMS Messaging Server

1. Background

The St. Joseph College is a secondary school for students ranging in age from 12 to 19 years old. The college has 1500 students in 3 different locations.

All of the students as well as all of the teachers and their workstations are kept in a single Active Directory domain: 'STJOSEPH.DOM'. This Active Directory is not accessible through the internet. All of the students and teachers also have their e-mail addresses and mobile numbers defined in the Active Directory.

The Active Directory is used to find out which of the students or teachers need to be reached in the following cases:

  • When lessons are cancelled.
  • When lessons are rescheduled.
  • When lessons are relocated.
  • When there are any other special events.

2. Problem Statement

Currently the St. Joseph College notifies the students and by manually sending each student and / or teachers an e-mail. They have an MS Excel sheet which contains a lot of the same student information that is kept in their Active Directory. As long as they keep their Excel sheet synchronized with their Active Directory information it is possible to, through an Excel macro, generate a list of e-mail addresses to send the notification to.

This manual system has some drawbacks:

  • Since they can only use E-mail students are not instantly notified.
  • They cannot schedule event in the future for automatic processing.
  • There is no way of knowing if a student actually received the notification.
  • Manually keeping the Excel sheet synchronized with the Active Directory is very sensitive to duplicates, omissions or typo's.

3. Goals of the new System

The new system should alleviate all the drawbacks of the old system and improve on it in the following ways:

  • Students must be reached through an SMS message as well as e-mail.
  • Their mobile numbers as well as e-mail addresses should be retrieved from the Active Directory.
  • The Excel sheet should be removed from the process entirely.
  • It must be possible to schedule events hours or days in advance.
  • It must be possible to determine whether a notification was received.

4. ActiveXperts SMS Messaging Server Solution

For their new system the IT department of the St. Joseph College decided to use the ActiveXperts SMS Messaging Server. They wrote their glue code to interface the SMS Messaging Server with their Active Directory database using Visual Basic 6. The application reads the Active Directory database and creates outgoing messages for the SMS Messaging Server. The SMS Messaging server sends out the SMS and E-mail messages.

Their VB6 based application uses the following components and techniques:

  • Organizational Units are selected through LDAP, and students are fetched one by one from the Organizational Unit object.
  • The Active Directory User properties Mobile and Mail are used to determine the students SMS and e-mail information.
  • New outgoing SMS and e-mail messages are stored in the Message Database of ActiveXperts SMS Messaging Server.
  • The SMS Messaging server picks up the messages from its database and automatically schedules them or send them out immediately.

Figure 1. shows a screenshot of the application.

St.Joseph
Figure 1: St. Joseph College Student Notification application

ActiveXperts SMS Messaging Server

The St. Joseph College runs ActiveXperts SMS Messaging Server on a Windows 2003 Server. This server is member of the STJOSEPH.DOM domain.

One of the requirements is throughput, it may not take more than 5 minutes to send out an SMS message to hundred students. This throughput cannot be achieved with a GSM Modem (a GSM can send out only 1 message per 5 seconds maximum). Therefore, St. Joseph College subscribed with an SMPP provider (Clickatell). It's throughput is around 10 messages/second.

ActiveXperts SMS Messaging Server is configured to use SMPP service of Clickatell. This was done in the following way:

  • In the 'Configuration', all channels were disabled;
  • A new SMPP channel was created, and the appropriate Clickatell account information was entered.

VB6 source code

The software department of the College wrote the application in Visual Basic 6. The application consists of one modal dialog with the following fields:

  • LDAP String This indicates the LDAP path to the OU where the students or class are organized in Active Directory.
  • Count Students and Show Students Use these buttons to test the LDAP String.
  • Message Subject The subject for the e-mail messages.
  • Message Body Actual body and of the SMS- or e-mail message.
  • SMS and E-mail check boxes Indicate what type of notification to send: SMS, e-mail or both.
  • Schedule Time Indicates when the ActiveXperts SMS Messaging Server should deliver the messages.
  • Submit Send out the SMS/e-mail message(s).

Complete source code of the St. Joseph College Student Notification program

Option Explicit

Dim g_Constants, g_MessageDB

Private Sub BTN_COUNTSTUDENTS_Click()
On Error Resume Next
    Dim objOU, numCount, objStudent
    MousePointer = vbHourglass
    Set objOU = GetObject(TXT_LDAPSTRING)
    If (objOU Is Nothing) Then
        MsgBox "Unable to access the OU on the specified Domain Controller.", vbCritical, _
        "St. Joseph"
    Else
        numCount = 0
        For Each objStudent In objOU
            numCount = numCount + 1
        Next
        MsgBox "Number of students in selected OU: " & numCount, vbOKOnly, "St. Joseph"
        Set objOU = Nothing
    End If
    MousePointer = vbDefault
End Sub


Private Sub BTN_SHOWSTUDENTS_Click()
On Error Resume Next
    Dim objOU, strStudents, objStudent
    MousePointer = vbHourglass
    Set objOU = GetObject(TXT_LDAPSTRING)
    If (objOU Is Nothing) Then
        MsgBox "Unable to access the OU on the specified Domain Controller.", vbCritical, _
        "St. Joseph"
    Else
        strStudents = ""
        For Each objStudent In objOU
            strStudents = strStudents & objStudent.Name & " (" & _
            "Mobile:" & objStudent.Mobile & "; " & _
            "E-mail:" & objStudent.Mail & ")" & vbCrLf
        Next
        MsgBox "Students in selected OU: " & vbCrLf & _
		       "============================" & vbCrLf & vbCrLf & _
		       strStudents, vbOKOnly, "St. Joseph"
        Set objOU = Nothing
    End If
    MousePointer = vbDefault
End Sub


Private Sub BTN_SUBMIT_Click()
On Error Resume Next
    Dim objOU, objStudent, objMessageOut, numSmsMessages, numEmailMessages
    
    numSmsMessages = 0
    numEmailMessages = 0
    
    MousePointer = vbHourglass
    
    Set objOU = GetObject(TXT_LDAPSTRING)
    MousePointer = vbDefault
    If (objOU Is Nothing) Then
        MsgBox "Unable to access the OU on the specified Domain Controller.", vbCritical, _
        "St. Joseph"
    Else
        For Each objStudent In objOU
            If (RB_SENDSMS.Value <> 0 And objStudent.Mobile <> "") Then
                Set objMessageOut = g_MessageDB.Create
                If (g_MessageDB.LastError = 0) Then
                  objMessageOut.Direction = g_Constants.MESSAGEDIRECTION_OUT
                  objMessageOut.Type = g_Constants.MESSAGETYPE_SMS
                  objMessageOut.Status = g_Constants.MESSAGESTATUS_OUT_SCHEDULED
                  objMessageOut.To = objStudent.Mobile
                  objMessageOut.ChannelID = 0 ' First available SMS channel
                  objMessageOut.Body = TXT_MESSAGEBODY
                  objMessageOut.ScheduleTime = TXT_SCHEDULE
                  objMessageOut.Save
                End If
                numSmsMessages = numSmsMessages + 1
            End If
            
            If (RB_SENDEMAIL.Value <> 0 And objStudent.Mail <> "") Then
                Set objMessageOut = g_MessageDB.Create
                If (g_MessageDB.LastError = 0) Then
                  objMessageOut.Direction = g_Constants.MESSAGEDIRECTION_OUT
                  objMessageOut.Type = g_Constants.MESSAGETYPE_EMAIL
                  objMessageOut.Status = g_Constants.MESSAGESTATUS_OUT_SCHEDULED
                  objMessageOut.To = objStudent.Mail
                  objMessageOut.ChannelID = 0 ' First available SMS channel
                  objMessageOut.Body = TXT_MESSAGEBODY
                  objMessageOut.ScheduleTime = TXT_SCHEDULE
                  objMessageOut.Save
                End If
                numEmailMessages = numEmailMessages + 1
            End If
        Next
        Set objOU = Nothing
    End If
    MousePointer = vbDefault
    MsgBox "#SMS Messages created: " & numSmsMessages & vbCrLf & _
    "#E-mail messages created: " & numEmailMessages, vbInformation, "St. Joseph"
End Sub


Private Sub Form_Load()
    TXT_LDAPSTRING = "LDAP://dell04/ou=students,dc=activexperts,dc=dom"
    
    Set g_Constants = CreateObject("Axsms-messaging-server.Constants")
    Set g_MessageDB = CreateObject("Axsms-messaging-server.Messages")
    
    RB_SENDSMS.Value = 1
    RB_SENDEMAIL.Value = 0
    
    TXT_MESSAGEBODY = "All lessons from teacher Mr. Jones are cancelled on " & Date
    TXT_MESSAGESUBJECT = "Notification from St. Joseph College"
    TXT_MESSAGESUBJECT.Enabled = False
    TXT_SCHEDULE = "+0d0h5m"  
End Sub


Private Sub RB_SENDEMAIL_Click()
    If (RB_SENDEMAIL.Value <> 0) Then
        TXT_MESSAGESUBJECT.Enabled = True
    Else
        TXT_MESSAGESUBJECT.Enabled = False
    End If
End Sub