IPhoneContext
PhoneContext is the object that encapsulates the UIEF-provided telephonic events and act icons. This object can be derived from MultiChann elAdaptorContext object by calling getCommunicationChannelContext API by passing channelType as PHONE.
getCommunicationChannelContext(channelType: McaChannels): Promise<ICommunicationChannelContext>;
/// <reference path="uiEventsFramework.d.ts"/>
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;
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE');
Functions
subscribe
Use this function toto listen to a PhoneContext supported Event. For example, onToolbarInteractionCommand, onDataUpdated, onOutgoingEvent.
subscribe: (requestObject: IEventRequest, callbackFunction: (response:IEventResponse) => void) => ISubscriptionContext;
/// <reference path="uiEventsFramework.d.ts"/>
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;
const request: IMcaEventRequest = uiEventsFrameworkInstance.requestHelper.createSubscriptionRequest('onDataUpdated') as IMcaEventRequest;
request.setAppClassification('_appClassfication');
phoneContext.subscribe(request, (response: IEventResponse) => {
const dataUpdateResponse = response as IMcaOnDataUpdatedEventResponse;
const data: IMcaOnDataUpdatedData = dataUpdateResponse.getResponseData();
});
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE');
const request = uiEventsFrameworkInstance.requestHelper.createSubscriptionRequest('onDataUpdated') as IMcaEventRequest;
request.setAppClassification('_appClassfication');
phoneContext.subscribe(request, (response) => {
const data = response.getResponseData();
});
subscribeOnce
Use this function to listen only once to a PhoneContext supported Event. For example,. onToolbarInteractionCommand, onDataUpdated, onOutgoingEvent.
subscribeOnce: (requestObject: IEventRequest, callbackFunction: (response:IEventResponse) => void) => ISubscriptionContext;
/// <reference path="uiEventsFramework.d.ts"/>
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;
const request: IMcaEventRequest = uiEventsFrameworkInstance.requestHelper.createSubscriptionRequest('onDataUpdated') as IMcaEventRequest;
request.setAppClassification('_appClassfication');
phoneContext.subscribeOnce(request, (response: IEventResponse) => {
const dataUpdateResponse = response as IMcaOnDataUpdatedEventResponse;
const data: IMcaOnDataUpdatedData = dataUpdateResponse.getResponseData();
});
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE');
const request = uiEventsFrameworkInstance.requestHelper.createSubscriptionRequest('onDataUpdated') as IMcaEventRequest;
request.setAppClassification('_appClassfication');
phoneContext.subscribeOnce(request, (response) => {
const data = response.getResponseData();
});
publish
Use this function to publish a PhoneContext-supported operation on PhoneContext object..
publish: (requestObject: IOperationRequest) => Promise<IOperationResponse>;
/// <reference path="uiEventsFramework.d.ts"/>
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;
const request: IMcaNewCommEventActionRequest = uiEventsFrameworkInstance.requestHelper.createPublishRequest('newCommEvent') as IMcaNewCommEventActionRequest;
request.setAppClassification('self.appClassfication');
request.setLookupObject('lookup');
request.setInputData(_inboundData);// _inboundData of type - IMcaNewCommInData
const inData: IMcaInDataRequest = request.getInData();
inData.setCallStatus('INCOMING');
phoneContext.publish(request).then((response: IOperationResponse) => {
const newCommResponse: IMcaNewComActionResponse = response as IMcaNewComActionResponse;
}).catch(()=>{
});
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE');
const request = uiEventsFrameworkInstance.requestHelper.createPublishRequest('newCommEvent');
request.setAppClassification('self.appClassfication');
request.setLookupObject('lookup');
request.setInputData(_inboundData);// _inboundData of type - IMcaNewCommInData
const inData = request.getInData();
inData.setCallStatus('INCOMING');
phoneContext.publish(request).then((response) => {
// custom code
}).catch(()=>{
});
dispose
dispose:() => void;
/// <reference path="uiEventsFramework.d.ts"/>
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;
phoneContext.dispose();
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE');
phoneContext.dispose();
getSupportedEvents
Use this function to get all the supported events on the PhoneContext object.
getSupportedEvents(): string[];
/// <reference path="uiEventsFramework.d.ts"/>
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;
const supportedEvents:string[] = phoneContext.getSupportedEvents();
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE');
const supportedEvents = phoneContext.getSupportedEvents();
getSupportedActions
Use this function to get all the supported actions on the PhoneContext object.
getSupportedActions(): string[];
/// <reference path="uiEventsFramework.d.ts"/>
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;
const supportedActions: string[] = phoneContext.getSupportedActions();
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE');
const supportedActions = phoneContext.getSupportedActions();
getChannelType
Use this function to get the channel type in PhoneContext API requests. For example, ORA_SVC_PHONE.
getChannelType(): string;
/// <reference path="uiEventsFramework.d.ts"/>
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;
const channelType: string = phoneContext.getChannelType();
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE');
const channelType = phoneContext.getChannelType();
getChannel
Use this function to get the type in context object. The value will be PHONE.
getChannel(): string;
/// <reference path="uiEventsFramework.d.ts"/>
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;
const channel: string = phoneContext.getChannel(); // 'PHONE'
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE');
const channel = phoneContext.getChannel(); // 'PHONE'
getFrameOrigin
Use this function to get the frame origin in PhoneContext object requests.
getFrameOrigin(): string;
//// <reference path="uiEventsFramework.d.ts"/>
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;
const frameOrigin: string = phoneContext.getFrameOrigin();
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE');
const frameOrigin = phoneContext.getFrameOrigin();
getToolbarName
Use this function to get the toolbar name in PhoneContext object request
getToolbarName(): string;
/// <reference path="uiEventsFramework.d.ts"/>
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;
const toolbarName: string = phoneContext.getToolbarName();
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE');
const toolbarName = phoneContext.getToolbarName();
getVersion
Use this function to get the version in PhoneContext object reques.
getVersion(): string;
/// <reference path="uiEventsFramework.d.ts"/>
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;
const version: string = phoneContext.getVersion();
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE');
const version = phoneContext.getVersion();
getEventSource
Use this function to get the event source in PhoneContext object requests.
getEventSource(): string;
/// <reference path="uiEventsFramework.d.ts"/>
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;
const eventSource: string = phoneContext.getEventSource();
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE');
const eventSource = phoneContext.getEventSource();