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
when ReadEvent in outbound, it can't get the events in real-time, all events will send on just disconnect when use linger.
if not use linger, it can't get any event at all.
// Copyright 2013 Alexandre Fiori// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.// Server that accepts connections from FreeSWITCH and controls incoming calls.package main
import (
"fmt""log""github.com/fiorix/go-eventsocket/eventsocket"
)
// const audioFile = "/opt/freeswitch/sounds/en/us/callie/misc/8000/sorry.wav"constaudioFile="/usr/share/freeswitch/sounds/music/8000/partita-no-3-in-e-major-bwv-1006-1-preludio.wav"funcmain() {
eventsocket.ListenAndServe(":9090", handler)
}
funchandler(c*eventsocket.Connection) {
fmt.Println("new client:", c.RemoteAddr())
c.Send("connect")
c.Send("myevents")
c.Send("event plain ALL")
c.Send("start_dtmf")
c.Send("linger")
c.Execute("answer", "", false)
c.Execute("playback", audioFile, true)
for {
ev, err:=c.ReadEvent()
iferr!=nil {
log.Fatal(err)
}
fmt.Println("\nNew event")
ev.PrettyPrint()
ifev.Get("Application") =="playback" {
ifev.Get("Application-Response") =="FILE PLAYED" {
c.Send("exit")
}
}
}
}
The text was updated successfully, but these errors were encountered:
when ReadEvent in outbound, it can't get the events in real-time, all events will send on just disconnect when use
linger
.if not use linger, it can't get any event at all.
The text was updated successfully, but these errors were encountered: