'Create a response to a request message.'

def responseFromRequest(self, code, request):

    response = Response(code)
    for name in ('via', 'to', 'from', 'call-id', 'cseq'):
        response.headers[name] = request.headers.get(name, [])[:]
    return response
