Subscribing to events
Events are sent from the CTI server to indicate a change in the status either of the extension or of the agent.
Implement the following activities in the OpenCTI implementation class to determine the action you want to perform on the event:
- SubscribeForEvents activity
- The SubscribeForEvents activity is called to send a request to start an event subscription for a device when a user tries to monitor an extension.
- UnSubscribeForEvents activity
- This activity is called to send the request to stop the event subscription for a device.
- In Dev Studio, search for the SubscribeForEvents activity in the OpenCTI adapter class.
- Copy the activity into the implementation class add the Pega Platform 8.6 integration connector to subscribe for the event for a device.
- In the activity page, add any steps that are required for the adapter to
subscribe for events for the user identified. For more information on the
properties, see the property table.
Property Name Description DN The device number on which the event is subscribed AgentID The agent ID logged in to the extension AgentPassword The password configured for that agent IDSome CTI servers do not need AgentID and AgentPassword for monitoring. In this case, the OpenCTI developer can ignore these properties when subscribing for events.
- If the subscription of the device fails, then an error should be returned. For more information, see Handling Errors.
- In Dev Studio, search for the UnSubscribeForEvents activity in the OpenCTI adapter class.
- Copy this activity to the implementation class and add the Pega 7 Platform
integration connector to unsubscribe for the event for a device.The following are the properties included in the UnSubscribeForEvents activity. You can see these properties on the adapter step page of the clipboard.
Property Name Description DN The device number on which the event is subscribed AgentID The agent ID logged in to the extension
- If the unsubscribe event of the device fails, then an error should be returned. For more information, seeHandling Errors.
Previous topic Sending Requests to the CTI server Next topic Handling events from the CTI server