I thought RJ31 was physically compatible with Cat5
If it is a true RJ31x then there are shorting pins between 1 and 4, 5 and 8. With no connections for 2, 3, 6 or 7.
Telco in on terminals 4, 5 and out on 1, 8.
What does the wiring of the actual jack look like?