You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am using PAMI to get Asterisk Manager Events. please see my code below. I wanted to get $event->getDialStatus() = 'ANSWER' of Dial Event and as i get result disconnect the Asterisk Manager and read the remaining code. Thanks.
'127.0.0.1',
'scheme' => 'tcp://',
'port' => 5038,
'username' => 'ncs',
'secret' => 'ncs',
'connect_timeout' => 10000,
'read_timeout' => 10000
);
$pamiClient = new PamiClient($pamiClientOptions);
// Open the connection
$pamiClient->open();
use PAMI\Message\Event\EventMessage;
use PAMI\Message\Event\DialEvent;
$pamiClient->registerEventListener(function (EventMessage $event) {
print_r($event);
},
function ($event) {
```
$re = $event instanceof DialEvent && $event->getDialStatus() = 'ANSWER';
```
if ($re){
echo "Found Event\n";
}
}
);
$running = true;
while($running) {
$pamiClient->process();
usleep(1000);
}
// Close the connection
# $pamiClient->close();
echo "Code Ended>>>>>>>>>>>>>>>>>>> Read This Line\n";
?>
The text was updated successfully, but these errors were encountered:
Will not do what you want (you should be comparing with at least two equal signs, otherwise you're just trying to assign a value to a function call and that doesn't make any sense).
I'm closing this one. Please reopen it with a better explanation of the issue, logs of the output in the console for php and asterisk.
Hi,
'127.0.0.1', 'scheme' => 'tcp://', 'port' => 5038, 'username' => 'ncs', 'secret' => 'ncs', 'connect_timeout' => 10000, 'read_timeout' => 10000 ); $pamiClient = new PamiClient($pamiClientOptions); // Open the connection $pamiClient->open(); use PAMI\Message\Event\EventMessage; use PAMI\Message\Event\DialEvent; $pamiClient->registerEventListener(function (EventMessage $event) { print_r($event); }, function ($event) { ``` $re = $event instanceof DialEvent && $event->getDialStatus() = 'ANSWER'; ``` if ($re){ echo "Found Event\n"; } } ); $running = true; while($running) { $pamiClient->process(); usleep(1000); } // Close the connection # $pamiClient->close(); echo "Code Ended>>>>>>>>>>>>>>>>>>> Read This Line\n"; ?>I am using PAMI to get Asterisk Manager Events. please see my code below. I wanted to get $event->getDialStatus() = 'ANSWER' of Dial Event and as i get result disconnect the Asterisk Manager and read the remaining code. Thanks.
The text was updated successfully, but these errors were encountered: