-
Notifications
You must be signed in to change notification settings - Fork 4
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
New client is skipping small events and errors on big events #7
Comments
@halsbox thanks for reporting this and sorry for delay |
@staskobzar Hi!
|
@halsbox the fix is just read till "\r\n\r\n" and then returns the packet. |
@staskobzar |
I did a lot of experimenting on this, playing with different buf sizes from very small to huge and also different asterisk versions from 14.x to 20.x and came to conclusion that you either have to read from connection in portions and then split on |
@halsbox I see what you mean |
To be clear, I mean that every AMI Message is terminated with "\r\n\r\n", but when reading from connection with |
One more thing I'd like to share: |
@halsbox thanks, I will keep in mind |
there is new v1.7.4 release where I have tried to fix all we have discussed here. |
In this fragment if AMI event is larger than buf, you'll get "too long input" error.
In my case AMI messages are going continuously and often
conn.Read(buf)
reads the whole AMI message together with the beginning of the next AMI message, so there is no "\r\n\r\n" in the end of packet value and finally function errors with "too long input" in next loop.The text was updated successfully, but these errors were encountered: