Contents |
You can run a click to call connection using SOAP or REST. There is also a Single Bridge Call API if you just want to connect two callers.
WSDL: https://www.callfire.com/service/ClickToCallAPI?wsdl
Variables:
URL: https://www.callfire.com/service/clicktocall/sendconnect
Variables:
Where Campaign ID is 1, Number to connect is 123-123-3214, jaa13@gmail.com is additional information and the call is instant (0 delay)
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<tnsa:createClickToCallCampaign xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://clicktocall.service.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:key>string</tnsa:key>
<tnsa:transferNumber>string</tnsa:transferNumber>
<tnsa:awayMessage>string</tnsa:awayMessage>
</tnsa:createClickToCallCampaign>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function createClickToCallCampaign($api_key,$caller_id,$transferNumber,$awayMessage,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/ClickToCallAPI?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$createcampaign = array(
'key' => $api_key,
'callerid' => $caller_id,
'transferNumber' => $transferNumber,
'awayMessage' => $awayMessage
);
try
{
$createClickToCallCampaignResponse = $campaignOutboundClient->createClickToCallCampaign($createcampaign);
$campaignId = $createClickToCallCampaignResponse->out;
if($debug)
{
echo "CampaignID : ".$campaignId."<br/>";
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."<br/>";
}
}
}
public long createClickToCallCampaign(string key, string callerid, string transferNumber, string awayMessage)
{
//LOG.Info("Entered createClickToCallCampaign(string key, string callerid, string transferNumber, string awayMessage)");
try
{
long campaignId = (long) this.clickToCallAPI.createClickToCallCampaign(key, callerid, transferNumber, awayMessage);
return campaignId;
}
catch (Exception e)
{
string msg = "Unable to create click to call campaign";
LOG.Error(msg);
throw new ClickToCallServiceException(msg, e);
}
finally
{
//LOG.Info("Exited createClickToCallCampaign(string key, string callerid, string transferNumber, string awayMessage)");
}
}
Use this function to send out a connection for a campaign that you created.
Parameters
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<tnsa:sendConnection xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://clicktocall.service.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:key>string</tnsa:key>
<tnsa:cfacct>3892</tnsa:cfacct>
<tnsa:phonenumber>string</tnsa:phonenumber>
<tnsa:info>string</tnsa:info>
<tnsa:delay>-5337</tnsa:delay>
</tnsa:sendConnection>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function sendConnection($api_key,$cfacct,$phoneNumber,$info,$delay,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/ClickToCallAPI?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$createcampaign = array(
'key' => $api_key,
'cfacct' => $cfacct,
'phonenumber' => $phoneNumber,
'info' => $info,
'delay' => $delay
);
try
{
$sendconnectionResponse = $campaignOutboundClient->sendConnection($createcampaign);
$campaignId = $sendconnectionResponse->out;
if($debug)
{
echo "Connection sent success";
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."<br/>";
}
}
}
public void sendConnection(string key, int cfacct, string phonenumber, string info, int delay)
{
//LOG.Info("Entered sendConnection(string key, int cfacct, string phonenumber, string info, int delay)");
try
{
this.clickToCallAPI.sendConnection(key, cfacct, phonenumber, info, delay);
}
finally
{
//LOG.Info("Exited sendConnection(string key, int cfacct, string phonenumber, string info, int delay)");
}
}
