Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

503 response when using $plivo->lookup before $plivo->verifySessions #353

Open
ambitionphp opened this issue Nov 7, 2024 · 0 comments
Open

Comments

@ambitionphp
Copy link

I received a 503 response from $plivo->verifySessions when using $plivo->lookup before $plivo->verifySessions. After debugging everything within my logic, I pulled in a colleague, and he discovered the issue.

$plivo = app(RestClient::class);
$plivo->client->setTimeout(40);

$response1 = $plivo->lookup->get('+15555555555');
...
$response2 = $plivo->verifySessions->create(
    '+15555555555',
    [
        'channel' => 'sms',
        'app_uuid' => 'xxxxx'
    ]
);

$response2 throws an exception, error message is an html 503 response

$plivo = app(RestClient::class);
$plivo->client->setTimeout(40);

$response1 = $plivo->lookup->get('+15555555555');
...
$plivo = app(RestClient::class);
$plivo->client->setTimeout(40);

$response2 = $plivo->verifySessions->create(
    '+15555555555',
    [
        'channel' => 'sms',
        'app_uuid' => 'xxxxx'
    ]
);

$response2 throws an exception, error message is an html 503 response

use Plivo\BaseClient;

$plivo = app(RestClient::class);
$plivo->client->setTimeout(40);

$response1 = $plivo->lookup->get('+15555555555');
...
BaseClient::$isLookupRequest = false;

$response2 = $plivo->verifySessions->create(
    '+15555555555',
    [
        'channel' => 'sms',
        'app_uuid' => 'xxxxx'
    ]
);

This works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant