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

Possible async events not handle. #22

Open
lmendes86 opened this issue Sep 16, 2019 · 0 comments
Open

Possible async events not handle. #22

lmendes86 opened this issue Sep 16, 2019 · 0 comments

Comments

@lmendes86
Copy link

In this function (

func requestList(client Client, action, id, event, complete string, v ...interface{}) ([]Response, error) {
) you are expecting that the next events after the action sent will we the ones related with that action, which could be not true: "At its heart, AMI is an asynchronous message bus: it spills events that contain information about the Asterisk system over some transport. In response, clients may request that Asterisk takes some action. These two concepts - actions and events - make up the core of what is AMI. As AMI is asynchronous, as events occur in Asterisk they are immediately sent to the clients. This means that actions issued by entities happen without any synchronization with the events being received, even if those events occur in response to an action. It is the responsibility of entities to associate event responses back to actions."

You should add that if the id of the event received is not equals to the one you sent in the action then discard the event as a response to that specific action.

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

Successfully merging a pull request may close this issue.

1 participant