CyCoreSystems / ari

Golang Asterisk REST Interface (ARI) library
Apache License 2.0
180 stars 74 forks source link

User event application #139

Closed goharahmed closed 1 year ago

goharahmed commented 1 year ago

Allows ARI to trigger AMI layer userevent. Please provide feedback. Changes corresponding to this in ari-proxy to be followed shortly in the respective repository.

Thank you.

Ref: https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Events+REST+API#Asterisk18EventsRESTAPI-userEvent


This change is Reviewable

Ulexus commented 1 year ago

Nice, thanks!

Ulexus commented 1 year ago

It looks like you're failing the linter with formatting issues. Can you be sure to run through gofumpt?

goharahmed commented 1 year ago

Thank you so much for quick review. Its linted by VSCode, as Im not familiar with gofumpt
Do you want me to run this: gofumpt -l -w . from this library: https://github.com/mvdan/gofumpt

Ulexus commented 1 year ago

Closer; (hint: you can run golangci-lint run ./... locally to shorten the dev-check loop)

Ulexus commented 1 year ago

Also: https://golangci-lint.run/usage/integrations/

goharahmed commented 1 year ago

@Ulexus seems my changes are acceptable but there is an unchanged file having some string.Title() problem. Do you want me to fix that as well or leave it ?

Ulexus commented 1 year ago

Ah, I see; it must be a newer linter restriction since the last commit. If you don't mind fixing it here, that would be great.

goharahmed commented 1 year ago

Let me see as how to fix it :)

Ulexus commented 1 year ago

Should just be to replace with https://pkg.go.dev/golang.org/x/text/cases#Title

goharahmed commented 1 year ago

@Ulexus - I think all set, I was reading about the "Language.Und" and I don't fully comprehend what could the "x" string possible values and if the Undisclosed language rules will make it work or not. Anways, the PR related to ari-proxy is ready but waiting for the main ari package to show the UserEvent implementation

s.ari.Channel().UserEvent undefined (type ari.Channel has no field or method UserEvent)

Once this PR is closed I'll submit the next one.

Ulexus commented 1 year ago

Hmm... it looks like there's a mess of additional linter errors after that one. I'm going to go ahead and merge this and then fix the rest myself before tagging the next release.

Thanks for your submission!

Ulexus commented 1 year ago

Tagged v5.3.0 with this feature, @goharahmed