We address the problem of optimizing resource allocation for Perceptually based Unequal Packet Protection (PUPP) in a packet based voice carrying network. For that purpose, we design a novel real-time working Perceptually Based Classifier (PBC) optimizing the assignment of voice packets to either a Premium (Pch) or an Ordinary (Och) transmission Channel with regard to packet perceptual importance. In particular, our PBC is based on Sliding Window optimization (SWO) and implement PESQa, an improved method to real-time estimation of speech quality. Based on this PBC and a Differentiated Service (DS) implementation of the Pch/Och, objective results indicate that 70% premium packet assignments optimizes performance over a broad range of loss scenarios on a bottleneck link. Additionally, packet loss statistics gives a clear indication on criteria for optimizing PUPP Pch/Och.