Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

sipgo

> 编程语言
Open source

SIP library for writing fast SIP services in GO

1.1K stars0 likes1 views
WebsiteGitHub

About

SIP library for writing fast SIP services in GO

SIPGO is library for writing fast SIP services in GO language.
It comes with SIP stack (RFC 3261|RFC3581|RFC6026) optimized for fast parsing.

Libs on top of sipgo:

  • Diago github.com/emiago/diago: Full VOIP library/framework with media stack (Active development)

Tools developed on top:

  • Gophone github.com/emiago/gophone CLI softphone for easy testing

Fetch lib with:

go get github.com/emiago/sipgo

If you like/use project currently and looking for support/sponsoring checkout Support section

You can follow on X/Twitter for more updates.

More on documentation you can find on Go doc

Supported protocols

  • UDP
  • TCP
  • TLS
  • WS
  • WSS

RFC:

  • RFC3261
  • RFC3263
  • RFC3581
  • RFC6026

State of Torture Tests RFC4475 you can find on issue github.com/emiago/sipgo/issues/57 but NOTE: some strict validation things may be seperated from parsing or not built into library.

Examples

  • Stateful proxy example/proxysip
  • Register with authentication example/register
  • Call and media with diago examples diago/examples

Also thanks to pion project sharing this example of using SIPgo with webrtc:

  • https://github.com/pion/example-webrtc-applications/tree/master/sip-to-webrtc original post on X

Performance

SIPgo was proven that can excel in performance compared to some other configured base proxy solutions.

As an example, you can find example/proxysip as simple version of statefull proxy. It is used for stress testing with sipp. To find out more about performance check the latest results:
example/proxysip

Usage

Lib allows you to write easily sip servers, clients, stateful proxies, registrars or any sip routing. Writing in GO we are not limited to handle SIP requests/responses in many ways, or to integrate and scale with any external services (databases, caches...).

UAS/UAC build

Using server or client handle for UA you can build incoming or outgoing requests.

…

go client, _ := sipgo.NewClient(ua) // Creating client handle req := sip.NewRequest(sip.ACK, sip.Uri{User:"bob", Host: "example.com"}) // Send request and forget client.WriteRequest(req)

…

go ua, _ := sipgo.NewUA() // Build user agent srv, _ := sipgo.NewServer(ua) // Creating server handle client, _ := sipgo.NewClient(ua) // Creating client handle

contactHDR := sip.ContactHeader{ Address: sip.Uri{User: "test", Host: "127.0.0.200", Port: 5088}, } dialogCli := sipgo.NewDialogClientCache(client, contactHDR)

// Attach Bye handling for dialog srv.OnBye(func(req *sip.Request, tx sip.ServerTransaction) { err := dialogCli.ReadBye(req, tx) //handle error })

// Create dialog session dialog, err := dialogCli.Invite(ctx, recipientURI, nil) defer dialog.Close() // Cleans up from dialog pool // Wait for answer err = dialog.WaitAnswer(ctx, AnswerOptions{}) // Check dialog response dialog.InviteResponse (SDP) and return ACK err = dialog.Ack(ctx) // Send BYE to terminate call err = dialog.Bye(ctx)


**UAS**:
```go
ua, _ := sipgo.NewUA() // Build user agent
srv, _ := sipgo.NewServer(ua) // Creating server handle
client, _ := sipgo.NewClient(ua) // Creating client handle

uasContact := sip.ContactHeader{
    Address: sip.Uri{User: "test", Host: "127.0.0.200", Port: 5099},
}
dialogSrv := sipgo.NewDialogServerCache(client, uasContact)

srv.OnInvite(func(req *sip.Request, tx sip.ServerTransaction) {
    dlg, err := dialogSrv.ReadInvite(req, tx)
    if err != nil {
        return err
    }
    defer dlg.Close() // Close for cleanup from cache
    // handle error
    dlg.Respond(sip.StatusTrying, "Trying", nil)
    dlg.Respond(sip.StatusOK, "OK", nil)
    
    // Instead Done also dlg.State() can be used for granular state checking
    
Call-ID: [email protected]
From: "sipp" ;tag=1SIPpTag001
To: "uac" 
CSeq: 1 INVITE
Server: Asterisk PBX 18.16.0
Content-Length:  0

Support

If you find this project interesting for bigger support or consulting, you can contact me on mail

For bugs features pls create issue.

Extra

E2E/integration testing

If you are interested using lib for your testing services then checkout article on how easy you can make calls and other

Tests

Library will be covered with more tests. Focus is more on benchmarking currently.

go test ./...  

Credits

This project was influenced by gosip, project by @ghetovoice, but started as new project to achieve best/better performance and to improve API. This unfortunately required many design changes, therefore this libraries are not compatible.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Go

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言