public function transfer($liveCallUuid, array $optionalArgs = [])
    {

        if (empty($liveCallUuid)) {
            throw new PlivoValidationException(
                "Which call to transfer? No callUuid given");
        }

        if (isset($optionalArgs['legs'])) 
        {
            switch ($optionalArgs['legs']) {
                case 'aleg':
                    if (!isset($optionalArgs['aleg_url'])) {
                        throw new PlivoValidationException(
                            "alegUrl is mandatory"
                        );
                    }
                    break;
                case 'bleg':
                    if (!isset($optionalArgs['bleg_url'])) {
                        throw new PlivoValidationException(
                            "blegUrl is mandatory"
                        );
                    }
                    break;
                case 'both':
                    if (!(isset($optionalArgs['aleg_url']) &&
                          isset($optionalArgs['bleg_url']))) {
                        throw new PlivoValidationException(
                            "alegUrl and blegUrl are mandatory"
                        );
                    }
                    break;
                default:
                    throw new PlivoValidationException(
                        "Only aleg, bleg or both are allowed"
                    );
            }
        } else {
            throw new PlivoValidationException(
                "default is aleg, hence alegUrl is mandatory"
            );
        }

        $response = $this->client->update(
            $this->uri . $liveCallUuid . '/',
            $optionalArgs
        );

        $responseContents = $response->getContent();

        if(!array_key_exists("error",$responseContents)){
            return new ResponseUpdate(
                $responseContents['api_id'],
                $responseContents['message'],
                $response->getStatusCode()
            );
        } else {
            throw new PlivoResponseException(
                $responseContents['error'],
                0,
                null,
                $response->getContent(),
                $response->getStatusCode()

            );
        }

        
    }