PhoneContext
Encapsulates the UEF provided telephonic events and actions. It can be derived from MultiChannelAdaptorContext object by calling the getCommunicationChannelContext API by passing channelType as PHONE.
Syntax
Here's the syntax:
getCommunicationChannelContext(channelType: McaChannels): Promise<ICommunicationChannelContext>;
Here's a Typescript example of how you can access PhoneContext by calling the getCommunicationChannelContext:
const uiEventsFrameworkInstance: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext: IMultiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext: IPhoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE') as IPhoneContext;
Here's a Javascript example of how you can access PhoneContext by calling the getCommunicationChannelContext:
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE');
Here's a diagram that shows the events and actions supported by PhoneContext.
Supported Events
Event Name | Description | Example |
---|---|---|
OnToolbarAgentCommand | This is a controllable event. This means, to control this event by either resolving or rejecting it, you must pass a promise as the return of this event callback function. When notified of this event subscription, you can check the command, getActiveInteractionCommands, in the event response and pass outData for that command by resolving the promise with that outData. The event subscription can be added only once during initialization of the MCA code. You'll get this event notification only once per session. | onToolbarAgentCommand |
OnToolbarInteractionCommand | This is a controllable event. To control this event by either resolving or rejecting it, you must pass a promise as the return of this event callback function.When notified of this event subscription, you can check the command in the event response. Commands supported are, accept, disconnect, reject, setActive. These commands correspond to accept, disconnect, and reject operations an agent might make in the Fusion application. You can wire up their logic for each of these commands, on the callback of this event response. | onToolbarInteractionCommand |
onDataUpdated | Used to listen to a DataUpdate event that happens in the Fusion application. It's a non controllable event | onDataUpdated |
onOutgoingEvent | Used to listen to an outBound call event that happens in the Fusion application. It's a non controllable event. You can wire the logic for the outbound call connection on notification of this event. | onOutgoingEvent |
Supported Operations
Operation Name | Description | Example |
---|---|---|
newCommEvent | This is the action user needs to publish when there's a ring received scenario. For example, when a user is trying to call an agent, Fusion application should show a notification with Accept or Decline button. To enable this the MCA integrated CTI should publish a newCommEvent request. | newCommEvent |
startCommEvent | This is the action user needs to publish when there's a call start scenario if the newCommEvent. For example, for an Inbound call scenario, user should listen to onToolbarInteractionCommand and when the user gets a notification of it with the command as Accept, they'd then need to publish this action to establish that call connection. | startCommEvent |
closeCommEvent | This is the action user needs to publish when there's a call decline scenario. For example, when an agent clicks Decline on a call notification, the CTI integration code base gets a notification for onAgentInteractionCommand event with the command as Decline, if it has a subscription added for the same. | closeCommEvent |
outboundCommError | The toolbar can publish this API to notify the Fusion application that an error occurred during initiation of the outbound event. The error occurs if the identifier of the event, such as phone number, or email can't be used to establish a connection. | outboundCommError |
getConfiguration | To get configuration information that enables the toolbar to evaluate the features supported by the Fusion application | getConfiguration |
disableFeature | Informs the Fusion application that a subset of available functionality must be disabled because the toolbar hasn't implemented it. | disableFeature |
readyForOperation | Notifies the Fusion application that the toolbar is ready for operation | readyForOperation |
agentStateEvent | Notifies the Fusion application of a change in the user's signed in or availability status for the specified channel | agentStateEvent |
Supported Methods
Method Name | Description | Reference |
---|---|---|
subscribe | Function to listen to a PhoneContext supported Event. For example, onToolbarInteractionCommand, onDataUpdated, onOutgoingEvent. | Subscribe API |
subscribeOnce | Function to listen only once a PhoneContext supported Event. For example, onToolbarInteractionCommand, onDataUpdated, onOutgoingEvent. | SubscribeOnce API |
publish | Function to publish a PhoneContext supported operation on SidePaneContext object. For example, getConfiguration, agentStateEvent, readyForOperation, disableFeature, newCommEvent, startCommEvent, closeCommEvent, outboundCommError. | Publish API |
dispose | Function to dispose or remove all events subscribed on PhoneContext object. | Dispose API |
getSupportedEvents | Function to get all the supported events on PhoneContext object. | See getSupportedEvents entry in IPhoneContext.. |
getSupportedActions | Function to get all the supported actions on PhoneContext object. | See getSupportedActions entry in IPhoneContext.. |
getChannelType |
Function to get the channel type in PhoneContext API requests, such as, ORA_SVC_PHONE. | See getChannelType entry in IPhoneContext.. |
getChannel |
Function to get the type in context object. The value is PHONE. | See getChannel entry in IPhoneContext.. |
getFrameOrigin |
Function to get the frame origin in PhoneContext object requests. | See getFrameOrigin entry in IPhoneContext.. |
getToolbarName |
Function to get the toolbar name in PhoneContext object requests. | See getToolbarName entry in IPhoneContext.. |
getVersion |
Function to get the toolbar name in PhoneContext object requests. | See getVersion entry in IPhoneContext.. |
getEventSource |
Function to get the event source in PhoneContext object requests. | See getEventSource entry in IPhoneContext.. |