This service provides you with the capability to purchase an inbound number or forward your calls to a number.

WSDL

http://www.callfire.com/service/InboundService?wsdl

Methods

purchaseSingleNumber

Use this function to purchase a single Inbound Number.

Parameters

Parameter name Required Description
apiKey Y The API key that is registered with your account
numbers Y The number that you wish to purchase

Sample PHP Code

public function purchaseSingleNumber($apiKey,$number,$debug)
{
	$createOtboundcampaignWsdl = 'http://www.callfire.com/service/InboundService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));
		
	$purchaseparams = array(
  		'apiKey' => $apiKey,
	'number' => $number
	);
		
	try
	{
		$purchaseSingleNumberResponse = $campaignOutboundClient->purchaseSingleNumber($purchaseparams);
		$campaignId = $purchaseSingleNumberResponse->out;
		if($debug)
		{
			echo "Purchase Status :: ".$campaignId;

		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public string purchaseSingleNumber(string apiKey, string number)
{
    //LOG.Info("Entered purchaseSingleNumber(string apiKey, string number)");
    try
    {
        string purchaseNumberResponse = this.inboundService.purchaseSingleNumber(apiKey, number);
        return purchaseNumberResponse;
    }
    catch (Exception e)
    {
        string msg = "Unable to purchaseSingleNumber";
        LOG.Error(msg);
        throw new InboundServiceException(msg, e);
    }
    finally
    {
        //LOG.Info("Exited purchaseSingleNumber(string apiKey, string number)");
    }
}

forwardSingleNumber

Parameters

Parameter name Required Description
apiKey Y The API key that is registered with your account
publicNumber Y When somebody calls this number, your call gets forwarded to the source number that you specify
sourceNumber Y The number that the call gets forwarded to
recording Y This is the recording file that would be played
recordFlag Y Set this to true if you want a recording to be played when the call gets forwarded

Sample PHP Code

public function forwardSingleNumber($apiKey,$publicNumber,$sourceNumber,$recording,$recordFlag,$debug)
{
	$createOtboundcampaignWsdl = 'http://www.callfire.com/service/InboundService?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));


	$handle = fopen($recording,'r');
	$contents = fread($handle,filesize($recording));
	$rec = $contents;

	$createcampaign = array(
  		'apiKey' => $apiKey,
	'publicNumber' => $publicNumber,
	'sourceNumber' => $sourceNumber,
	'recording' => $rec,
	'recordFlag' => $recordFlag

	);
	try
	{
		$createUserRespopnse = $campaignOutboundClient->forwardSingleNumber($createcampaign);
		$campaignId = $createUserRespopnse->out;
		if($debug)
		{
			print_r($campaignId);
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public string forwardSingleNumber(string apiKey, string publicNumber, string sourceNumber, byte[] recording, Boolean recordFlag)
{
    //LOG.Info("Entered forwardSingleNumber(string apiKey, string publicNumber, string sourceNumber, byte[] recording, Boolean recordFlag)");
    try
    {
        string forwardSingleNumberResponse = this.inboundService.forwardSingleNumber(apiKey, publicNumber, sourceNumber, recording, recordFlag);
        return forwardSingleNumberResponse;
    }
    catch (Exception e)
    {
        string msg = "Unable to forward single number";
        LOG.Error(msg);
        throw new InboundServiceException(msg, e);
    }
    finally
    {
        //LOG.Info("Exited forwardSingleNumber(string apiKey, string publicNumber, string sourceNumber, byte[] recording, Boolean recordFlag)");
    }
}