You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remnantseed 8f3d40ee55 add readme 2 months ago
README.md add readme 2 months ago
go.mod a Go PJSIP 2.10 wrapper, for Linux, generated using Swig 4.0.1 on Debian 9 2 months ago
go.sum a Go PJSIP 2.10 wrapper, for Linux, generated using Swig 4.0.1 on Debian 9 2 months ago
pjsua2.go a Go PJSIP 2.10 wrapper, for Linux, generated using Swig 4.0.1 on Debian 9 2 months ago
pjsua2_lib.go a Go PJSIP 2.10 wrapper, for Linux, generated using Swig 4.0.1 on Debian 9 2 months ago
pjsua2_solib.go a Go PJSIP 2.10 wrapper, for Linux, generated using Swig 4.0.1 on Debian 9 2 months ago
pjsua2_wrap.cxx a Go PJSIP 2.10 wrapper, for Linux, generated using Swig 4.0.1 on Debian 9 2 months ago
pjsua2_wrap.h a Go PJSIP 2.10 wrapper, for Linux, generated using Swig 4.0.1 on Debian 9 2 months ago

README.md

How to Generate

swig -c++ -go -cgo -intgosize 64 \
    -outcurrentdir \
    -I/usr/local/include \
    ${PJPATH}/pjsip-apps/src/swig/pjsua2.i

How to Use

import pjsua2 "git.rucciva.one/edbertwi/go-pjsua2"

func main() {
	// ...

	// Set outbound proxy
	strVector := pjsua2.NewStringVector()
	strVector.Add("sip:" + cfg.Outbound)
	uaCfg := pjsua2.NewUaConfig()
	uaCfg.SetOutboundProxies(strVector)
	uaCfg.SetMaxCalls(cfg.MaxCalls)

	// Set endpoint config
	epCfg := pjsua2.NewEpConfig()
	epCfg.SetUaConfig(uaCfg)

	ep := pjsua2.NewEndpoint()
	ep.LibCreate()
	ep.LibInit(epCfg)
	ep.AudDevManager().SetNullDev()

	// Start the library
	ep.LibStart()

	// ...
}