I only used the old customhinge, not custom joint.
The code for using the hinge is somewhere in this thread.