Comments (4)
Hey @danieldonoghue, cool, thanks for your contribution, I will test and merge in this week
from go-sip-ua.
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.
I created a pull request addressing these issues... #73
from go-sip-ua.
PR merged
from go-sip-ua.
Related Issues (20)
- Make log level configurable
- bug:ua的confirm在外呼的时候如果407了会触发两次
- Dependency Dashboard
- Looking forward to your finish webrtc2sip gateway HOT 1
- Question about sip to webrtc HOT 1
- I got a error,can someone help me?
- Dialogs/sessions completely broken because of wrong sessionkey HOT 16
- <nil> Route headers added to request
- how to disable verify server certificate HOT 1
- Could this library support method Message?
- register example - Request Timeout HOT 2
- Client example-the example couldn't send voice to other UAC HOT 1
- ua.go 中的 handleBye 无法触发 Terminated HOT 3
- 注册问题
- Persistent CallID
- Q: idea for Google dialogflow phone gateway
- Example UA sends SIP BYE HOT 2
- bug:不能仅仅用callID和fromTag来获取session HOT 2
- Add "rport" in via to support NAT. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-sip-ua.