factor out INVITE response handling in its own function (issue #5127)