-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sip Dialog terminating mid call #59
Comments
@half2me thanks for reporting. Timeout you are facing is actually just transaction timeout and should have nothing with dialog.
dialog will be managed and have proper ACK and BYE handled. So this just indicates that transaction handler is done but not dialog. Dialog is done when BYE is received, or this line specifically. _ = dialogSrv.ReadBye(req, tx) After you send 200 OK, your call should be still handled and managed by dialog, but you normally do not want to terminate transaction too early (State handling transaction, resending) so therefore it is recomended to keep transaction open with
and let either dialog terminates or timeout (64 * T1 = 30 seconds). I also see some issue of misuse, or maybe I am missing some docs here. What could help maybe that dialog wraps What are some features that maybe I am still in research is that you have dialog monitoring. This could make sense for you use case, but maybe I am wrong?
|
Basically I need to clean up some resources when a call ends. This could happen when I receive BYE, but this message could also never arrive, such is the nature of UDP. How will I know the call is finished? |
@half2me Yes I see.
True, this is now required some timeout handling + maybe keep alive over SIP. So here I what I see that is missing srv.OnInvite(func(req *sip.Request, tx sip.ServerTransaction) {
dlg, err := dialogSrv.ReadInvite(req, tx)
...
_ = dlg.Respond(sip.StatusOK, "OK", sdpResp, sip.NewHeader("Content-Type", "application/sdp"))
<-tx.Done()
fmt.Printf("DIALOG DONE!!!\n")
})
dialogSrv.OnDialog(func(d DialogServerSession) {
// Dialog created on 200 OK
select {
case <-d.Done():
// Bye Received from UAC
case <-time.After(3 *time.Second):
d.Bye()
}
// Do some after dialog cleanup
}) |
@half2me you can also checkout how this is handled. If you can ignore all other. Basically I used seperate channel to draw out dialogServerSession and wrapped some done channel to signal when Bye is received. So there is some design missing currently |
@half2me I have added Check main branch dlg, err := dialogSrv.ReadInvite(req, tx)
...
<-dlg.Done()
fmt.Printf("DIALOG DONE!!!\n") Also I noticed sometimes cleanup is hard to achieve due to many actions to take. Which will trigger Pls provide some feedback after checking this |
For now dialog control should be enough with new calls. Clossing this issue |
I have had success using the new dialogue server. I used the examples and added my own logic to properly respond to the SDP offer sent in the INVITE. The parts that are working are the dialogue starting when the call starts after the INVITE, and the dialogue properly stops when receiving BYE. My issue is if the call is longer than 30sec, the dialogue also just stops and kills the call. I have a hunch that this is probably due to a timeout somewhere, but I'm not sure what kind of keepalives are needed other than the code here. I've tried this with multiple sip phones and all have the same behaviour. I'm using UDP. Am I doing something wrong?
Here is an excerpt of the code I'm using:
The text was updated successfully, but these errors were encountered: