def generate_checksum(message, previous_csum=0):
    """Generate checksum for messages with
        CALL_REQ, CALL_REQ_CONTINUE,
        CALL_RES,CALL_RES_CONTINUE types.

    :param message: outgoing message
    :param previous_csum: accumulated checksum value
    """
    if message.message_type in CHECKSUM_MSG_TYPES:
        csum = compute_checksum(
            message.checksum[0],
            message.args,
            previous_csum,
        )

        message.checksum = (message.checksum[0], csum)