You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to connect with Asterisk AMI interface using goAMI. I am sequentially calling, connect, originate and logoff functions. All looks fine but i face strange behavior with logoff function.
If I call the script and call ami.logoff() function for first time it will return the nil value which seems fine. When I call the same script for the second time, this functions return expected.
Code block
res := ami.Logoff(socket, uuid)
if res == nil {
println("Logoff successful", res)
} else {
println("Logoff failed", res)
}
Output when calling the same script for two times.
$ go run main.go
Logoff successful (0x0,0x0)
$ go run main.go
Logoff failed (0x114ca00,0xc000012070)
Asterisk version: 11.25.3
OS: CentOS 7.4
The text was updated successfully, but these errors were encountered:
I was having this same issue! I forked the repo locally and changed the Socket.go file. I updated the socket's "incoming" chan to be un-buffered by removing the size parameter. This allows for the Recv function to be able to finish reading s.incoming when the TCP connection is closed (instead of raising an EOF error).
s := &Socket{
...
incoming: make(chan string),
...
}
Hello, the issue should be resolved in PR #31, which is awaiting approval.
The source of the problem is in the "send" function, which does not wait for the response to the "action-id" of the command. When the Logout command is executed, AMI sends event messages. depending on the order in which those events are received the error will occur
I'm trying to connect with Asterisk AMI interface using goAMI. I am sequentially calling, connect, originate and logoff functions. All looks fine but i face strange behavior with logoff function.
If I call the script and call ami.logoff() function for first time it will return the nil value which seems fine. When I call the same script for the second time, this functions return expected.
Code block
Output when calling the same script for two times.
$ go run main.go
Logoff successful (0x0,0x0)
$ go run main.go
Logoff failed (0x114ca00,0xc000012070)
Asterisk version: 11.25.3
OS: CentOS 7.4
The text was updated successfully, but these errors were encountered: