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

Fix channel status result #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix channel status response
Janis Stukmanis committed Mar 15, 2024
commit 7a6c76ac1c7521eb0482b7b06756475e07125d9a
6 changes: 3 additions & 3 deletions agi.go
Original file line number Diff line number Diff line change
@@ -82,8 +82,8 @@ type Response struct {
}

// Res returns the ResultString of a Response, as well as any error encountered. Depending on the command, this is sometimes more useful than Val()
func (r *Response) Res() (string,error) {
return r.ResultString, r.Error
func (r *Response) Res() (string, error) {
return r.ResultString, r.Error
}

// Err returns the error value from the response
@@ -299,7 +299,7 @@ func (a *AGI) Answer() error {

// Status returns the channel status
func (a *AGI) Status() (State, error) {
r, err := a.Command("CHANNEL STATUS").Val()
r, err := a.Command("CHANNEL STATUS").Res()
if err != nil {
return StateDown, err
}