Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAMI Disconnect‏ #76

Closed
qasimkhans opened this issue Jun 19, 2015 · 1 comment
Closed

PAMI Disconnect‏ #76

qasimkhans opened this issue Jun 19, 2015 · 1 comment

Comments

@qasimkhans
Copy link

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"; ?>
@marcelog
Copy link
Owner

Sorry but I don't really understand the issue or question. What I can see is that

$re = $event instanceof DialEvent && $event->getDialStatus() = 'ANSWER';

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.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants