Custom Actions
The Platform is a static call flow. Each caller will move through the same call flow as defined in
a project. However, the system becomes incredibly powerful when the developer utilizes the Custom
Action Programming Interface (CAPI). The CAPI allows a C++ programmer to enhance the Platform by
accessing functions in a user created Custom Action Dynamic Link Library. With a Custom Action DLL,
the developer can add audio, make additions to the grammar, evaluate previous recognitions, direct
the caller to a new module, transfer the caller, or attach to a database.
Some practical implementations of CAPI are:
- Account and pin lookup.
- Collecting demographic information.
- Presenting account information.
- Automated billing.
- Changing account information.
However, the Designer should be used to design the majority of the call flow. The Custom Action Programming
Interface should only be used to handle situations that the Platform Designer can not. Following this rule
will make troubleshooting the Call Flow easier. If every module has a Custom Action defined, locating a
specific problem may require the evaluation of two areas instead of just one.
Interface Overview
The user created Custom Action DLL can call the following functions to retrieve call information or modify the Platform behavior.
These functions allow the user defined DLL to store and retrieve user data on a per call basis.
- BOOL LVCA_SetUserData (HANDLE hCA, LPVOID Param);
- BOOL LVCA_GetUserData(HANDLE hCA, LPVOID* Param);
This function will give the current module's name.
- BOOL LVCA_GetCurrentModuleA(HANDLE hCA, LPSTR Module, LONG * Size);
- BOOL LVCA_GetCurrentModuleW(HANDLE hCA, LPWSTR Module, LONG * Size);
This function will display a message to the Call Handler system messages box.
- BOOL LVCA_DisplayMessageA(HANDLE hCA, LPCSTR Message);
- BOOL LVCA_DisplayMessageW(HANDLE hCA, LPCWSTRMessage);
Call these functions to get the error message and code, if a CA function fails.
- LONG LVCA_GetLastCallErrorA(HANDLE hCA, LPSTR Message, LONG * Size);
- LONG LVCA_GetLastCallErrorW(HANDLE hCA, LPWSTR Message, LONG * Size);
- LONG LVCA_GetLastSystemErrorA(HANDLE hCA, LPSTR Message, LONG * Size);
- LONG LVCA_GetLastSystemErrorW(HANDLE hCA, LPWSTR Message, LONG * Size);
These functions will insert audio into the call flow.
- BOOL LVCA_AddMainAudio(HANDLE hCA, LPVOID Data, LONG Size);
- BOOL LVCA_AddOneTimeAudio(HANDLE hCA, LPVOID Data, LONG Size);
- BOOL LVCA_AddMainLibraryAudioA(HANDLEhCA, LPCSTR Description);
- BOOL LVCA_AddMainLibraryAudioW(HANDLE hCA, LPCWSTR Description);
- BOOL LVCA_AddOneTimeLibraryAudioA(HANDLE hCA, LPCSTR Description);
- BOOL LVCA_AddOneTimeLibraryAudioW(HANDLE hCA, LPCWSTR Description);
This function removes all added audio and any audio currently in the queue from the call flow.
- BOOL LVCA_ClearAudioQueue(HANDLE hCA);
These functions add additional concepts for the recognizer to match on.
- BOOL LVCA_AddConceptA(HANDLE hCA, LPCSTR Concept, LPCSTR Phrase);
- BOOL LVCA_AddConceptW(HANDLE hCA, LPCSTR Concept, LPCSTR Phrase);
- BOOL LVCA_AddStandardGrammar(HANDLE hCA, LONG Grammar);
This convenience function check if this is an API or standard grammar added concept.
- BOOL LVCA_IsCustomConceptA(HANDLE hCA, BOOL * IsCustom, LPCSTR Concept);
The last concept accepted by a module is stored for each call. These functions will retrieve those concepts.
- BOOL LVCA_GetConceptA(HANDLE hCA, LPCSTR Module, LPSTR Concept, LONG * Size, LONG * Confidence);
- BOOL LVCA_GetConceptW(HANDLE hCA, LPCWSTR Module,LPWSTR Concept, LONG * Size, LONG * Confidence);
- BOOL LVCA_GetNatLangConceptA(HANDLE hCA, LPCSTR Module, LPSTR PriConcept, LONG * PriSize, LPSTR SecConcept, LONG * SecSize, LONG * Confidence);
- BOOL LVCA_GetNatLangConceptW(HANDLE hCA, LPCWSTR Module, LPWSTR PriConcept, LONG * PriSize, LPWSTR SecConcept, LONG * SecSize, LONG * Confidence);
- BOOL LVCA_GetMultiLevelCountA(HANDLE hCA, LPCSTR Module, LONG * Count );
- BOOL LVCA_GetMultiLevelCountW(HANDLE hCA, LPCWSTR Module, LONG* Count);
- BOOL LVCA_GetMultiLevelConceptA(HANDLE hCA, LPCSTR Module,LONG Level, LPSTR Concept, LONG * Size, LONG * Confidence);
- BOOL LVCA_GetMultiLevelConceptW(HANDLE hCA, LPCWSTR Module, LONG Level, LPSTR Concept, LONG * Size, LONG * Confidence);
Right after the recognition occurs the raw recognition results are available for the current module.
- BOOL LVCA_GetRawConceptCount(HANDLE , LONG * Count);
- BOOL LVCA_GetRawConceptA(HANDLE hCA, LONG Index, LPSTR Concept,LONG *Size, LONG Confidence);
- BOOL LVCA_GetRawConceptW(HANDLE hCA, LONG Index, LPWSTR Concept,LONG * Size, LONG Confidence);
This allows the Custom Actions DLL to change the immediate direction of the call flow.
- BOOL LVCA_SetTransferA(HANDLE hCA, LPCSTR Transfer);
- BOOL LVCA_SetTransferW(HANDLE hCA, LPCWSTR Transfer);
- BOOL LVCA_SetGotoA(HANDLE hCA, LPCSTR Goto );
- BOOL LVCA SetGotoW(HANDLE hCA, LPCSTR Goto);