Skip to content

Unified Messaging Solutions

Chapter 10-5
Unified Messaging Solutions

Introduction

Unified Messaging (UM) is the ability to combine voice, mail, fax, paging, etc. into one central place allowing all types of messages to become accessible from one source. In the Domino and Notes environment this source could be an "inbox" folder in a mail database where incoming messages of the above types are sent.

You can implement Unified Messaging functionality within an Extension Manager application. The Extension Manager notifications, EM_NSFADDTOFOLDER and EM_NSFMARKREAD, and the C API function, NSFFolderGetIDTable, are useful for Unified Messaging solutions.

Extension Manager Notification EM_NSFADDTOFOLDER

An Extension Manager application can be notified every time a note is added or removed from a folder by trapping the EM_NSFADDTOFOLDER notification. In a Unified Messaging scenario, the incoming note can be a Fax (or any other type of message) to an inbox folder in a mail database. The Extension Manager code for this notification could check the incoming note for any Fax property, identify the note as a Fax, and then perhaps send a user notification that a Fax has been received. This type of processing can be extended to many other types of messages.

Extension Manager Notification EM_NSFMARKREAD

The Extension Manager notification, EM_NSFMARKREAD is called when a note is opened by the Notes client and marked READ. This notification can be used in a Unified Messaging scenario that implements a "Message Wait Indicator" (MWI). A "Message Wait Indicator" can be a notification to a user that " a message is waiting" for them, and then be removed when the message has been read.


Extension Manager Sample Code

The following Extension Manager code illustrates how to trap the EM_NSFADDTOFOLDER notification and detect if a FAX has been received in the "inbox" of a mail database.

STATUS LNPUBLIC EMHandlerProc( EMRECORD FAR * theData )
{
VARARG_PTR  argPtr;
STATUS      error;

argPtr = theData->Ap;

/ do nothing if there is an error. /
if ( theData->Status )
{
goto Exit0;
}


switch (theData->EId)
{

case EM_NSFADDTOFOLDER:

            / declare the arguments /

            DBHANDLE hViewDB = NULLHANDLE;
            DBHANDLE hDataDB = NULLHANDLE;
            NOTEID FolderNoteID, InboxNoteID;
            NOTEID NoteID;
            UNID   NoteUNID
            BOOL   IsAddOperation;
            TIMEDATE
RevisionTime;
         
            HANDLE hNote = NULLHANDLE;
            char   DesignName[512];
            char   Dbinfo[NSF_INFO_SIZE];
            char   MailDatabase60[]="StdR6Mail";
            char   MailDatabase50[]="StdR50Mail";
            char   MailDatabase45[]="StdR45Mail";
            BOOL   IsMailDB = FALSE;
 
            / get the arguments /

hViewDB = VARARG_GET( argPtr, DBHANDLE );
hDataDB = VARARG_GET( argPtr, DBHANDLE );
FolderNoteID = VARARG_GET( argPtr, NOTEID );

            NoteID = VARARG_GET( argPtr, NOTEID );
            NoteUNID = VARARG_GET( argPtr, UNID * );
            IsAddOperation = VARARG_GET( argPtr, BOOL );  
            RevisionTime = VARARG_GET( argPtr, TIMEDATE * );
           
            / process post Notes Notification /
            if (theData->NotificationType == EM_AFTER)
            {
             
               if (error = NSFDbInfoGet (hViewDB, Dbinfo))
                 goto Exit0;
               
               / check to see if this is a 4.5 or later mail database /
               NSFDbInfoParse(Dbinfo, INFOPARSE_DESIGN_CLASS, DesignName,
                              sizeof(DesignName));

               if (strcmp(DesignName, MailDatabase45) == 0)
                 IsMailDB = TRUE;
               else if (strcmp(DesignName, MailDatabase50) == 0)
                 IsMailDB = TRUE;
               else if (strcmp(DesignName, MailDatabase60) == 0)
                 IsMailDB = TRUE;  
               else
                 goto Exit0;
               
               / check to see if this is the "Inbox" Folder /
               if (error = NIFFindView (hViewDB, "Inbox", &InboxNoteID))
                 goto Exit0;
               if (InboxNoteID != FolderNoteID)
                 goto Exit0;

               / open the note /
               if (error = NSFNoteOpenExt (hViewDB, NoteID, OPEN_RAW_MIME, &hNote))
                 goto Exit0;

               / check to see if this note is a FAX /
               if (NSFItemIsPresent (hNote, "Fax_Status", (WORD)strlen("Fax_Status")))
               {  
                 / send notification that a FAX has been received.../

               }
               
               NSFNoteClose(hNote);

               error = ERR_EM_CONTINUE;
            }
   
            break;


   } / END SWITCH /


Exit0:

return( ERR_EM_CONTINUE );

}