To check whether your body is in rest or not you need to check whether the body->IsAwake() function returns true.IF yes then your body is at rest. Take a look at the following snippet.
b2Body *body; if(body->IsAwake()) { //Your body is awake, not in rest… } else { // Your body is in rest….. }