First make sure the AUX cord is compatible with iPhone wiring. Otherwise it might be 'touching' terminals it shouldn't and the phone won't recognize that as audio output. I assume your phone doesn't 'detect' headphones have been connected, correct?
Also, check that the cable isn't damaged or too long. Changes in impedance can trigger noisy signals and cause the phone to NOT go into headphone audio mode. Does the phone route audio through the port with regular headphones? If not, the port itself might be damaged.
And make sure the audio unit (in this case your CD Player) doesn't need to have an input selected for audio to play (like an AUX option there or something...kinda like a TV where you have to select which port or channel you want to display).