plivo / plivo-php

Plivo PHP Helper Library
http://www.plivo.com
MIT License
110 stars 117 forks source link

Cannot use RestClient and PhloRestClient Together #314

Open vikram-saini opened 1 year ago

vikram-saini commented 1 year ago

We have an issue where we sending calls to the BrowserSDK. To do this successfully, we need to first check the status of the agent using the RestClient Endpoint method and then run our PHLO app.

For some reason we are unable to do this as the PhloRestClient refuses to work after using the RestClient. Things we have tried:

`require $code_path.'/plivo/vendor/autoload.php'; use Plivo\XML\Response; use Plivo\RestClient; $response = new Response(); $auth_id = ''; $auth_token = ''; $api = new RestClient($auth_id, $auth_token); use Plivo\Resources\PHLO\PhloRestClient; use Plivo\Exceptions\PlivoRestException; $client = new PhloRestClient($auth_id, $auth_token);

$getEndPointDetails = $api->endpoints->get( '<endpoint>' );
//print_r($getEndPointDetails->); echo '<hr />';

$client = new PhloRestClient($auth_id, $auth_token);

try {
    $response = $client->phlo->getPhlo("359193c3-ce97-4a81-8d67-64a2bcf99507");
    print_r($response);
} catch (PlivoRestException $ex) {
    print_r($ex);
}`

Any help will be appreciated.