easiest but most expensive way would be to replace the entire connector board
ifixit sells them for the OG
if u have access to a multimeter or even like a lil wire
u can test to find out if this is even the case before u do anything
u can also try reflowing the joints if u have access and confidence in a soldering iron
without digging in further and see if that resolves
otherwise test that the continuity of the switching pins is working (or not working)
w/ the multimeter when u plug & unplug a cable
or use the wire to momentarily bridge the switched connections
with the jack un*plugged to see if u get speaker again
then u know if its actually the jack or not