First, I believe you're getting only replies because of the paging clause. The code you provided here tries to retrieve the second 'page' of 1,000 messages. Try from:0 instead of from:1000, to start with. The paging property of the result, particularly hasMore property will tell you if you need to issue another query (and also the right from value).
Second, you can filter the Container with an in clause, for example:
select body,AttachmentsCount, container.name from discussionmessage where container in (select sysid from case).
Pay attention to the performance of this, as retrieving all Cases for your account to filter the discussions may take longer than retrieving all discussion messages and filtering the results in your application (specifically by the identifier of the container).
Hope this helps,