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.
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:
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.