The router cannot determine if it is RTP packet or not, but you have at least two approaches to distinguish RTP packets
There are:
1. UDP port is in the range 16xxx to 31xxx, but other applications could use this range.
2. RTP packets are marked with DSCP EF value (or precedence 5), but you have to track that only RTP-packets are marked with this DSCP value on your network.
More detailed information you could find here
http://www.cisco.com/univercd/cc/td/doc/solution/esm/qossrnd.pdf