Class Sip


  • public final class Sip
    extends java.lang.Object
    Faker class for generating Session Initiation Protocol (SIP) related data.
    Author:
    TomerFi
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Sip​(Faker faker)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] bodyBytes()
      Body example of SDP type can be found in https://tools.ietf.org/html/rfc5621.
      java.lang.String bodyString()
      Body example of SDP type can be found in https://tools.ietf.org/html/rfc5621.
      int clientErrorResponseCode()
      Client error code, the various response codes are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
      java.lang.String clientErrorResponsePhrase()
      Client error phrase, the various response phrases are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
      java.lang.String contentType()
      Content types are based on https://tools.ietf.org/html/rfc5621 and https://tools.ietf.org/html/rfc3261.
      int globalErrorResponseCode()
      Global error code, the various response codes are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
      java.lang.String globalErrorResponsePhrase()
      Server error phrase, the various response phrases are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
      int messagingPort()
      Get a 4 digit random port for SIP messaging.
      java.lang.String method()
      The various SIP methods are listed in https://en.wikipedia.org/wiki/Session_Initiation_Protocol.
      java.lang.String nameAddress()
      Return a valid name address to use with to/from headers.
      int provisionalResponseCode()
      Proviosional code, the various response codes are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
      java.lang.String provisionalResponsePhrase()
      Proviosional phrase, the various response phrases are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
      int redirectResponseCode()
      Redirection code, the various response codes are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
      java.lang.String redirectResponsePhrase()
      Redirection phrase, the various response phrases are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
      int rtpPort()
      Get a 5 digit positive even port for rtp udp communication.
      int serverErrorResponseCode()
      Server error code, the various response codes are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
      java.lang.String serverErrorResponsePhrase()
      Server error phrase, the various response phrases are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
      int successResponseCode()
      Success code, the various response codes are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
      java.lang.String successResponsePhrase()
      Success phrase, the various response phrases are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Sip

        protected Sip​(Faker faker)
    • Method Detail

      • method

        public java.lang.String method()
        The various SIP methods are listed in https://en.wikipedia.org/wiki/Session_Initiation_Protocol.
        Returns:
        a SIP method String, e.g. INVITE.
      • contentType

        public java.lang.String contentType()
        Content types are based on https://tools.ietf.org/html/rfc5621 and https://tools.ietf.org/html/rfc3261.
        Returns:
        a SIP content-type declaration String, e.g. application/sdp
      • messagingPort

        public int messagingPort()
        Get a 4 digit random port for SIP messaging.
        Returns:
        a SIP messaging port int, e.g. 5060.
      • rtpPort

        public int rtpPort()
        Get a 5 digit positive even port for rtp udp communication.
        Returns:
        an RTP UDP 5 digit port int, e.g. 40002.
      • provisionalResponseCode

        public int provisionalResponseCode()
        Proviosional code, the various response codes are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
        Returns:
        a 3 digit SIP provisioan response code between 100 and 199 int, e.g. 180.
      • successResponseCode

        public int successResponseCode()
        Success code, the various response codes are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
        Returns:
        a 3 digit SIP success response code between 200 and 299 int, e.g. 200.
      • redirectResponseCode

        public int redirectResponseCode()
        Redirection code, the various response codes are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
        Returns:
        a 3 digit SIP redirection response code between 300 and 399 int, e.g. 301.
      • clientErrorResponseCode

        public int clientErrorResponseCode()
        Client error code, the various response codes are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
        Returns:
        a 3 digit SIP client error response code between 400 and 499 int, e.g. 486.
      • serverErrorResponseCode

        public int serverErrorResponseCode()
        Server error code, the various response codes are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
        Returns:
        a 3 digit SIP server error response code between 500 and 599 int, e.g. 503.
      • globalErrorResponseCode

        public int globalErrorResponseCode()
        Global error code, the various response codes are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
        Returns:
        a 3 digit SIP global error response code between 600 and 699 int, e.g. 608.
      • provisionalResponsePhrase

        public java.lang.String provisionalResponsePhrase()
        Proviosional phrase, the various response phrases are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
        Returns:
        a SIP provisional response phrase String, e.g. Ringing.
      • successResponsePhrase

        public java.lang.String successResponsePhrase()
        Success phrase, the various response phrases are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
        Returns:
        a SIP success response phrase String, e.g. OK.
      • redirectResponsePhrase

        public java.lang.String redirectResponsePhrase()
        Redirection phrase, the various response phrases are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
        Returns:
        a SIP redirection response phrase String, e.g. Moved Permanently.
      • clientErrorResponsePhrase

        public java.lang.String clientErrorResponsePhrase()
        Client error phrase, the various response phrases are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
        Returns:
        a SIP client error response phrase String, e.g. Busy Here.
      • serverErrorResponsePhrase

        public java.lang.String serverErrorResponsePhrase()
        Server error phrase, the various response phrases are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
        Returns:
        a SIP server erro response phrase String, e.g. Service Unavailable.
      • globalErrorResponsePhrase

        public java.lang.String globalErrorResponsePhrase()
        Server error phrase, the various response phrases are listed in https://en.wikipedia.org/wiki/List_of_SIP_response_codes.
        Returns:
        a SIP global error response phrase String, e.g. Rejected.
      • bodyString

        public java.lang.String bodyString()
        Body example of SDP type can be found in https://tools.ietf.org/html/rfc5621.
        Returns:
        a fake SDP type SIP body String.
      • bodyBytes

        public byte[] bodyBytes()
        Body example of SDP type can be found in https://tools.ietf.org/html/rfc5621.
        Returns:
        a fake SDP type SIP body byte array.
      • nameAddress

        public java.lang.String nameAddress()
        Return a valid name address to use with to/from headers.
        Returns:
        a valid name address String, e.g. <sip:[email protected]:5060>.