Skip to content

Event not fired #31

Description

@byphone

Hi,

I use the code provided in examples

            $channel->onChannelDtmfReceived(function (ChannelDtmfReceived $event) {
                $this->log("Got digit: {$event->getDigit()}");
            });

but events seems not be fired, however i can in asterisk cli ari debug see that event is sent.

To have to the code that works, i need to add use ($channel) as :

                $channel->onChannelDtmfReceived(function (ChannelDtmfReceived $event) use ($channel) {
                $this->log("Got digit: {$event->getDigit()}");
                });

I don't understand why

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions