iphone shuts down

i have a first generation iphone that i got off of craigslist that has been unlocked and jailbroken. the phone shuts off if it's on standby for longer than 30 sec. for the first several days that i used the phone it actually worked fine, but every now and then the usage time would run up when the phone was on standby. do you think this is a battery problem or something else? thanks!