A session invitation starts with an INVITE request which is usually sent to a proxy. Proxy sends immediately a 100 Trying response to stop the re-transmissions of INVITE request from Humpty.
Proxy does a location search in the location service database for Dumpty (Dumpty must have registered itself for a domain). After getting the location result, Proxy forwards the INVITE request further.
Provisional responses are then generated by Dumpty which are sent back to the caller. Such as, 180 Ringing response in the call flow. This response is generated when Dumpty's phone starts alerting. It sent by Dumpty so that Humpty does not timeout and give up.
A 200 OK response gets generated once Dumpty answers the call (by picking up the phone). 200OK response will be re-transmitted by Dumpty until it receives an ACK from the Humpty.
The session is established at this point. That is, RTP packets are flowing from both ends.
A BYE request within an established dialog initiates the Session Termination. Party that wishes to tear down a session sends a BYE request to the other party involved in the session. In our case Humpty sends a BYE request to Dumpty.
BYE messages from Humpty to Dumpty will be sent directly unless the Proxy in the path had inserted a Record-Route header in the initial INVITE request - indicating that it wishes to stay on the path by using record routing.
The other party i.e Dumpty sends a 200 OK response to confirm the BYE and the session is terminated.
Note: We will talk about Session Description Protocol (SDP), Route and Record-Routing at a later stage. I will be soon updating this on SIP Interview Questions-Part 2. As for now just be happy and feel proud of what you have achieved till now :) :) :)
Cheers !!! Take a drink because you deserve it for making out this far :-)