Code Monkey home page Code Monkey logo

Comments (4)

cloudwebrtc avatar cloudwebrtc commented on August 23, 2024 1

Hey @danieldonoghue, cool, thanks for your contribution, I will test and merge in this week

from go-sip-ua.

danieldonoghue avatar danieldonoghue commented on August 23, 2024

I propose a small change to handleInvite() to check the "to" tag before setting the state to reinvite. You could leave everything else treated as new new invite with further processing in the caller's inviteHandler but I don't know whether that would have knock on implications anywhere in your package..

callID, ok := request.CallID()
if ok {
	var transaction sip.Transaction = tx.(sip.Transaction)
	v, found := ua.iss.Load(*callID)
	if request.To().Params().Has("tag") {
		if found {
			is := v.(*session.Session)
			is.SetState(session.ReInviteReceived)
			ua.handleInviteState(is, &request, nil, session.ReInviteReceived, &transaction)
		} else {
			// some equivalent to: is.Reject(sip.StatusCode(481), "Call/Transaction does not exist")
		}
	} else {
		contact, _ := request.Contact()
		is := session.NewInviteSession(ua.RequestWithContext, "UAS", contact, request, *callID, transaction, session.Incoming, ua.Log())
		ua.iss.Store(*callID, is)
		is.SetState(session.InviteReceived)
		ua.handleInviteState(is, &request, nil, session.InviteReceived, &transaction)
		is.SetState(session.WaitingForAnswer)
	}
}

note this still doesn't take into account multiple branches, which might require a change to the key for the session store to include a branch id

from go-sip-ua.

danieldonoghue avatar danieldonoghue commented on August 23, 2024

I created a pull request addressing these issues... #73

from go-sip-ua.

danieldonoghue avatar danieldonoghue commented on August 23, 2024

PR merged

from go-sip-ua.

Related Issues (20)

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.