Thank you for getting back to me. You're right that your dog is exhibiting signs of severe pain in the digestive system. The best thing to do would be to take him to a vet tonight. From your description, it sounds like he so severely constipated that home remedies won't help.
If he will eat, you can add a couple of spoons of canned pumpkin (plain pumpkin, not sweetened pie filling) to the food. Pumpkin tends to normalize stools. A spoonful of flaxseed is another possibility. Two teaspoons of a vegetable oil, such as olive or canola, may also help. Getting more liquid into his system may also help, so you can see if he'll drink some chicken or beef broth.However, in a case this severe, these may not get any results. Your vet may need to give him an enema. I do recommend trying to see a vet tonight because of the pain your dog is in.
After this problem is cleared up, you may want to consider a diet change since he's had this problem before. If he's fed dry food, switching to canned may help. You could add a little canned pumpkin every day. A bit of salmon oil in his food would also be good for him. Here is a link to a reputable brand:http://www.grizzlypetproducts.com/
If you have more questions, just let me know by clicking on REPLY. I hope your dog will be fine.
(If you find my answer helpful, please click on the ACCEPT button. Thank you.)