Use the AloTech PHP API.
$ composer require samiaraboglu/alotech-api-bundle
Registered bundles in the app/AppKernel.php
file of your project:
<?php
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new Samiax\AloTechApiBundle\SamiaxAloTechApiBundle(),
);
// ...
}
// ...
}
Add this to config.yml:
samiax_alo_tech_api:
username: "{USERNAME}"
app_token: "{APP_TOKEN}"
/**
* @Route("/alotech/click2/call", name="alotech/click2/call")
*/
public function callAction(Request $request)
{
$service = $this->get('samiax_alo_tech_api.alotech');
$service->login('{EMAIL}');
$service->click2->call([
'phonenumber' => '{PHONE_NUMBER}',
'hangup_url' => '{YOUR_HANGUP_URL}'
]);
return new Response();
}