Giter Site home page Giter Site logo

sipgo's People

Contributors

emiago avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sipgo's Issues

server recv a unrecgnized method may blocked all incoming request.

If recv a register request, but server did not found handler by method, this tx will be blocked, and server routinue blocked.

The next response will not be reponsed.

`func (srv *Server) handleRequest(req *sip.Request, tx sip.ServerTransaction) {
for _, mid := range srv.requestMiddlewares {
mid(req)
}

handler := srv.getHandler(req.Method)

if handler == nil {
	srv.log.Warn().Msg("SIP request handler not found")
	res := sip.NewResponseFromRequest(req, 405, "Method Not Allowed", nil)
	if err := srv.WriteResponse(res); err != nil {
		srv.log.Error().Msgf("respond '405 Method Not Allowed' failed: %s", err)
	}
            //. no timer trigger. or we shoud destroy this tx.
	for {
		select {
		case <-tx.Done():
			srv.log.Warn().Msgf("recv tx.Done() tx:%s", tx)
			return
		case err, ok := <-tx.Errors():
			srv.log.Warn().Msgf("recv tx.Errors() tx:%s, err:%s", tx, err)
			if !ok {
				return
			}
			srv.log.Warn().Msgf("error from SIP server transaction %s: %s", tx, err)
		}
	}
}

handler(req, tx)
if tx != nil {
	// Must be called to prevent any transaction leaks
	tx.Terminate()
}

}`

some trouble on comment

I have some trouble to understand this comment:
“Multiple readers makes problem, which can delay writing response”
Why multi UDPReadWorkers Goroutine can delay writing response?

register response start line may split by LF

Server may get sipVersion ends with LF if request start line ends with LF ranther than CRLF.
Although it's documented here. https://www.rfc-editor.org/rfc/rfc3261.html#section-7
If consider return err while startline ends with LF or CR ?
SIP/2.0 200 OK Via: SIP/2.0/UDP 192.168.10.8:60719;rport=60719;branch=z9hG4bK1377739937 From: <sip:34020000002000000719@3402000000>;tag=1534571172 To: <sip:34020000002000000719@3402000000>;tag=b70dda5e-f487-4b46-8e21-42b7c5dfcfa0 Call-ID: 1566767517 CSeq: 1 REGISTER Content-Length: 0

Client handle improvments and UDP NAT

Building client needs more features.

  • building request headers on request send (done, needs docs)
  • UDP needs to handle creating connection
  • Decouple from server handle (Default transports problem)

Examples of basic server/client

Hello,
Are there any examples available of basic server with authentication or a client ?
Besides the 2 examples that are there.

Thanks!

Generate branch optimization

Performance dropped from v0.6.0 due to forcing on generate new via branch.
sip.GenerateBranch function needs to be fixed and optimized to remove allocs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.