Repository navigation
TEL-1172: Add DialogSession to send and answer requests within a dialog - #1005
Open
hechen-eng wants to merge 11 commits into
Open
hechen-eng wants to merge 11 commits into
hechen-eng wants to merge 11 commits into
Conversation
A user agent that has only a Dialog snapshot, and not the transaction that created the dialog, could not send a request within it. DialogSession is built from a snapshot. It owns the sequence numbers, builds requests with the route set and the remote target (RFC 3261 section 12.2.1), sends a re-INVITE with the ACK, the retry after a 491 and the answer to a digest challenge, and sends BYE. It answers the re-INVITE and the BYE of the remote side that the owner of the SIP handlers passes to it. MediaOptions.SessionOrigin makes a media port continue an existing session: its offers keep the origin and raise the version (RFC 3264 section 8).
A session without OnOffer answered an offer of the remote side with a 200 and its old description, and recorded the offer as the remote description, while nothing applied the offer to the media. NewDialogSession now refuses options without OnOffer. When the context of Invite ended, the session sent a CANCEL and dropped the transaction. A remote side that accepted the INVITE before it saw the CANCEL got no ACK: it repeated the 2xx and then ended the call. Invite now waits a short time for the final response. For a 2xx it sends the ACK, records the change and returns the answer, because the re-INVITE took effect (RFC 3261 section 9.1). The session shares more code with live calls: - cancelledInviteAnswer, the wait for a 2xx after a CANCEL, is taken out of watchCancelledInvite. - digestCredentials answers a digest challenge for the INVITE of an outbound call and for the session. - Bye uses sendBye. sendBye and sendRefer take the function that starts the transaction, not the whole call.
The URI of the next hop selects the transport of a request.
A caller that knows the transport of its first hop sets the option. Without it, a sips next hop that names no transport gets TLS, not UDP.
A caller that runs its own call on the library's room needs the same termination and disconnect reason as the library's calls when the room closes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The library sends a request within a dialog from the INVITE transaction that created the dialog. A user agent that has only the
Dialogsnapshot (#992) cannot send a re-INVITE or a BYE in that dialog, and cannot answer one.Change
DialogSessionis one side of an established dialog, built from aDialogsnapshot.Invitesends a re-INVITE and the ACK, tries again after a 491 and after a digest challenge, and returns the answer. When its context ends, it sends a CANCEL; a 2xx that crosses the CANCEL still gets its ACK, andInvitereturns that answer.Byeends the dialog.HandleInvite,HandleAckandHandleByeanswer the requests of the remote side. The session does not listen: the owner of the SIP handlers finds it withMatchesand passes the requests on.OnOfferis required. It applies an offer of the remote side to the owner's media and returns the answer.MediaOptions.SessionOriginmakes a media port continue an existing SDP session: its offers and answers keep the origin and raise the version (RFC 3264 section 8).Live calls do not use the session. Three helpers are now shared with them, with no change in behavior: the wait for a 2xx after a CANCEL, the answer to a digest challenge, and
sendBye/sendRefer, which take the function that starts the transaction.Known limit: during the wait after a 491, the session answers an INVITE of the remote side with another 491. A follow-up changes this.