tbh it appears that there is something amiss wit the rest of the brake system. Normally tension on the outer casing between the barrel adjuster and mounting points keeps everything in place. Check to make sure nothing has come adrift. Alternatively it may be that the outer has been cut too short.