don't work playback
Opened this issue · 1 comments
Hi!
playback is dont't work
help me
Code
package main
import (
"fmt"
"log"
"github.com/fiorix/go-eventsocket/eventsocket"
)
const dest = "sofia/internal/303%test.fs"
const dialplan = "&socket(localhost:9090 async)"
func answer (ac *eventsocket.Connection) {
ac.Execute("answer", "", false)
ac.Execute("playback", "/usr/local/freeswitch/sounds/24Broadcaster.wav", false)
}
func main() {
c, err := eventsocket.Dial("localhost:8021", "ClueCon")
if err != nil {
log.Fatal(err)
}
c.Send("events plain ALL")
c.Send(fmt.Sprintf("bgapi originate %s %s", dest, dialplan))
for {
ev, err := c.ReadEvent()
if err != nil {
log.Fatal(err)
}
fmt.Println("\nNew event")
ev.PrettyPrint()
var hangup_cause string
if ev.Get("Event-Name") == "CHANNEL_ANSWER" {
fmt.Println("Клиент ответил")
go answer(c);
return
} else if ev.Get("Answer-State") == "hangup" {
hangup_cause = ev.Get("Hangup-Cause")
fmt.Println(hangup_cause)
return
}
}
c.Close()
}
Your best bet is to check the freeswitch logs. Very likely that freeswitch itself cannot access the file you're trying to playback.