Answer the question
In order to leave comments, you need to log in
What's wrong with Originate?
There was a need to create a callback form on the company's websites.
For implementation, we decided to use the Originate command for our Asterisk.
I asked the admin to create an AMI user and upload data for the Originate command.
For example, a client with the number
89111234567 submitted a form and is waiting for a call from a manager with an extension of 1234
require_once "./vendor/autoload.php";
$options = [
'host' => 'asterisk_host',
'scheme' => 'tcp://',
'port' => 5038,
'username' => 'username',
'secret' => 'secret',
'connect_timeout' => 15000,
'read_timeout' => 15000
];
$ami = new \PAMI\Client\Impl\ClientImpl($options);
$originate = new \PAMI\Message\Action\OriginateAction('Local/[email protected]');
$originate->setCallerId('89111234567');
$originate->setContext('from-office');
$originate->setExtension('89111234567');
$originate->setTimeout(15000);
$originate->setPriority(1);
$originate->setAsync(false);
$message = $ami->send($originate);
if($message->isSuccess()){
//
}else{
//
}
Answer the question
In order to leave comments, you need to log in
Most likely, the problem lies in the incorrectly specified channel - the local channel is simply not able to go somewhere outside the Asterisk, so external calls do not work, but internal ones go.
Usually the channel looks like "SIP/#FROM#".
I didn’t understand why the answer was deleted ....
Let the admin remove the full call logs (sip set debug on or TCP dump).
Then look for at what point it breaks and by whom the break was made.
It's just that no one is dumping anyone.
If the operator (yours or the client) does not miss the call, then he does not like something.
Perhaps just the same callerdid goes to both channels the same, and the operator (client) does not miss such a call (it turns out that the client calls himself).
It is also possible that the operator (which provides you with a connection) forbids setting any callerid, because this is actually from the category of semi-VIP functions.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question