<?php
namespace App\Http\Controllers\Api\V2;
use AlibabaCloud\Client\AlibabaCloud;
use AlibabaCloud\Client\Exception\ClientException;
use Alibabaloud\Client\Exception\ServerException;

/**
 * 废弃！
 * Class PhoneCallController
 * @package App\Http\Controllers\Api\V2
 */
class PhoneCallController extends Controller
{
    public function BindAxb($phone1='',$phone2='',$data=[]){

        $config = config('config.axb');
        AlibabaCloud::accessKeyClient($config['appid'], $config['appscret'])
            ->regionId('cn-kunming')
            ->asDefaultClient();
        try {
            $result = AlibabaCloud::rpc()
                ->product('Dyplsapi')
                ->version('2017-05-25')
                ->action('BindAxb')
                ->method('POST')
                ->host('dyplsapi.aliyuncs.com')
                ->options([
                    'query' => [
                        "Expiration" => "2020-11-25 12:00:00",
                        'RegionId' => "cn-kunming",
                        'PhoneNoA' => "18831125321",
                        'PhoneNoB' => "18830277213",
                    ],
                ])
                ->request();
            print_r($result->toArray());
        } catch (ClientException $e) {
            echo $e->getErrorMessage() . PHP_EOL;
        } catch (ServerException $e) {
            echo $e->getErrorMessage() . PHP_EOL;
        }
    }




}

?>
