This page contains links, tips, and tricks to leverage CallFire's Recording service.
In addition to creating Recording campaigns via the web portal, developers can create campaigns via the Record service.
Use this function to download the sound file corresponding to a given recording id.
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:getRecording xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://api.campaign.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:secretkey>string</tnsa:secretkey>
<tnsa:recId>string</tnsa:recId>
</tnsa:getRecording>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function get_Recording($secretkey,$recId,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/RecordService?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$recparams = array(
'secretkey' => $secretkey,
'recId' => $recId
);
try
{
$getRecordingResponse = $campaignOutboundClient->getRecording($recparams);
$recordingBytes = $getRecordingResponse->out;
if($debug)
{
print_r($recordingBytes);
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."";
}
}
}
public byte[] getRecording(string secretkey, string recId)
{
//LOG.Info("Entered getRecording(string secretkey, string recId)");
try
{
byte[] recResponse = this.recordService.getRecording(secretkey, recId);
return recResponse;
}
catch (Exception e)
{
string msg = "Unable to execute the call (getRecording)";
LOG.Error(msg);
throw new RecordServiceException(msg, e);
}
finally
{
//LOG.Info("Exited getRecording(string secretkey, string recId)");
}
}
Use this function to to get the sound file corresponding to a given call id.
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:getRecordingByCallid xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://api.campaign.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:secretkey>string</tnsa:secretkey>
<tnsa:callId>-1830</tnsa:callId>
</tnsa:getRecordingByCallid>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function getRecordingByCallid($secretkey,$callId,$debug)
{
$createOtboundcampaignWsdl = 'https://ui2.callfire.com/service/RecordService?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$getrecparams = array(
'secretkey' => $secretkey,
'callId' => $callId
);
try
{
$getRecordingByCallidResponse = $campaignOutboundClient->getRecordingByCallid($getrecparams);
$recording = $getRecordingByCallidResponse->out;
if($debug)
{
print_r($recording);
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."";
}
}
}
public byte[] getRecordingByCallid(string secretkey, long callId)
{
//LOG.Info("Entered getRecordingByCallid(string secretkey, long callId)");
try
{
byte[] recResponse = this.recordService.getRecordingByCallid(secretkey, callId);
return recResponse;
}
catch (Exception e)
{
string msg = "Unable to execute the call (getRecordingByCallid)";
LOG.Error(msg);
throw new RecordServiceException(msg, e);
}
finally
{
//LOG.Info("Exited getRecordingByCallid(string secretkey, long callId)");
}
}
Use this function to remove a recoridng from your callfire account
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:removeRecording xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://api.campaign.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:secretkey>string</tnsa:secretkey>
<tnsa:recId>string</tnsa:recId>
</tnsa:removeRecording>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function removeRecording($secretkey,$recId,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/RecordService?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$handle = fopen($recsound,'r');
$contents = fread($handle,filesize($recsound));
$sfile = $contents;
$recparams = array(
'secretkey' => $secretkey,
'recId' => $recId
);
try
{
$recordingreponse = $campaignOutboundClient->removeRecording($recparams);
if($debug)
{
echo "Recording removed";
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."";
}
}
}
public void removeRecording(string secretkey, string recId)
{
//LOG.Info("Entered removeRecording(string secretkey, string recId)");
try
{
this.recordService.removeRecording(secretkey, recId);
}
catch (Exception e)
{
string msg = "Unable to remove the recording";
LOG.Error(msg);
throw new RecordServiceException(msg, e);
}
finally
{
//LOG.Info("Exited removeRecording(string secretkey, string recId)");
}
}
Use this function to create a record campaign for broadcasting to a list of users
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:sendRecordBroadcast
xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://api.campaign.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:secretkey>string</tnsa:secretkey>
<tnsa:callerid>string</tnsa:callerid>
<tnsa:soundFileToPlay>YTM0NZomIzI2OTsmIzM0NTueYQ==</tnsa:soundFileToPlay>
<tnsa:acceptDigit>1</tnsa:acceptDigit>
<tnsa:soundToPlayAfterAccepted>YTM0NZomIzI2OTsmIzM0NTueYQ==</tnsa:soundToPlayAfterAccepted>
<tnsa:phoneNumbers>
<tnsa:NumberIdType>
<tnsa:phonenumber>string</tnsa:phonenumber>
<tnsa:recId>string</tnsa:recId>
</tnsa:NumberIdType>
<tnsa:NumberIdType>
<tnsa:phonenumber>string</tnsa:phonenumber>
<tnsa:recId>string</tnsa:recId>
</tnsa:NumberIdType>
<tnsa:NumberIdType>
<tnsa:phonenumber>string</tnsa:phonenumber>
<tnsa:recId>string</tnsa:recId>
</tnsa:NumberIdType>
<tnsa:NumberIdType>
<tnsa:phonenumber>string</tnsa:phonenumber>
<tnsa:recId>string</tnsa:recId>
</tnsa:NumberIdType>
<tnsa:NumberIdType>
<tnsa:phonenumber>string</tnsa:phonenumber>
<tnsa:recId>string</tnsa:recId>
</tnsa:NumberIdType>
</tnsa:phoneNumbers>
</tnsa:sendRecordBroadcast>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function sendRecordBroadcast($secretkey,$callerid,$soundFileToPlay,$acceptDigit,$soundToPlayAfterAccepted,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/RecordService?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$numberidtype1 = new NumberIdType("2134000543","1");
$numberidtype2 = new NumberIdType("8778973473","2");
$numberidtype['NumberIdType'][0] = $numberidtype1;
$numberidtype['NumberIdType'][1] = $numberidtype2;
$handle = fopen($soundFileToPlay,'r');
$contents = fread($handle,filesize($soundFileToPlay));
$sfile = $contents;
$handle1 = fopen($soundToPlayAfterAccepted,'r');
$contents1 = fread($handle1,filesize($soundToPlayAfterAccepted));
$safile = $contents1;
$sendBroadcastCampaign = array(
'secretkey' => $secretkey,
'callerid' => $callerid,
'soundFileToPlay' => $sfile,
'acceptDigit' => $acceptDigit,
'soundToPlayAfterAccepted' => $safile,
'phoneNumbers' => $numberidtype
);
try
{
$sendRecordBroadcastResponse = $campaignOutboundClient->sendRecordBroadcast($sendBroadcastCampaign);
$campaignId = $sendRecordBroadcastResponse->out;
if($debug)
{
echo "Campaign ID :: ".$campaignId;
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."";
}
}
}
public long sendRecordBroadcast(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType[] phoneNumber)
{
//LOG.Info("Entered sendRecordBroadcast(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType[] phoneNumber)");
try
{
long reponseId = this.recordService.sendRecordBroadcast(secretkey, callerid, soundFileToPlay, acceptDigit, soundToPlayAfterAccepted, phoneNumber);
return reponseId;
}
catch (Exception e)
{
string msg = "Unable to execute the call sendRecordBroadcast";
LOG.Error(msg);
throw new RecordServiceException(msg, e);
}
finally
{
//LOG.Info("Exited sendRecordBroadcast(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType[] phoneNumber)");
}
}
Use this function to play a file to a user. The user will then record a response and the function will return the sound recording (in bytes).
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:sendRecordingCallSoundID
xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://api.campaign.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:secretkey>string</tnsa:secretkey>
<tnsa:callerid>string</tnsa:callerid>
<tnsa:soundFileToPlay>YTM0NZomIzI2OTsmIzM0NTueYQ==</tnsa:soundFileToPlay>
<tnsa:acceptDigit>1</tnsa:acceptDigit>
<tnsa:soundToPlayAfterAccepted>YTM0NZomIzI2OTsmIzM0NTueYQ==</tnsa:soundToPlayAfterAccepted>
<tnsa:phoneNumber>
<tnsa:phonenumber>string</tnsa:phonenumber>
<tnsa:recId>string</tnsa:recId>
</tnsa:phoneNumber>
</tnsa:sendRecordingCallSoundID>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function sendRecordingCallSoundID($secretkey,$callerid,$soundFileToPlay,$acceptDigit,$soundToPlayAfterAccepted,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/RecordService?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$numberidtype = new NumberIdType("2134000543","1");
$handle = fopen($soundFileToPlay,'r');
$contents = fread($handle,filesize($soundFileToPlay));
$sfile = $contents;
$handle1 = fopen($soundToPlayAfterAccepted,'r');
$contents1 = fread($handle1,filesize($soundToPlayAfterAccepted));
$safile = $contents1;
$createcampaign = array(
'secretkey' => $secretkey,
'callerid' => $callerid,
'soundFileToPlay' => $sfile,
'acceptDigit' => $acceptDigit,
'soundToPlayAfterAccepted' => $safile,
'phoneNumber' => $numberidtype
);
try
{
$sendRecordingCallSoundIDResponse = $campaignOutboundClient->sendRecordingCallSoundID($createcampaign);
$campaignId = $sendRecordingCallSoundIDResponse->out;
if($debug)
{
echo "Campaign Id :: ".$campaignId;
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."";
}
}
}
public long sendRecordingCallSoundID(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType phoneNumber)
{
//LOG.Info("sendRecordingCallSoundID(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType phoneNumber)");
try
{
long reponseId = this.recordService.sendRecordingCallSoundID(secretkey, callerid, soundFileToPlay, acceptDigit, soundToPlayAfterAccepted, phoneNumber);
return reponseId;
}
catch (Exception e)
{
string msg = "Unable to execute the call sendRecordingCallSoundID(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType phoneNumber)";
LOG.Error(msg);
throw new RecordServiceException(msg, e);
}
finally
{
//LOG.Info("sendRecordingCallSoundID(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType phoneNumber)");
}
}
Creates a record call and returns the ID of the saved sound file. Same as the one above, but it puts a limit on the size of the recording.
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:sendRecordingCallSoundIDWithLimit
xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://api.campaign.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:secretkey>string</tnsa:secretkey>
<tnsa:callerid>string</tnsa:callerid>
<tnsa:soundFileToPlay>YTM0NZomIzI2OTsmIzM0NTueYQ==</tnsa:soundFileToPlay>
<tnsa:acceptDigit>1</tnsa:acceptDigit>
<tnsa:soundToPlayAfterAccepted>YTM0NZomIzI2OTsmIzM0NTueYQ==</tnsa:soundToPlayAfterAccepted>
<tnsa:phoneNumber>
<tnsa:phonenumber>string</tnsa:phonenumber>
<tnsa:recId>string</tnsa:recId>
</tnsa:phoneNumber>
<tnsa:recordLimitSeconds>7129</tnsa:recordLimitSeconds>
</tnsa:sendRecordingCallSoundIDWithLimit>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function sendRecordingCallSoundIDWithLimit($secretkey,$callerid,$soundFileToPlay,$acceptDigit,$soundToPlayAfterAccepted,$recordLimitSeconds,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/RecordService?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$numberidtype = new NumberIdType("2134000543","1");
$handle = fopen($soundFileToPlay,'r');
$contents = fread($handle,filesize($soundFileToPlay));
$sfile = $contents;
$handle1 = fopen($soundToPlayAfterAccepted,'r');
$contents1 = fread($handle1,filesize($soundToPlayAfterAccepted));
$safile = $contents1;
$sendrecparams = array(
'secretkey' => $secretkey,
'callerid' => $callerid,
'soundFileToPlay' => $sfile,
'acceptDigit' => $acceptDigit,
'soundToPlayAfterAccepted' => $safile,
'phoneNumber' => $numberidtype,
'recordLimitSeconds' => $recordLimitSeconds
);
try
{
$sendRecordingCallSoundIDWithLimitResponse = $campaignOutboundClient->sendRecordingCallSoundIDWithLimit($sendrecparams);
$campaignId = $sendRecordingCallSoundIDWithLimitResponse->out;
if($debug)
{
echo "Campaign ID ".$campaignId;
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."";
}
}
}
public byte[] sendSingleCallRecordBroadcastWithLimit(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType phoneNumber, int recordLimitSeconds)
{
//LOG.Info("Entered sendSingleCallRecordBroadcastWithLimit(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType phoneNumber, int recordLimitSeconds)");
try
{
byte[] recordingResponse = this.recordService.sendSingleCallRecordBroadcastWithLimit(secretkey, callerid, soundFileToPlay, acceptDigit, soundToPlayAfterAccepted, phoneNumber, recordLimitSeconds);
return recordingResponse;
}
catch (Exception e)
{
string msg = "Unable to execute the call sendSingleCallRecordBroadcastWithLimit";
LOG.Error(msg);
throw new RecordServiceException(msg, e);
}
finally
{
//LOG.Info("Exited sendSingleCallRecordBroadcastWithLimit(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType phoneNumber, int recordLimitSeconds)");
}
}
Creates a record call and returns the ID of the saved sound file. You can also set the duration (in seconds) for which the user can do a recording. Use this function if you have your sound files uploaded on callfire.com
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:sendRecordingCallSoundIDWithLimit
xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://api.campaign.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:secretkey>string</tnsa:secretkey>
<tnsa:callerid>string</tnsa:callerid>
<tnsa:soundFileToPlay>10</tnsa:soundFileToPlay>
<tnsa:acceptDigit>1</tnsa:acceptDigit>
<tnsa:soundToPlayAfterAccepted>10</tnsa:soundToPlayAfterAccepted>
<tnsa:phoneNumber>
<tnsa:phonenumber>string</tnsa:phonenumber>
<tnsa:recId>string</tnsa:recId>
</tnsa:phoneNumber>
<tnsa:recordLimitSeconds>7129</tnsa:recordLimitSeconds>
</tnsa:sendRecordingCallSoundIDWithLimit>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function sendRecordingCallSoundIDWithLimit2($secretkey,$callerid,$soundFileToPlay,$acceptDigit,$soundToPlayAfterAccepted,$recordLimitSeconds,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/RecordService?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$numberidtype = new NumberIdType("2134000543","1");
$handle = fopen($soundFileToPlay,'r');
$contents = fread($handle,filesize($soundFileToPlay));
$sfile = $contents;
$handle1 = fopen($soundToPlayAfterAccepted,'r');
$contents1 = fread($handle1,filesize($soundToPlayAfterAccepted));
$safile = $contents1;
$sendrecparams = array(
'secretkey' => $secretkey,
'callerid' => $callerid,
'soundFileToPlay' => $sfile,
'acceptDigit' => $acceptDigit,
'soundToPlayAfterAccepted' => $safile,
'phoneNumber' => $numberidtype,
'recordLimitSeconds' => $recordLimitSeconds
);
try
{
$sendRecResponse = $campaignOutboundClient->sendRecordingCallSoundIDWithLimit2($sendrecparams);
$campaignId = $sendRecResponse->out;
if($debug)
{
echo "Campaign Id : ".$campaignId;
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."";
}
}
}
public long sendRecordingCallSoundIDWithLimit2(string secretkey, string callerid, long soundFileToPlay, int acceptDigit, long soundToPlayAfterAccepted, NumberIdType phoneNumber, int recordLimitSeconds)
{
//LOG.Info("Entered sendRecordingCallSoundIDWithLimit2(string secretkey, string callerid, long soundFileToPlay, int acceptDigit, long soundToPlayAfterAccepted, NumberIdType phoneNumber, int recordLimitSeconds)");
try
{
long reponseId = this.recordService.sendRecordingCallSoundIDWithLimit2(secretkey, callerid, soundFileToPlay, acceptDigit, soundToPlayAfterAccepted, phoneNumber, recordLimitSeconds);
return reponseId;
}
catch (Exception e)
{
string msg = "Unable to execute the call sendRecordingCallSoundIDWithLimit2(string secretkey, string callerid, long soundFileToPlay, int acceptDigit, long soundToPlayAfterAccepted, NumberIdType phoneNumber, int recordLimitSeconds)";
LOG.Error(msg);
throw new RecordServiceException(msg, e);
}
finally
{
//LOG.Info("Exited sendRecordingCallSoundIDWithLimit2(string secretkey, string callerid, long soundFileToPlay, int acceptDigit, long soundToPlayAfterAccepted, NumberIdType phoneNumber, int recordLimitSeconds)");
}
}
Creates a record campaign for broadcasting
Parameters
/**
* Creates a record campaign for broadcasting
*
* @param secretkey your api key
* @param callerid the callerid on each call
* @param soundFileToPlay the Sound file to play when a user answers the call and
to leave on an answering machine
* @param acceptDigit the digit a user presses to start the recording process
* @param soundToPlayAfterAccepted the sound played to user after they press a key
* @param phoneNumber the phone number and the record id
* @return byte[] of the wave file recorded.
* @throws Exception if any errors occur
*/
<?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:sendSingleCallRecordBroadcast xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://api.campaign.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:secretkey>string</tnsa:secretkey>
<tnsa:callerid>string</tnsa:callerid>
<tnsa:soundFileToPlay>YTM0NZomIzI2OTsmIzM0NTueYQ==</tnsa:soundFileToPlay>
<tnsa:acceptDigit>1</tnsa:acceptDigit>
<tnsa:soundToPlayAfterAccepted>YTM0NZomIzI2OTsmIzM0NTueYQ==</tnsa:soundToPlayAfterAccepted>
<tnsa:phoneNumber>
<tnsa:phonenumber>string</tnsa:phonenumber>
<tnsa:recId>string</tnsa:recId>
</tnsa:phoneNumber>
</tnsa:sendSingleCallRecordBroadcast>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function sendSingleCallRecordBroadcast($secretkey,$callerid,$soundFileToPlay,$acceptDigit,$soundToPlayAfterAccepted,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/RecordService?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$numberidtype1 = new NumberIdType("2134000543","1");
$handle = fopen($soundFileToPlay,'r');
$contents = fread($handle,filesize($soundFileToPlay));
$sfile = $contents;
$handle1 = fopen($soundToPlayAfterAccepted,'r');
$contents1 = fread($handle1,filesize($soundToPlayAfterAccepted));
$safile = $contents1;
$sendrecordbroadcast = array(
'secretkey' => $secretkey,
'callerid' => $callerid,
'soundFileToPlay' => $sfile,
'acceptDigit' => $acceptDigit,
'soundToPlayAfterAccepted' => $safile,
'phoneNumber' => $numberidtype1
);
try
{
$sendSingleCallRecordBroadcastResponse = $campaignOutboundClient->sendSingleCallRecordBroadcast($sendrecordbroadcast);
$recordingFile = $sendSingleCallRecordBroadcastResponse->out;
if($debug)
{
echo $recordingFile;
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."";
}
}
}
public byte[] sendSingleCallRecordBroadcast(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType phoneNumber)
{
//LOG.Info("Entered sendSingleCallRecordBroadcast(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType phoneNumber)");
try
{
byte[] recordingResponse = this.recordService.sendSingleCallRecordBroadcast(secretkey, callerid, soundFileToPlay, acceptDigit, soundToPlayAfterAccepted, phoneNumber);
return recordingResponse;
}
catch (Exception e)
{
string msg = "Unable to execute the call sendSingleCallRecordBroadcast";
LOG.Error(msg);
throw new RecordServiceException(msg, e);
}
finally
{
//LOG.Info("Exited sendSingleCallRecordBroadcast(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType phoneNumber)");
}
}
Use this function to send out a single call. Your message would be played to the user & if they press the accept digit, they would be played another sound file & then they would be prompted to record their message for the duration that you have set.
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:sendRecordingCallSoundIDWithLimit xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tnsa="http://api.campaign.dialer.skyyconsulting.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tnsa:secretkey>string</tnsa:secretkey>
<tnsa:callerid>string</tnsa:callerid>
<tnsa:soundFileToPlay>YTM0NZomIzI2OTsmIzM0NTueYQ==</tnsa:soundFileToPlay>
<tnsa:acceptDigit>1</tnsa:acceptDigit>
<tnsa:soundToPlayAfterAccepted>YTM0NZomIzI2OTsmIzM0NTueYQ==</tnsa:soundToPlayAfterAccepted>
<tnsa:phoneNumber>
<tnsa:phonenumber>string</tnsa:phonenumber>
<tnsa:recId>string</tnsa:recId>
</tnsa:phoneNumber>
<tnsa:recordLimitSeconds>-2497</tnsa:recordLimitSeconds>
</tnsa:sendRecordingCallSoundIDWithLimit>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
public function sendRecordingCallSoundIDWithLimit($secretkey,$callerid,$soundFileToPlay,$acceptDigit,$soundToPlayAfterAccepted,$recordLimitSeconds,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/RecordService?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$numberidtype = new NumberIdType("2134000543","1");
$handle = fopen($soundFileToPlay,'r');
$contents = fread($handle,filesize($soundFileToPlay));
$sfile = $contents;
$handle1 = fopen($soundToPlayAfterAccepted,'r');
$contents1 = fread($handle1,filesize($soundToPlayAfterAccepted));
$safile = $contents1;
$sendrecparams = array(
'secretkey' => $secretkey,
'callerid' => $callerid,
'soundFileToPlay' => $sfile,
'acceptDigit' => $acceptDigit,
'soundToPlayAfterAccepted' => $safile,
'phoneNumber' => $numberidtype,
'recordLimitSeconds' => $recordLimitSeconds
);
try
{
$sendRecordingCallSoundIDWithLimitResponse = $campaignOutboundClient->sendRecordingCallSoundIDWithLimit($sendrecparams);
$campaignId = $sendRecordingCallSoundIDWithLimitResponse->out;
if($debug)
{
echo "Campaign ID ".$campaignId;
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."";
}
}
}
public byte[] sendSingleCallRecordBroadcastWithLimit(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType phoneNumber, int recordLimitSeconds)
{
//LOG.Info("Entered sendSingleCallRecordBroadcastWithLimit(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType phoneNumber, int recordLimitSeconds)");
try
{
byte[] recordingResponse = this.recordService.sendSingleCallRecordBroadcastWithLimit(secretkey, callerid, soundFileToPlay, acceptDigit, soundToPlayAfterAccepted, phoneNumber, recordLimitSeconds);
return recordingResponse;
}
catch (Exception e)
{
string msg = "Unable to execute the call sendSingleCallRecordBroadcastWithLimit";
LOG.Error(msg);
throw new RecordServiceException(msg, e);
}
finally
{
//LOG.Info("Exited sendSingleCallRecordBroadcastWithLimit(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType phoneNumber, int recordLimitSeconds)");
}
}
Use this function to send out a single call. Your message would be played to the user & if they press the accept digit, they would be played another sound file & then they would be prompted to record their message for the duration that you have set. You can also use an extension number.
Parameters
public function sendSingleCallRecordBroadcastWithLimitAndExtension($secretkey,$callerid,$soundFileToPlay,$acceptDigit,$soundToPlayAfterAccepted,$extension,$recordLimitSeconds,$debug)
{
$createOtboundcampaignWsdl = 'http://www.callfire.com/service/RecordService?wsdl';
$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
$numberidtype1 = new NumberIdType("2134000543","1");
$handle = fopen($soundFileToPlay,'r');
$contents = fread($handle,filesize($soundFileToPlay));
$sfile = $contents;
$handle1 = fopen($soundToPlayAfterAccepted,'r');
$contents1 = fread($handle1,filesize($soundToPlayAfterAccepted));
$safile = $contents1;
$recordcampaignparams = array(
'secretkey' => $secretkey,
'callerid' => $callerid,
'soundFileToPlay' => $sfile,
'acceptDigit' => $acceptDigit,
'soundToPlayAfterAccepted' => $safile,
'phoneNumber' => $numberidtype1,
'extension' => $extension,
'recordLimitSeconds' => $recordLimitSeconds
);
try
{
$sendSingleCallRecordBroadcastWithLimitAndExtensionResponse = $campaignOutboundClient->sendSingleCallRecordBroadcastWithLimitAndExtension($recordcampaignparams);
$recordingFile = $sendSingleCallRecordBroadcastWithLimitAndExtensionResponse->out;
if($debug)
{
echo $recordingFile;
}
}
catch(SoapFault $error)
{
if($debug)
{
echo $error."";
}
}
}
public byte[] sendSingleCallRecordBroadcastWithLimitAndExtension(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType phoneNumber,int extension,int recordLimitSeconds)
{
//LOG.Info("Entered sendSingleCallRecordBroadcastWithLimitAndExtension(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType phoneNumber,int extension,int recordLimitSeconds)");
try
{
byte[] recordingResponse = this.recordService.sendSingleCallRecordBroadcastWithLimitAndExtension(secretkey, callerid, soundFileToPlay, acceptDigit, soundToPlayAfterAccepted, phoneNumber,extension,recordLimitSeconds);
return recordingResponse;
}
catch (Exception e)
{
string msg = "Unable to execute the call sendSingleCallRecordBroadcastWithLimitAndExtension";
LOG.Error(msg);
throw new RecordServiceException(msg, e);
}
finally
{
//LOG.Info("Exited sendSingleCallRecordBroadcastWithLimitAndExtension(string secretkey, string callerid, byte[] soundFileToPlay, int acceptDigit, byte[] soundToPlayAfterAccepted, NumberIdType phoneNumber,int extension,int recordLimitSeconds)");
}
}
<?php
/*
* Name: Get Recording using Soap
*/
require_once('nusoap/lib/nusoap.php');
$apiKey = '86aezzzzzssssffffsssszzzzzzzzzze61';
$proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
$proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
$client = new nusoap_client('https://www.callfire.com/service/RecordService?wsdl', true, $proxyhost, $proxyport, $proxyusername,$proxypassword);
$err = $client->getError();
if ($err)
{
echo '<h2>Constructor error</h2>' . $err ;
}
$recordid = 292601108;
$params = array('secretkey' => $apiKey, 'recId' => $recordid);
$result = $client->call('getRecording', $params, false, true);
// Check for a fault
if ($client->fault)
{
echo '<h2>Fault</h2>';
print_r($result);
}
else
{
// Check for errors
$err = $client->getError();
if ($err)
{
// Display the error
echo '<h2>Error</h2>' . $err;
}
else
{
// Display the result
echo '<h2>Result</h2>';
print_r($result);
}
}
?>
