There is an example in documentation for OutboundService:
[font=courier]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.getChain(ixn);
OutboundRecord recordToProcess = ixnChain.getActiveRecord();
//...
}
}
}[/font]
But when I run my application I face two strange things:
1. Interaction Event Handler does not recieve NEW event, it recieves only RINGING, TALK and IDLE events
2. outbondService.getChain(event.getInteraction()) alwais returns NULL.
I only can obtain record using deprecated way (I don't know how to get Chain using deprecated way):
[font=courier]InteractionVoiceOutbound ivo = (InteractionVoiceOutbound)event.getInteraction();
if(ivo.getActiveRecord() != null){
outboundRecord = ivo.getActiveRecord();
setEnabledWidgets(false);
}
[/font]
I want to obtain Chain and Record using recomended way.