Patent ID: 8351439

Claim:
A method comprising: receiving, at a network device, a first call from a first device destined for a second device; responsive to receiving the first call, placing, by the network device, a second call to the second device such that the first device and the second device are connected through the network device for a communication session, wherein packets of media traffic and signaling traffic for the communication session pass through the network device; receiving, at the network device, packets of media traffic associated with the communication session; determining, by the network device, whether media statistics for the communication session are to be generated, wherein the determining comprises at least one of: examining a user profile corresponding to at least one of a user of the first device and a user of the second device for an indication whether media statistics are to be generated, and determining whether a problem has been reported for the communication session; based on determining that media statistics for the communication session are to be generated, forking, by the network device, a copy of the packets of media traffic to a processor, wherein the forking is performed such that a delay associated with generating media statistics for the communication session is limited; modifying, by the network device, the received packets of media traffic by adding a network address and port number of the network device to the packets of media traffic as a return address for the communication session such that the second device responds to the network device using the return address, wherein the forking is performed before adding the network address to the received packets of media traffic; sending, by the network device, the modified packets of media traffic to the second device; and analyzing, by the network device, the forked copy of the packets of media traffic at the processor to generate media statistics about the communication session, wherein the forking allows the network device to analyze the copy of the packets of media traffic using the processor without being in a path for the communication session between the first device and second device.