This page contains links, tips, and tricks to leverage CallFire's Recording service.
- Jump to Method
- getRecording
- getRecordingByCallid
- removeRecording
- sendRecordBroadcast
- sendRecordingCallSoundID
- sendRecordingCallSoundIDWithLimit
- sendRecordingCallSoundIDWithLimit2
- sendSingleCallRecordBroadcast
- sendSingleCallRecordBroadcastWithLimit
- sendSingleCallRecordBroadcastWithLimitAndExtension
WSDL
In addition to creating Recording campaigns via the web portal, developers can create campaigns via the Record service.
Methods
getRecording
Use this function to download the sound file corresponding to a given recording id.
Parameters
Parameter name | Required | Description |
---|---|---|
secretkey | Y | This is the key that you got when you registered with CallFire.com |
recId | Y | This is the id of the file for which you wish to get the recording. |
Example Request
<?xml version="1.0" encoding="utf-8"?>
string
string
Sample PHP Code
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."";
}
}
}
Sample C# Code
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)");
}
}
getRecordingByCallid
Use this function to to get the sound file corresponding to a given call id.
Parameters
Parameter name | Required | Description |
---|---|---|
secretkey | Y | This is the key that you got when you registered with CallFire.com |
callId | Y | This is the callid for which you wish to get the recording |
Example Request
<?xml version="1.0" encoding="utf-8"?>
string
-1830
Sample PHP Code
public function getRecordingByCallid($secretkey, $callId, $debug)
{
$createOtboundcampaignWsdl = 'https://www.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."";
}
}
}
Sample C# Code
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)");
}
}
removeRecording
Use this function to remove a recording from your CallFire account.
Parameters
Parameter name | Required | Description |
---|---|---|
secretkey | Y | This is the key that you got when you registered with CallFire.com |
recId | Y | This is the recording id from your callfire account that you want to remove. |
Example Request
<?xml version="1.0" encoding="utf-8"?>
string
string
Sample PHP Code
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."";
}
}
}
Sample C# Code
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)");
}
}
sendRecordBroadcast
Use this function to create a record campaign for broadcasting to a list of users.
Parameters
Parameter name | Required | Description |
---|---|---|
secretkey | Y | This is the key that you got when you registerd with CallFire.com |
callerid | Y | This is the caller id that would appear on all outbound calls |
soundFileToPlay | Y | This is the sound file that would be played when a user answers the call and to leave on the answering machine if they are unavailable |
acceptDigit | Y | The digit the user presses to start the recording process |
soundToPlayAfterAccepted | Y | Sound to be played to the user after they press a key |
phoneNumbers | Y | The list of phone numbers along with their id's to which you want to send the broadcast. |
Example Request
<?xml version="1.0" encoding="utf-8"?>
string
string
YTM0NZomIzI2OTsmIzM0NTueYQ==
1
YTM0NZomIzI2OTsmIzM0NTueYQ==
string
string
string
string
string
string
string
string
string
string
Sample PHP Code
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."";
}
}
}
Sample C# Code
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)");
}
}
sendRecordingCallSoundID
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
Parameter name | Required | Description |
---|---|---|
secretkey | Y | This is the key that you got when you registered with CallFire.com |
callerid | Y | This is the caller id that would appear on all outbound calls |
soundFileToPlay | Y | This is the sound file that would be played when a user answers the call and to leave on the answering machine if they are unavailable |
acceptDigit | Y | The digit the user presses to start the recording process |
soundToPlayAfterAccepted | Y | Sound to be played to the user after they press a key |
phoneNumber | Y | Phone Number to call |
Example Request
<?xml version="1.0" encoding="utf-8"?>
string
string
YTM0NZomIzI2OTsmIzM0NTueYQ==
1
YTM0NZomIzI2OTsmIzM0NTueYQ==
string
string
Sample PHP Code
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."";
}
}
}
Sample C# Code
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)");
}
}
sendRecordingCallSoundIDWithLimit
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
Parameter name | Required | Description |
---|---|---|
secretkey | Y | This is the key that you got when you registered with CallFire.com |
callerid | Y | This is the caller id that would appear on all outbound calls |
soundFileToPlay | Y | This is the sound file that would be played when a user answers the call and to leave on the answering machine if they are unavailable |
acceptDigit | Y | The digit the user presses to start the recording process |
soundToPlayAfterAccepted | Y | Sound to be played to the user after they press a key |
phoneNumber | Y | Phone Number to call |
recordLimitSeconds | Y | This is the time in seconds for which the user can do a recording. |
Example Request
<?xml version="1.0" encoding="utf-8"?>
string
string
YTM0NZomIzI2OTsmIzM0NTueYQ==
1
YTM0NZomIzI2OTsmIzM0NTueYQ==
string
string
7129
Sample PHP Code
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."";
}
}
}
Sample C# Code
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)");
}
}
sendRecordingCallSoundIDWithLimit2
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
Parameter name | Required | Description |
---|---|---|
secretkey | Y | This is the key that you got when you registered with CallFire.com |
callerid | Y | This is the caller id that would appear on all outbound calls |
soundFileToPlay | Y | This is the sound file that would be played when a user answers the call and to leave on the answering machine if they are unavailable |
acceptDigit | Y | The digit the user presses to start the recording process |
soundToPlayAfterAccepted | Y | Sound to be played to the user after they press a key |
phoneNumber | Y | Phone Number to call |
recordLimitSeconds | Y | This is the time in seconds for which the user can do a recording. |
Example Request
<?xml version="1.0" encoding="utf-8"?>
string
string
10
1
10
string
string
7129
Sample PHP Code
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."";
}
}
}
Sample C# Code
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)");
}
}
sendSingleCallRecordBroadcast
Creates a record campaign for broadcasting
Parameters
Parameter name | Required | Description |
---|---|---|
secretkey | Y | This is the key that you got when you registered with CallFire.com |
callerid | Y | This is the caller id that would appear on all outbound calls |
soundFileToPlay | Y | This is the sound file that would be played when a user answers the call and to leave on the answering machine if they are unavailable |
acceptDigit | Y | The digit the user presses to start the recording process |
soundToPlayAfterAccepted | Y | Sound to be played to the user after they press a key |
phoneNumber | Y | Phone Number to call |
Example Request
<?xml version="1.0" encoding="utf-8"?>
string
string
YTM0NZomIzI2OTsmIzM0NTueYQ==
1
YTM0NZomIzI2OTsmIzM0NTueYQ==
string
string
Sample PHP Code
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."";
}
}
}
Sample C# Code
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)");
}
}
sendSingleCallRecordBroadcastWithLimit
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
Parameter name | Required | Description |
---|---|---|
secretkey | Y | This is the key that you got when you registered with CallFire.com |
callerid | Y | This is the caller id that would appear on all outbound calls |
soundFileToPlay | Y | This is the sound file that would be played when a user answers the call and to leave on the answering machine if they are unavailable |
acceptDigit | Y | The digit the user presses to start the recording process |
soundToPlayAfterAccepted | Y | Sound to be played to the user after they press a key |
phoneNumber | Y | Phone Number to call |
recordLimitSeconds | Y | This is the time in seconds for which the user can do a recording. |
Example Request
<?xml version="1.0" encoding="utf-8"?>
string
string
YTM0NZomIzI2OTsmIzM0NTueYQ==
1
YTM0NZomIzI2OTsmIzM0NTueYQ==
string
string
-2497
Sample PHP Code
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."";
}
}
}
Sample C# Code
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)");
}
}
sendSingleCallRecordBroadcastWithLimitAndExtension
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
Parameter name | Required | Description |
---|---|---|
secretkey | Y | This is the key that you got when you registered with CallFire.com |
callerid | Y | This is the caller id that would appear on all outbound calls |
soundFileToPlay | Y | This is the sound file that would be played when a user answers the call and to leave on the answering machine if they are unavailable |
acceptDigit | Y | The digit the user presses to start the recording process |
soundToPlayAfterAccepted | Y | Sound to be played to the user after they press a key |
phoneNumber | Y | Phone Number to call |
extension | Y | Use an extension number |
recordLimitSeconds | Y | This is used to set a limit on the length of the recording that the users can do. (in seconds) |
Sample PHP Code
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."";
}
}
}
Sample C# Code
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)");
}
}
Sample PHP Code for an entire campaign
/*
* 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 '
Constructor error
' . $err ; } $recordid = 292601108; $params = array('secretkey' => $apiKey, 'recId' => $recordid); $result = $client->call('getRecording', $params, false, true); // Check for a fault if ($client->fault) { echo '
Fault
'; print_r($result); } else { // Check for errors $err = $client->getError(); if ($err) { // Display the error echo '
Error
' . $err; } else { // Display the result echo '
Result
'; print_r($result); } }