public function getVoiceConsumptions($service, $billingAccount, $params = null)
    {
    	$paramsString = "";
    	if (!$service)
            throw new BadMethodCallException('Parameter $service is missing.');
        if (!$billingAccount)
            throw new BadMethodCallException('Parameter $billingAccount is missing.');
        if ($params != null && is_array($params) && count($params) > 0)
        {
        	$paramsString = "?";
        	if (array_key_exists('creationDatetime.from', $params))
        	{
        		$string = $params['creationDatetime.from'];
        		if ($params['creationDatetime.from'] instanceof \Datetime)
        			$string = $params['creationDatetime.from']->format("Y-m-d\TH:i:sP");
            	$paramsString .= "creationDatetime.from=".urlencode($string);
        	}
        	if (array_key_exists('creationDatetime.to', $params))
        	{
                $paramsString .= "&"; 
        		$string = $params['creationDatetime.to'];
        		if ($params['creationDatetime.to'] instanceof \Datetime)
        			$string = $params['creationDatetime.to']->format("Y-m-d\TH:i:sP");
            	$paramsString .= "creationDatetime.to=".urlencode($string);
        	}
        	if (array_key_exists('destinationType', $params) && in_array($params['destinationType'], array('landline', 'mobile', 'special')))
            {
                $paramsString .= "&";
            	$paramsString .= "destinationType=".$params['destinationType'];
            }
        	if (array_key_exists('planType', $params) && in_array($params['planType'], array('outplan', 'priceplan')))
            {
                $paramsString .= "&";
            	$paramsString .= "planType=".$params['planType'];
            }
        	if (array_key_exists('wayType', $params) && in_array($params['wayType'], array('incoming', 'outgoing', 'transfer')))
            {
                $paramsString .= "&";
            	$paramsString .= "wayType=".$params['wayType'];
            }
        }
        try {
            $r = $this->get('telephony/' . $billingAccount->getBillingAccount() . '/service/' . $service . '/voiceConsumption' . $paramsString)->send();
        } catch (\Exception $e) {
            throw new TelephonyAccountServiceException($e->getMessage(), $e->getCode(), $e);
        }
        return $r->getBody(true);
    }
public function getVoiceConsumptions($service, $billingAccount, $params = null)
    {
    	$paramsString = "";
    	if (!$service)
            throw new BadMethodCallException('Parameter $service is missing.');
        if (!$billingAccount)
            throw new BadMethodCallException('Parameter $billingAccount is missing.');
        if ($params != null && is_array($params) && count($params) > 0)
        {
        	$paramsString = "?";
        	if (array_key_exists('creationDatetime.from', $params))
        	{
        		$string = $params['creationDatetime.from'];
        		if ($params['creationDatetime.from'] instanceof \Datetime)
        			$string = $params['creationDatetime.from']->format("Y-m-d\TH:i:sP");
            	$paramsString .= "creationDatetime.from=".urlencode($string);
        	}
        	if (array_key_exists('creationDatetime.to', $params))
        	{
                $paramsString .= "&"; 
        		$string = $params['creationDatetime.to'];
        		if ($params['creationDatetime.to'] instanceof \Datetime)
        			$string = $params['creationDatetime.to']->format("Y-m-d\TH:i:sP");
            	$paramsString .= "creationDatetime.to=".urlencode($string);
        	}
        	if (array_key_exists('destinationType', $params) && in_array($params['destinationType'], array('landline', 'mobile', 'special')))
            {
                $paramsString .= "&";
            	$paramsString .= "destinationType=".$params['destinationType'];
            }
        	if (array_key_exists('planType', $params) && in_array($params['planType'], array('outplan', 'priceplan')))
            {
                $paramsString .= "&";
            	$paramsString .= "planType=".$params['planType'];
            }
        	if (array_key_exists('wayType', $params) && in_array($params['wayType'], array('incoming', 'outgoing', 'transfer')))
            {
                $paramsString .= "&";
            	$paramsString .= "wayType=".$params['wayType'];
            }
        }
        try {
            $r = $this->get('telephony/' . $billingAccount->getBillingAccount() . '/service/' . $service . '/voiceConsumption' . $paramsString)->send();
        } catch (\Exception $e) {
            throw new TelephonyAccountServiceException($e->getMessage(), $e->getCode(), $e);
        }
        return $r->getBody(true);
    }
public function getVoiceConsumptions ( $ service , $ billingAccount , $ params = null ) { $ paramsString = "" ; if ( ! $ service ) throw new BadMethodCallException ( 'Parameter $service is missing.' ) ; if ( ! $ billingAccount ) throw new BadMethodCallException ( 'Parameter $billingAccount is missing.' ) ; if ( $ params != null && is_array ( $ params ) && count ( $ params ) > 0 ) { $ paramsString = "?" ; if ( array_key_exists ( 'creationDatetime.from' , $ params ) ) { $ string = $ params [ 'creationDatetime.from' ] ; if ( $ params [ 'creationDatetime.from' ] instanceof \ Datetime ) $ string = $ params [ 'creationDatetime.from' ] -> format ( "Y-m-d\TH:i:sP" ) ; $ paramsString .= "creationDatetime.from=" . urlencode ( $ string ) ; } if ( array_key_exists ( 'creationDatetime.to' , $ params ) ) { $ paramsString .= "&" ; $ string = $ params [ 'creationDatetime.to' ] ; if ( $ params [ 'creationDatetime.to' ] instanceof \ Datetime ) $ string = $ params [ 'creationDatetime.to' ] -> format ( "Y-m-d\TH:i:sP" ) ; $ paramsString .= "creationDatetime.to=" . urlencode ( $ string ) ; } if ( array_key_exists ( 'destinationType' , $ params ) && in_array ( $ params [ 'destinationType' ] , array ( 'landline' , 'mobile' , 'special' ) ) ) { $ paramsString .= "&" ; $ paramsString .= "destinationType=" . $ params [ 'destinationType' ] ; } if ( array_key_exists ( 'planType' , $ params ) && in_array ( $ params [ 'planType' ] , array ( 'outplan' , 'priceplan' ) ) ) { $ paramsString .= "&" ; $ paramsString .= "planType=" . $ params [ 'planType' ] ; } if ( array_key_exists ( 'wayType' , $ params ) && in_array ( $ params [ 'wayType' ] , array ( 'incoming' , 'outgoing' , 'transfer' ) ) ) { $ paramsString .= "&" ; $ paramsString .= "wayType=" . $ params [ 'wayType' ] ; } } try { $ r = $ this -> get ( 'telephony/' . $ billingAccount -> getBillingAccount ( ) . '/service/' . $ service . '/voiceConsumption' . $ paramsString ) -> send ( ) ; } catch ( \ Exception $ e ) { throw new TelephonyAccountServiceException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } return $ r -> getBody ( true ) ; }
Get Telephony account service voice consumptions.

@param string $service
@param Telephony $billingAccount
@return string Json
@throws Exception\TelephonyAccountServiceException
@throws BadMethodCallException
Get Telephony account service voice consumptions .