Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/negbie/go-baresip

Go baresip wrapper for automated SIP tests
https://github.com/negbie/go-baresip

baresip go rtp sip speech-quality test-automation voip

Last synced: 26 days ago
JSON representation

Go baresip wrapper for automated SIP tests

Awesome Lists containing this project

README

        

# go-baresip

Is a tiny wrapper around [baresip](https://github.com/baresip/baresip)
## Basic Usage

```Go
func main() {

gb, err := gobaresip.New(gobaresip.SetConfigPath("."))
if err != nil {
log.Println(err)
return
}

eChan := gb.GetEventChan()
rChan := gb.GetResponseChan()

go func() {
for {
select {
case e, ok := <-eChan:
if !ok {
continue
}
log.Println(e)
case r, ok := <-rChan:
if !ok {
continue
}
log.Println(r)
}
}
}()

go func() {
// Give baresip some time to init and register ua
time.Sleep(1 * time.Second)

if err := gb.CmdDial("012345"); err != nil {
log.Println(err)
}
}()

err = gb.Run()
if err != nil {
log.Println(err)
}
defer gb.Close()
}
```