This question is pretty old, but I can maybe elaborate on what the other answers are saying.
The socket has five pins - You might think this is odd, because your stereo plug only has three connections: Left, Right, Ground. What are these strange extra connections?
The symbol you have shows two connections with weird angled parts at the end. Those are the bits that actually interface with the plug. The top one is the tip, and the bottom one is the ring. The sleeve is connected to gnd. The other two connections are the ones that act "odd". Each of these is normally connected to one of the angled contacts, except when a plug is inserted. When the plug is inserted, they are not connected to anything.
This means that you can use these connections to detect if a plug is inserted or not. Going even further, you can use these to directly solve your problem. If you connect your audio source to the two angled pins, when nothing is inserted, audio will come out of the two non-angled pins, so you should connect those to your speakers. When the plug is inserted, it will disconnect those two pins, muting the signal to your speakers.
You shouldn't need any of those other components, except the potentiometer, which will need to be far smaller, around 20 ohms as Peter says. If you want to control the speaker and the jack with the same potentiometer, it should be in series with the audio, and you'll likely need two of them, or a dual one (to control both channels). Dont be tempted to put a single pot between the jack and ground, because you'll get strange sounding music as the common signals start to attenuate.
Inverter don't give a pure sine output. There are some kind of inverter which gives pure sine output but those inverters are much more costlier than normal inverters. Normal inverters will output kind of modified sine wave which doesn't be same as sine wave that you get from the mains power supply.This might be a cause for your kind of humming sound from your speaker system. You can also notice this kind of humming sound from your ceiling fan when it's working in inveters.
My Suggestion is that you can try to get a pure sine wave inverter and can fix these humming issue.
You mentioned that humming sound goes off when you insert it to phone or PC. This because they still give some kind of output even if you don't play any music with it. They always give much more higher SNR sound output even though you don't play any music
Best Answer
As @Arsenal correctly noted, it used to be a metal-coated plastic pin, and the metal broke off. I just discovered that after dissecting the cable with a knife. I also discovered that such knife can cut one's finger if one's not careful.