The direct connect service is an excellent way to control the CallFire dialer and bypass the predictive logic. It is an excellent system, for example, when you have a list of old customers that need targeted calls backs.

WSDL

https://www.callfire.com/service/DirectConnectService?wsdl.

Methods

agentLogin

Use this function to login an agent. The agent will receive a call and their agent id would be played to them. They will use this agent id to log in to CallFire.com

Parameters

Parameter name Required Description
api_key Y This is the key that you were provided when you registered with CallFire.com, You can view your key by logging onto CallFire.com & then goto "Settings -> Account Settings
campaignId Y This is the id of the campaign for which you want your agent to login.
phonenumber Y This is the phone number of the agent. Agent will receive a call on this number.
userId Y This is the user id that would be assigned to that agent.

Example Request

<?xml version="1.0" encoding="utf-8"?>

  
    
      string
      -8113
      string
      string
    
  

Sample PHP Code

public function agentLogin($api_key,$campaignId,$phonenumber,$userId,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/DirectConnectService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$createcampaign = array(
  		'key' => $api_key,
  		'campaignId' => $campaignId,
	'phonenumber'=> $phonenumber,
	'userId' => $userId
	);
	try
	{
		$agentlogin = $campaignOutboundClient->agentLogin($createcampaign);
		if($debug)
		{
			echo "Agent Login Success";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public void agentLogin(string key,long campaignId,string phonenumber,string userid)
{
    try
    {
        this.directConnectService.agentLogin(key,campaignId,phonenumber,userid);
    }
    catch(Exception e)
    {
        string msg = "Unable to do agentLogin(string key,long campaignId,string phonenumber,string userid)";
        LOG.Error(msg);
        throw new DirectConnectServiceException(msg, e);
    }
}

agentLoginWithMusicOnHold

Use this function to login an agent. The agent will receive a call and their agent id would be played to them. They will use this agent id to log in to CallFire.com

Parameters

Parameter name Required Description
api_key Y This is the key that you were provided when you registered with CallFire.com, You can view your key by logging onto CallFire.com & then goto "Settings -> Account Settings
campaignId Y This is the id of the campaign for which you want your agent to login.
phonenumber Y This is the phone number of the agent. Agent will receive a call on this number.
userId Y This is the user id that would be assigned to that agent.
musicOnHold Y This is the music that would be played on hold.

Example Request

<?xml version="1.0" encoding="utf-8"?>

  
    
      string
      -8113
      string
      string
     string
    
  

Sample PHP Code

public function agentLoginWithMusicOnHold($api_key,$campaignId,$phonenumber,$userId,$musicOnHold,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/DirectConnectService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$createcampaign = array(
  		'key' => $api_key,
  		'campaignId' => $campaignId,
	'phonenumber'=> $phonenumber,
	'userId' => $userId,
	'musicOnHold' => $musicOnHold
	);
	try
	{
		$agentlogin = $campaignOutboundClient->agentLoginWithMusicOnHold($createcampaign);
		if($debug)
		{
			echo "Agent Login Success";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public void agentLoginWithMusicOnHold(string key, long campaignId, string phonenumber, string userid, string musiconhold)
 {
     try
     {
         this.directConnectService.agentLoginWithMusicOnHold(key, campaignId, phonenumber, userid, musiconhold);
     }
     catch(Exception e)
     {
         string msg = "Unable to call agentLoginWithMusicOnHold(string key, long campaignId, string phonenumber, string userid, string musiconhold)";
         LOG.Error(msg);
         throw new DirectConnectServiceException(msg, e);
     }
 }

barge

Use this function to listen to an agent's call.

Parameters

Parameter name Required Description
api_key Y This is the key that you were provided when you registered with CallFire.com, You can view your key by logging onto callfire.com & then goto "Settings -> Account Settings
campaignId Y This is the id of the campaign that you want to stop
agentId Y This is the id of the agent
phonenumber Y This is the phone number of the agent whose conversation you want to listen

Example Request

<?xml version="1.0" encoding="utf-8"?>

  
    
      string
      -1386
      string
      string
    
  

Sample PHP Code

public function barge($api_key,$campaignId,$agentId,$phonenumber,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/DirectConnectService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$createcampaign = array(
  		'key' => $api_key,
  		'campaignId' => $campaignId,
	'agentId' => $agentId,
	'phonenumber'=> $phonenumber
	);
	try
	{
		$Bridge = $campaignOutboundClient->barge($createcampaign);
		if($debug)
		{
			echo "Barge success";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public void barge(string key, long campaignId,string agentid,string phonenumber)
{
    try
    {
        this.directConnectService.barge(key,campaignId,agentid,phonenumber);
    }
    catch(Exception e)
    {
        string msg = "Unable to barge(string key, long campaignId,string agentid,string phonenumber)";
        LOG.Error(msg);
        throw new DirectConnectServiceException(msg, e);
    }
}

bridgeCall

Example Request

<?xml version="1.0" encoding="utf-8"?>

  
    
      string
      744
      string
      string
      string
    
  

Sample PHP Code

public function bridgeCall($api_key,$campaignId,$agentId,$phonenumber,$callerid,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/DirectConnectService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$createcampaign = array(
  		'key' => $api_key,
  		'campaignId' => $campaignId,
	'agentId' => $agentId,
	'phonenumber'=> $phonenumber,
	'callerid' => $callerid
	);
	try
	{
		$bridgeCall = $campaignOutboundClient->bridgeCall($createcampaign);
		if($debug)
		{
			echo "Bridge Call success";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public void bridgeCall (string key, long campaignId,string agentid,string phonenumber,string callerid)
{
    try
    {
        this.directConnectService.bridgeCall(key,campaignId,agentid,phonenumber,callerid);
    }
    catch(Exception e)
    {
        string msg = "Unable to bridgeCall (string key, long campaignId,string agentid,string phonenumber,string callerid)";
        LOG.Error(msg);
        throw new DirectConnectServiceException(msg, e);
    }
}

deBridgeCall

Example Request

<?xml version="1.0" encoding="utf-8"?>

  
    
      string
      2055
      string
    
  

Sample PHP Code

public function deBridgeCall($api_key,$campaignId,$agentId,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/DirectConnectService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$createcampaign = array(
  		'key' => $api_key,
  		'campaignId' => $campaignId,
	'agentId' => $agentId
	);
	try
	{
		$deBridgeCall = $campaignOutboundClient->deBridgeCall($createcampaign);
		if($debug)
		{
			echo "Call de-Bridged success";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public void deBridgeCall(string key, long campaignId, string agentId)
{
    try
    {
        this.directConnectService.deBridgeCall(key, campaignId, agentId);
    }
    catch (Exception e)
    {
        string msg = "Unable deBridgeCall(string key, long campaignId, string agentId)";
        LOG.Error(msg);
        throw new DirectConnectServiceException(msg, e);
    }
}

getAgentInfo

Use this function to get the agent information

Parameters

Parameter name Required Description
api_key Y This is the key that you were provided when you registered with CallFire.com, You can view your key by logging onto callfire.com & then goto "Settings -> Account Settings
campaignId Y This is the id of the campaign correspoding to which you want to get the agent information.
agentId Y This is the id of the agent whose information you want to view.

Example Request

<?xml version="1.0" encoding="utf-8"?>

  
    
      string
      5198
      string
    
  

Sample PHP Code

public function getAgentInfo($api_key,$campaignId,$agentId,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/DirectConnectService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$createcampaign = array(
  		'key' => $api_key,
  		'campaignId' => $campaignId,
	'agentId' => $agentId
	);
	try
	{
		$getAgentinfo = $campaignOutboundClient->getAgentInfo($createcampaign);
		$agentInfoReponse = $getAgentinfo->out;
		if($debug)
		{
			echo "Agent Info :: ".$agentInfoReponse;
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public string getAgentInfo(string key, long campaignId,string agentid)
{
    try
    {
        string response = this.directConnectService.getAgentInfo(key,campaignId,agentid);
        return response;
    }
    catch(Exception e)
    {
        string msg = "Unable to getAgentInfo(string key, long campaignId,string agentid)";
        LOG.Error(msg);
        throw new DirectConnectServiceException(msg, e);
    }
}

getAgentId

This function will get you the Agent ID (A unique session id created for each time an agent is logged in) of a user you just logged in. The userId must match. It requires you have =

  1. Already sent an agent login request
  2. The agent is on the phone and has heard your entire intro sound file
  3. The agent has not hung up the phone call

Parameters

Parameter name Required Description
key Y your API Key
campaignId Y the campaign ID you are using
userId Y the userid of the agent you logged in

Returns

Type Description
long the agent id you can use to bridge calls to.

Sample PHP Code

public function getAgentId($api_key,$campaignId,$userId,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/DirectConnectService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$createcampaign = array(
  		'key' => $api_key,
  		'campaignId' => $campaignId,
	'userId' => $agentId
	);
	try
	{
		$agentId = $campaignOutboundClient->getAgentId($createcampaign);
		$agentIdResponse = $agentId->out;
		if($debug)
		{
			echo "Agent ID :: ".$agentIdResponse;
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public long getAgentId(string key, long campaignid, string userid)
{
    try
    {
        long agentid = this.directConnectService.getAgentId(key, campaignid, userid);
        return agentid;
    }
    catch(Exception e)
    {
        string msg = "Unable to getAgentId(string key, long campaignid, string userid)";
        LOG.Error(msg);
        throw new DirectConnectServiceException(msg, e);
    }
}

getAgentList

Use this function to the list of all the agents

Parameters

Parameter name Required Description
api_key Y This is the key that you were provided when you registered with CallFire.com, You can view your key by logging onto CallFire.com & then goto "Settings -> Account Settings
campaignId Y This is the id of the campaign corresponding to which you want to get the list of all agents.

Example Request

<?xml version="1.0" encoding="utf-8"?>

  
    
      string
      -7309
    
  

Sample PHP Code

public function getAgentList($api_key,$campaignId,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/DirectConnectService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$createcampaign = array(
  		'key' => $api_key,
  		'campaignId' => $campaignId
	);
	try
	{
		$getAgentList = $campaignOutboundClient->getAgentList($createcampaign);
		$getAgentListResponse = $getAgentList->out;
		
		if($debug)
		{
			print_r($getAgentListResponse);
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public string[] getAgentList (string key,long campaignId)
{
    try
    {
        string[] getAgent_List = this.directConnectService.getAgentList(key,campaignId);
        return getAgent_List;
    }
    catch(Exception e)
    {
        string msg = "Unable to getAgentList (string key,long campaignId)";
        LOG.Error(msg);
        throw new DirectConnectServiceException(msg, e);
    }
}

kickAgent

Use this function to login an agent.

Parameters

Parameter name Required Description
api_key Y This is the key that you were provided when you registered with CallFire.com, You can view your key by logging onto callfire.com & then goto "Settings -> Account Settings
campaignId Y This is the id of the campaign.
agentId Y This is the id of the agent that you want to login into the system.

Example Request

<?xml version="1.0" encoding="utf-8"?>

  
    
      string
      9245
      string
    
  

Sample PHP Code

public function kickAgent($api_key,$campaignId,$agentId,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/DirectConnectService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$createcampaign = array(
  		'key' => $api_key,
  		'campaignId' => $campaignId,
	'agentId' => $agentId
	);
	try
	{
		$kickAgent = $campaignOutboundClient->kickAgent($createcampaign);
		if($debug)
		{
			echo "Agent login success";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public void kickAgent(string key,long campaignid,string agentid)
 {
     try
     {
         this.directConnectService.kickAgent(key, campaignid, agentid);
     }
     catch(Exception e)
     {
         string msg = "Unable to kickAgent(string key,long campaignid,string agentid)";
         LOG.Error(msg);
         throw new DirectConnectServiceException(msg, e);
     }
 }

sendAMCallToSound

If the agent hits an answering machine, this function can be used to play back a pre-recorded message to the call. The Agent is immediately available to take the next call.

When this function is called, the CallFire system will wait for the answering machine intro to stop playing before it starts playing your sound file.

Parameters

Parameter name Required Description
api_key Y This is the key that you were provided when you registered with CallFire.com, You can view your key by logging onto callfire.com & then goto "Settings -> Account Settings
campaignId Y This is the id of the campaign.
agentId Y This is the id of the agent.
soundFileId Y This is the sound file id. You can get this id by logging on to CallFire.com

Sample PHP Code

public function sendAMCallToSound($api_key,$campaignId,$agentId,$soundFileId,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/DirectConnectService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$createcampaign = array(
  		'key' => $api_key,
  		'campaignId' => $campaignId,
	'agentId' => $agentId,
	'soundFileId' => $soundFileId
	);
	try
	{
		$sendAMCall = $campaignOutboundClient->sendAMCallToSound($createcampaign);
		if($debug)
		{
			echo "send AM Call to Sound Success";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public void sendAMCallToSound(string key, long campaignId, string agentid, long soundFileId)
{
    try
    {
        this.directConnectService.sendAMCallToSound(key,campaignId,agentid,soundFileId);
    }
    catch(Exception e)
    {
        string msg = "Unable to sendAMCallToSound(string key, long campaignId,string agentid,long soundFileId)";
        LOG.Error(msg);
        throw new DirectConnectServiceException(msg, e);
    }
}

sendAMCallToSoundDirect

If the agent hits an answering machine, this function can be used to play back a pre-recorded message to the call. The Agent is immediately available to take the next call.

When this function is called, the CallFire system will start playing your sound file immediately. It does not wait for any answering machine intro to stop.

Parameters

  • apikey
  • campaignId
  • agentId
  • soundFileID

redirectCall

Use this function to redirect a call to a different number

Parameters

Parameter name Required Description
api_key Y The API key that is registered with your account
campaignId Y This is the id of the campaign that you want to stop
agentId Y This is the id of the agent
phonenumber Y This is the phone number to which you want the call to be re-directed
callerid Y This is the callerid that would appear on all calls

Example Request

<?xml version="1.0" encoding="utf-8"?>

  
    
      string
      5115
      string
      string
      string
    
  

Sample PHP Code

public function redirectCall($api_key,$campaignId,$agentId,$phonenumber,$callerid,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/DirectConnectService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$createcampaign = array(
  		'key' => $api_key,
  		'campaignId' => $campaignId,
	'agentId' => $agentId,
	'phonenumber'=> $phonenumber,
	'callerid' => $callerid
	);
	try
	{
		$redirectCall = $campaignOutboundClient->redirectCall($createcampaign);
		if($debug)
		{
			echo "Call re-directed";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public void redirectCall(string key,long campaignId,string agentId,string phonenumber,string callerid)
{
    try
    {
        this.directConnectService.redirectCall(key,campaignId,agentId,phonenumber,callerid);
    }
    catch(Exception e)
    {
        string msg = "Unable to redirectCall(string key,long campaignId,string agentId,string phonenumber,string callerid)";
        LOG.Error(msg);
        throw new DirectConnectServiceException(msg, e);
    }
}

startCampaign

Use this function to start an existing campaign

Parameters

Parameter name Required Description
api_key Y This is the key that you were provided when you registered with CallFire.com, You can view your key by logging onto CallFire.com & then goto "Settings -> Account Settings
campaignId Y This is the id of the campaign that you want to start

Example Request

<?xml version="1.0" encoding="utf-8"?>

  
    
      string
      -8035
    
  

Sample PHP Code

public function startDCCampaign($api_key,$campaignId,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/DirectConnectService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$createcampaign = array(
  		'key' => $api_key,
  		'campaignId' => $campaignId
	);
	try
	{
		$startCampaign = $campaignOutboundClient->startCampaign($createcampaign);
		if($debug)
		{
			echo "Campaign Started ";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public void startCampaign(string key, long campaignId)
{
    try
    {
        this.directConnectService.startCampaign(key,campaignId);
    }
    catch(Exception e)
    {
        string msg = "Unable to startCampaign(string key, long campaignId)";
        LOG.Error(msg);
        throw new DirectConnectServiceException(msg, e);
    }
}

stopCampaign

Use this function to stop a campaign

Parameter name Required Description
api_key Y This is the key that you were provided when you registered with CallFire.com, You can view your key by logging onto callfire.com & then goto "Settings -> Account Settings
campaignId Y This is the id of the campaign that you want to stop

Example Request

<?xml version="1.0" encoding="utf-8"?>

  
    
      string
      -6584
    
  

Sample PHP Code

public function stopDCCampaign($api_key,$campaignId,$debug)
{
	$createOtboundcampaignWsdl = 'https://www.callfire.com/service/DirectConnectService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$createcampaign = array(
  		'key' => $api_key,
  		'campaignId' => $campaignId
	);
	try
	{
		$stopCampaign = $campaignOutboundClient->stopCampaign($createcampaign);
		if($debug)
		{
			echo "Campaign Stoped ";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public void stopCampaign(string key, long campaignId)
{
    try
    {
        this.directConnectService.stopCampaign(key,campaignId);
    }
    catch(Exception e)
    {
        string msg = "Unable to stopCampaign(string key, long campaignId)";
        LOG.Error(msg);
        throw new DirectConnectServiceException(msg, e);
    }
}

Sample Client

The following code, written in Java using xFire is showcases the agent login process.

Sample C# Code

public class DirectConnectClient 
{
	private static final String APIKEY = "6f83c5703d17830d3b7d2wefwlkjwiuqwoioihhnsdf7327f2048a";
	private static final long CAMPAIGNID = 106459;
	
	public static void main(String [] args)
	{
		DirectConnectServiceClient client = new DirectConnectServiceClient();
        
		//create a default service endpoint
        DirectConnectServicePortType service = client.getDirectConnectServiceHttpPort();
        
		//login the agent
		service.agentLogin(APIKEY, CAMPAIGNID, "2135556955", "uuu1");
		
		// Get the list of agents logged in for that campaign ( Just for fun ) 
		List<String> agentList = service.getAgentList(APIKEY, CAMPAIGNID).getString();
		System.out.println(agentList);
		
                // get the Agentid ( Session ID for the agent )
		long agentid = service.getAgentId(APIKEY, CAMPAIGNID, "uuu1");
		
		try
		{
			Thread.sleep(30000L); // 30 seconds wait to make sure agent hears the intro and is ready for the call
		} catch (Exception e) {}
		
		System.out.println("Sending Call..." + agentid);
		
		// The number 3105557076 is the number to which the agent wants to connect.
		service.bridgeCall(APIKEY, CAMPAIGNID, Long.toString(agentid), "3105557076", "2135556955");

		System.out.println("test client completed");
        		
		System.exit(0);
	}
}