Skip to content

requests are made not accordingly to Asterisk documentation #33

Description

@pietrobaricco

So far I've tried Channels::createChannel, which expects the body to be passed as a Json object, but the library passes urlencoded values. As a result, variables are not set.

This works:

$response = $this->client->getEndpoint()->post($uri, [
                    \GuzzleHttp\RequestOptions::JSON => [
                        'endpoint' => $endpoint,
                        'extension' => $extension,
                        'context' => $context,
                        'priority' => $priority,
                        'label' => $label,
                        'app' => $app,
                        'appArgs' => $appArgs,
                        'callerId' => $callerId,
                        'timeout' => $timeout,
                        'channelId' => $channelId,
                        'otherChannelId' => $otherChannelId,
                        'formats' => $formats,
                        'variables' => array_map('strval', $variables)
                    ]
            ]);

Another thing is for instance the Channels::setVariable method, which by Asterisk doc does not return a variable, but just a HTTP status. As a result, setting a variable with the API generates a json decoding exception.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions