com.genesyslab.ail
Interface OutboundService

All Superinterfaces:
IdObject, Possible

public interface OutboundService
extends Possible

The OutboundService interface represents the extra features for handling outbound requests of a particular agent or place. To get an instance of the OutboundService interface, call the Agent.getOutboundService() or Place.getOutboundService() method, as shown in the following code snippet.


Agent agentExample = (Agent) myAilFactory.getPerson("Agent_ID");
OutboundService myOutboundService = agentExample.getOutboundService();

Use the OutboundService interface to:

To participate in an outbound campaign, your application registers a listener implementing a CampaignListener interface on the OutboundService. Then, when participating in an outbound campaign, the listener gets a notification of Campaign participation with a CampaignEvent event of type CAMPAIGN_ADDED.
On InteractionEvent events, you can retrieve the Outboundchain associated with an interaction (if any) to access outbound information. If the OutboundChain information change, you will get a PlaceEventOutboundChainInfo event on your place, as shown in the following code snippet:


public void SimpleOutboundExample implements PlaceListener, CampaignListener {
    OutboundService outboundService ;
    public void SimplePreviewExample(Place samplePlace)
    {
        outboundService = samplePlace.getOutboundService();
        //register to listen for place events, including PlaceEventOutboundChain
        samplePlace.addPlaceListener(this);
        //register your campaign listener
        outboundService.addListener(this) ;
    }
    //method to implement for CampaignListener
    public void handleCampaignEvent(CampaignEvent event)
    {
        // Testing whether it is an event dealing with a new campaign
        if(event.getEventType()==CampaignEvent.Type.CAMPAIGN_ADDED)
        {
            //The agent takes part in a new outbound campaign
            //...
        }
    }
    //PlaceListener methods...
    public void handlePlaceEvent(PlaceEvent event)
    {
        if(event instanceof PlaceEventOutboundChainInfo)
        {
            PlaceEventOutboundChainInfo eventInfo = (PlaceEventOutboundChainInfo) event ;
            System.out.println("Outbound chain event, reason "+
            eventInfo.getReason().toString());
        }
    }
    public void handleInteractionEvent(InteractionEvent event)
    {
        if(event.getStatus() == Interaction.Status.NEW)
        {
            Interaction ixn = event.getInteraction();
            OutboundChain ixnChain = outboundService.getOutboundChain(ixn);
            OutboundRecord recordToProcess = ixnChain.getActiveRecord();
            //...
        }
    }
}

See Also:
CampaignListener, CampaignEvent, CampaignEvent.Type, OutboundChain, PlaceEventOutboundChainInfo

Nested Class Summary
static class OutboundService.Action
          Actions that are possible on the outbound service.
 
Nested classes/interfaces inherited from interface com.genesyslab.ail.IdObject
IdObject.ObjectType
 
Method Summary
 void addListener(CampaignListener listener)
          Adds a listener that will be notified of campaign-related events.
 void cancelRecord(java.lang.String phone_number, boolean all_chain)
          Cancels an outbound record.
 void cancelRecord(java.lang.String phone_number, boolean all_chain, int applicationId)
          Deprecated. since 7.0. Please use cancelRecord(String, boolean).
 void doNotCallCustomer(java.lang.String customer_id, java.lang.String reason, boolean all_chain)
          Marks the customer as Do Not Call.
 void doNotCallRecord(java.lang.String phone_number, java.lang.String reason, boolean all_chain)
          Marks the record (and chained records if all_chain is true) as Do Not Call.
 void doNotCallRecord(java.lang.String phone_number, java.lang.String reason, boolean all_chain, int applicationId)
          Deprecated. since 7.0. Please use doNotCallRecord(String, String, boolean).
 OutboundCampaignInfo getCampaignInfo(java.lang.String campaign_id)
          Gets an OutboundCampaignInfo with this ID among those currently handled by this OutboundService.
 java.util.Collection getCampaignInfos()
          Returns the active campaigns.
 OutboundChain getChain(Interaction ixn)
          Returns the outbound chain associated with the given interaction, or null, if this interaction has no outbound information.
 java.util.Collection getChains()
          Returns all the active chains associated with the place of this service.
 boolean isASMCall(Interaction ixn)
          Returns true if an interaction is in ASM call mode.
 void removeListener(CampaignListener listener)
          Removes a previously added listener.
 
Methods inherited from interface com.genesyslab.ail.Possible
arePossible, isPossible
 
Methods inherited from interface com.genesyslab.ail.IdObject
getId, getObjectType
 

Method Detail

addListener

void addListener(CampaignListener listener)
Adds a listener that will be notified of campaign-related events.

Parameters:
listener - the CampaignListener to register.

removeListener

void removeListener(CampaignListener listener)
Removes a previously added listener.

Parameters:
listener - the CampaignListener to unregister.

getCampaignInfos

java.util.Collection getCampaignInfos()
Returns the active campaigns.

Returns:
a Collection of OutboundCampaignInfo.

getCampaignInfo

OutboundCampaignInfo getCampaignInfo(java.lang.String campaign_id)
Gets an OutboundCampaignInfo with this ID among those currently handled by this OutboundService.

Parameters:
campaign_id - the ID of the campaign info.

cancelRecord

void cancelRecord(java.lang.String phone_number,
                  boolean all_chain,
                  int applicationId)
                  throws RequestFailedException
Deprecated. since 7.0. Please use cancelRecord(String, boolean).

Throws:
RequestFailedException

doNotCallRecord

void doNotCallRecord(java.lang.String phone_number,
                     java.lang.String reason,
                     boolean all_chain,
                     int applicationId)
                     throws RequestFailedException
Deprecated. since 7.0. Please use doNotCallRecord(String, String, boolean).

Throws:
RequestFailedException

cancelRecord

void cancelRecord(java.lang.String phone_number,
                  boolean all_chain)
                  throws RequestFailedException
Cancels an outbound record. Used when an agent updates data of a contact outside of the processing of a campaign (during an inbound call, for example) and decides that there is no need to call this customer again.

Parameters:
phone_number - the phone number of the contact whose records must be cancelled.
all_chain - true if all the chained records concerning the contact associated with this number should be cancelled, false otherwise.
Throws:
OutboundServiceException - if an error is reported by the Outbound Server.
OutboundServiceException - of type RECORD_ON_DESKTOP if one or more records could not be canceled becaure they are being processed by an agent.
RequestFailedException

doNotCallRecord

void doNotCallRecord(java.lang.String phone_number,
                     java.lang.String reason,
                     boolean all_chain)
                     throws RequestFailedException
Marks the record (and chained records if all_chain is true) as Do Not Call. This method should be used when an agent updates data of a contact outside of the processing of a campaign (during an inbound call, for example) and is asked by this customer not to be called again.

Parameters:
phone_number - the phone number of the contact who requests not to be called again.
reason - the message to be written in the "Do Not Call" dedicated log.
all_chain - true if all the chained records concerning the contact associated with this number should be cancelled, false otherwise.
Throws:
OutboundServiceException - if an error is reported by the Outbound Server.
RequestFailedException
See Also:
doNotCallCustomer(java.lang.String, java.lang.String, boolean)

doNotCallCustomer

void doNotCallCustomer(java.lang.String customer_id,
                       java.lang.String reason,
                       boolean all_chain)
                       throws RequestFailedException
Marks the customer as Do Not Call. This method should be used when an agent updates data of a contact outside of the processing of a campaign (during an inbound call, for example) and is asked by this customer not to be called again.

Parameters:
customer_id - the customer ID of the contact who requests not to be called again.
reason - the message to be written in the "Do Not Call" dedicated log.
all_chain - true if all the chained records concerning the contact associated with this number should be cancelled, false otherwise.
Throws:
OutboundServiceException - if an error is reported by the Outbound Server.
RequestFailedException
See Also:
doNotCallRecord(java.lang.String, java.lang.String, boolean, int)

getChain

OutboundChain getChain(Interaction ixn)
Returns the outbound chain associated with the given interaction, or null, if this interaction has no outbound information.


getChains

java.util.Collection getChains()
Returns all the active chains associated with the place of this service.

Returns:
a Collection of OutboundChain.

isASMCall

boolean isASMCall(Interaction ixn)
Returns true if an interaction is in ASM call mode.