Allow user-defined key processing during playing of messages


Question


How can you assign multiple keys to invoke an action?

Answer


The IMC_PLAY_MSG state table is a locked state table that controls the interpretation of DTMF keys during the playback of messages to the subscriber. The operation of the keys is defined with the following default settings in the global defaults file:
ForwardKey = 9
BackKey = 7
PauseKey = 8
FastKey = 6
SlowKey = 4
LoudKey = 2
QuietKey = 5
FwdTime = 4000
BackTime = 4000

The operation of the other keys not covered above is defined in the relevant subscriber menu state table, IMC_SB_MENU_* at the EvalGetKey label. These are unlocked state tables. The overall default behaviour is defined in the relevant subscriber guide in the "Receiving messages" section.

Although it is currently possible to change the key assignment for a particular action, it is not possible to, for instance, assign multiple keys to invoke an action. This update to Unified Messaging provides the capability to invoke the available actions using any key sequence the customer wishes, within current state table capabilities.

The IMC_PLAY_MSG locked state table has been changed to invoke the new unlocked IMC_PROCESS_KEY state table prior to performing its normal getkey state table action, passing the IMC_PROCESS_KEY state table the variable into which the dtmf key received would have been saved as an input parameter. If, as in the shipped version of IMC_PROCESS_KEY state table, the state table returns with an edge of 1, the getkey processing as defined today continues.

However if the IMC_PROCESS_KEY state table returns with an edge of 0, it is assumed by the IMC_PLAY_MSG state table that getkey processing has been performed, and the variable passed as input parameter has been set to a dtmf key value (which is subsequently used by IMC_PLAY_MSG state table, bypassing its current getkey action). The shipped IMC_PROCESS_KEY contains an example of the minimum action it must perform to return with an edge of 0. This is currently disabled by an immediate exit with edge of 1.

The following sample state table code shows how IMC_PROCESS_KEY can be modified to detect the input of 6, 6 and use it to rewind to the start of the message.

INPUT STRING GetKeyBuffer;

LOCAL STRING Buffer;

Start:
DoNothing(0)
;


Getthekey:
GetKey(GetKeyBuffer, 0, 1); # Get the value of the DTMF key that interrupted.
if (GetKeyBuffer = 6) then
GetKey(Buffer, 1, 1)
edge EDGE_TIMEOUT: Exit0
edge EDGE_LAST_TIMEOUT: Exit0
edge EDGE_HUP: Exit0;
else
goto Exit0;
endif
if (Buffer = 6) then
AssignData(GetKeyBuffer, ASSIGN, "1");
endif


Exit0:
ExitStateTable(0)
    ;