All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.pkts.streams.SipStatistics Maven / Gradle / Ivy

There is a newer version: 3.0.10
Show newest version
/**
 * 
 */
package io.pkts.streams;

/**
 * @author [email protected]
 */
public interface SipStatistics {

    /**
     * The total number of SIP messages processed by the {@link StreamHandler}.
     * This includes re-transmits also.
     * 
     * @return
     */
    long totalSipMessages();

    /**
     * The total number of SIP INVITE requests processed by the
     * {@link StreamHandler}, which also includes the re-transmitted ones.
     * 
     * @return
     */
    long totalInviteRequests();

    long totalAckRequests();

    long totalByeRequests();

    long totalOptionsRequests();

    long totalInfoRequests();

    long totalCancelRequests();

    /**
     * This will return an array with 600 elements, each index representing a
     * particular response (but with an offset of negative 100). E.g., if you
     * want to check how many 180 Ringing responses was captured, just check
     * what the count at index 180 - 100 = 80 is like so:
     * 
     * 
     * System.out.println("Total 180 responses: " + totalResponses()[180 - 100]);
     * 
     * 
     * Here is another example that prints out all responses received and their
     * count:
     * 
     * 
     * final int[] responses = stats.totalResponses();
     * System.out.println("All responses");
     * for (final int i = 0; i < responses.length; ++i) {
     *     if (responses[i] > 0) {
     *         System.out.println((i + 100) + ": " + responses[i]);
     *     }
     * }
     * 
     * 
     * Notice how we add 100 to the index as it is printed.
     * 
     * @return
     */
    int[] totalResponses();

    /**
     * Dump all stats to std out. Typically you don't want to use this. Mainly
     * for debugging purposes.
     * 
     * @return
     */
    String dumpInfo();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy