From Bright Pattern Documentation
(Created new topic from branched topic Documentation:ServicePattern:simplified-desktop-net-api-specification:APIInstantiationandInitialization:5.1) |
|||
Line 2: | Line 2: | ||
First, the client should create an ''Api'' object and attach event handlers: | First, the client should create an ''Api'' object and attach event handlers: | ||
− | : m_api = new DesktopControlAPI.ApiLite(); | + | : m_api = new DesktopControlAPI.ApiLite(); |
− | + | ||
− | : m_api.eventDispatcher.evtApiUp += this.onApiUp; | + | : m_api.eventDispatcher.evtApiUp += this.onApiUp; |
− | + | ||
− | : m_api.eventDispatcher.evtApiDown += this.onApiDown; | + | : m_api.eventDispatcher.evtApiDown += this.onApiDown; |
− | + | ||
− | : m_api.eventDispatcher.evtCallOffered += this.onCallOffered; | + | : m_api.eventDispatcher.evtCallOffered += this.onCallOffered; |
− | + | ||
− | : m_api.eventDispatcher.evtCallDialing += this.onCallDialing; | + | : m_api.eventDispatcher.evtCallDialing += this.onCallDialing; |
− | + | ||
− | : m_api.eventDispatcher.evtCallDisconnected += this.onCallDisconnected; | + | : m_api.eventDispatcher.evtCallDisconnected += this.onCallDisconnected; |
Note that by default API logging is enabled: | Note that by default API logging is enabled: | ||
− | : ApiLite(bool _enableLog = true); | + | : ApiLite(bool _enableLog = true); |
To disable logging, set enableLog to false. | To disable logging, set enableLog to false. | ||
− | : m_api = new DesktopCOntrolAPI.ApiLite(false); | + | : m_api = new DesktopCOntrolAPI.ApiLite(false); |
Once API is created and event handlers are attached, the client may initialize the API instance: | Once API is created and event handlers are attached, the client may initialize the API instance: | ||
− | : m_api.InitAPI(); | + | : m_api.InitAPI(); |
Once API is connected to the softphone and the evtApiUp event is received, the client may dial calls: | Once API is connected to the softphone and the evtApiUp event is received, the client may dial calls: | ||
− | : m_api.CallDial(“4154556565”); | + | : m_api.CallDial(“4154556565”); |
When application terminates the following method should be called to ensure clean termination of the TCP connection between API and the Agent Desktop: | When application terminates the following method should be called to ensure clean termination of the TCP connection between API and the Agent Desktop: | ||
− | : m_api.ShutdownAPI(); | + | : m_api.ShutdownAPI(); |
+ | |||
− | |||
</translate> | </translate> |
Revision as of 23:55, 25 January 2019
<translate>= API Instantiation and Initialization= First, the client should create an Api object and attach event handlers:
: m_api = new DesktopControlAPI.ApiLite(); : m_api.eventDispatcher.evtApiUp += this.onApiUp; : m_api.eventDispatcher.evtApiDown += this.onApiDown; : m_api.eventDispatcher.evtCallOffered += this.onCallOffered; : m_api.eventDispatcher.evtCallDialing += this.onCallDialing; : m_api.eventDispatcher.evtCallDisconnected += this.onCallDisconnected;
Note that by default API logging is enabled:
: ApiLite(bool _enableLog = true);
To disable logging, set enableLog to false.
: m_api = new DesktopCOntrolAPI.ApiLite(false);
Once API is created and event handlers are attached, the client may initialize the API instance:
: m_api.InitAPI();
Once API is connected to the softphone and the evtApiUp event is received, the client may dial calls:
: m_api.CallDial(“4154556565”);
When application terminates the following method should be called to ensure clean termination of the TCP connection between API and the Agent Desktop:
: m_api.ShutdownAPI();
</translate>/prevnext/