All have given good advice. The gray box is the NID or (Network Interface Device). This is the demarcation point where telephone company responsibility ends are your responsibility begins.
You could do what Dave recommends. Or, if you wish, you could do a search for RJ45 jack wiring on the net of contact your local Radio Shack to inquire which lead is positive & which is negative. Your telephone uses a 2 wire circuit. The wires can only go in one of two ways.