Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 974 specs, 0 failures, 41 pending specs
- An INVITE sent from a UAC
- inits instance attributes
- has a custom .data attribute
- sends an INVITE on the WebSocket PENDING WITH MESSAGE: Temporarily disabled with xit
- has no dialogs at first
- following RFC3261 request generation rules (8.1.1)
- contains minimum header fields
- sets the Request-URI to the To URI
- sets the To URI from the given target
- must not contain a To tag
- sets the From URI from the UA
- contains a From tag
- generates a new Call-ID PENDING WITH MESSAGE: Temporarily disabled with xit
- guarantees no other UA will inadvertently overlap Call-IDs PENDING WITH MESSAGE: Temporarily disabled with xit
- generates a valid CSeq
- sets the Max-Forwards to 70
- the Via header
- uses SIP/2.0
- has a branch parameter
- has a Contact with one valid SIP URI
- declares Support for UA-supported extensions PENDING WITH MESSAGE: Temporarily disabled with xit
- must declare Support only for RFC-defined extensions PENDING WITH MESSAGE: Temporarily disabled with xit
- with options.media
- not defined, defaults to audio+video
- defined as constraints, follows those constraints
- TODO defined as stream, uses the stream PENDING WITH MESSAGE: Temporarily disabled with xit
- TODO defined as manager, uses the manager PENDING WITH MESSAGE: Temporarily disabled with xit
- with options.mediaStream
- with options.rtcConstraints
- with options.extraHeaders
- with options.params
- with options.anonymous
- with options.stunServers
- with options.turnServers
- with options.offer
- with options.renderBody
- with options.renderType
- with options.rel100
- when receiving a 1xx response
- fires the `progress` event
- when receiving a 2xx response
- fires the `accepted` event PENDING WITH MESSAGE: Temporarily disabled with xit
- sends an ACK PENDING WITH MESSAGE: Temporarily disabled with xit
- when receiving a 3xx-6xx response
- fires the `rejected` event PENDING WITH MESSAGE: Temporarily disabled with xit
- sends an ACK PENDING WITH MESSAGE: Temporarily disabled with xit
- when terminated
- before it has been accepted
- by a [3-6]xx response
- (300)
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- (302)
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- (400)
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- (404)
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- (500)
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- (503)
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- (600)
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- (603)
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- by a system error
- (onRequestTimeout)
- fires a `failed` event
- fires a `terminated` event
- does not fire a `rejected` event
- (onDialogError)
- fires a `failed` event
- fires a `terminated` event
- does not fire a `rejected` event
- using the `cancel` method
- fires a `cancel` event
- does not immediately fire `rejected`
- does not immediately fire `failed`
- does not immediately fire `terminated`
- after receiving a 487
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- using the `terminate` method
- uses `cancel`
- does not fire `terminated` on its own
- after it has been accepted
- cannot be canceled
- by a BYE request
- fires a `bye` event
- fires a `terminated` event
- does not fire a `rejected` or `failed` event
- using the `bye` method
- fires a `bye` event
- fires a `terminated` event
- does not fire a `rejected` or `failed` event
- by a system failure
- fires a `bye` event PENDING WITH MESSAGE: Temporarily disabled with xit
- sends a BYE with a reason PENDING WITH MESSAGE: Temporarily disabled with xit
- fires a `terminated` event PENDING WITH MESSAGE: Temporarily disabled with xit
- does not fire a `rejected` or `failed` event PENDING WITH MESSAGE: Temporarily disabled with xit
- using the `terminated` method
- uses `bye`
- fires `terminated` synchronously with the bye
- does not fire the `failed` event
- A UAS receiving an INVITE
- without SDP
- creates an invite server context with the UA's mediaHandlerFactory, the ISC emits invite
- with 100rel unsupported
- sending a progress response
- sends 100 unreliably with no body
- sends 1xx unreliably with no body
- with 100rel supported
- sending a progress response
- sends 100 unreliably with no body
- sends 1xx unreliably with no body
- SPEC HAS NO EXPECTATIONS sends 1xx reliably with a body, when rel100 specified
- with 100rel required
- sending a progress response
- sends 100 unreliably with no body
- SPEC HAS NO EXPECTATIONS sends 1xx reliably with a body
- with a Replaces header
- matching another dialog
- with "replaces" supported
- SPEC HAS NO EXPECTATIONS emits "replaced" on the replaced session, then terminates it
- with "replaces" unsupported
- SPEC HAS NO EXPECTATIONS neither emits "replaced" on the replaced session, nor terminates it
- that is then terminated
- cannot cancel the request
- before it has been accepted
- by a [3-6]xx response
- (300)
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- (302)
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- (400)
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- (404)
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- (500)
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- (503)
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- (600)
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- (603)
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- by a system error
- (onDialogError)
- fires a `failed` event
- fires a `terminated` event
- does not fire a `rejected` event
- by a CANCEL from the UAC
- fires a `cancel` event
- fires a `rejected` event
- fires a `failed` event
- fires a `terminated` event
- between being accepted and getting media
- does not fire an accepted event
- fires pre-acceptance events
- after it has been accepted
- by a BYE request
- fires a `bye` event
- fires a `terminated` event
- does not fire a `rejected` or `failed` event
- using the `bye` method
- fires a `bye` event
- fires a `terminated` event
- does not fire a `rejected` or `failed` event
- by a system failure
- fires a `bye` event PENDING WITH MESSAGE: Temporarily disabled with xit
- sends a BYE with a reason PENDING WITH MESSAGE: Temporarily disabled with xit
- fires a `terminated` event PENDING WITH MESSAGE: Temporarily disabled with xit
- does not fire a `rejected` or `failed` event PENDING WITH MESSAGE: Temporarily disabled with xit
- MediaStreamManager
- throws an exception if WebRTC is not supported
- defines mediaHint and acquisitions
- .acquire({constraints})
- passes constraints to SIP.WebRTC.getUserMedia
- emits userMediaRequest before calling getUserMedia
- emits userMedia when getUserMedia calls a success callback
- asynchronously
- emits userMediaFailed when getUserMedia calls a failure callback
- does not require local streams
- .release
- calls stop() on the tracks of the MediaStream it was passed
- .acquire({stream})
- .acquire ignores constraints and succeeds with the stream
- .acquire called twice in a row does not fail
- .release does not stop the stream's tracks
- ClientContext
- sets the ua
- sets the logger
- sets the method
- sets the body
- has no body by default
- sets the contentType
- has no contentType by default
- initializes data
- checks that the target is not undefined
- checks that the target is valid
- creates a new outgoing request
- .send
- calls the send method
- returns itself
- .receiveResponse
- emits progress on a 100-199 response
- emits accepted on a 2xx response
- emits rejected and failed on all other responses
- .onRequestTimeout
- emits failed with a status code 0, null response, and request timeout cause
- .onTransportError
- emits failed with a status code 0, null response, and connection error cause
- .cancel
- calls request.cancel
- emits a cancel event
- Dialogs
- sets the *_pending_reply properties
- returns an error if the message has no contact header
- sets the state correctly
- sets all settings for UAS
- sets all settings for UAC
- uses the mediaHandlerFactory of its owner session
- sets logger, owner, dialogs array, and logs
- .update
- sets the state to CONFIRMED and logs, doesn't set route set
- sets the state to CONFIRMED and logs, sets route set
- .terminate
- logs, and deletes the dialog from the ua dialogs array
- calls peerConnection.close if the dialog was in the EARLY state and there is an mediaHandler
- .createRequest
- returns a request with proper settings, doesn't increment local_seqnum
- returns a request with proper settings, increments local_seqnum
- .checkInDialogRequest
- sets the remote_seqnum if there is not one on the Dialog
- replies 500 to a non-ACK request where the request cseq is less than the Dialog cseq
- returns true if the request method is ACK, the remote seqnum is less than the request cseq, but the request cseq is equal to the invite seqnum
- returns false the remote seqnum is less than the request cseq, the method is ACK,and the request cseq is not equal to the invite seqnum
- sets the remote seqnum to the request cseq if it is initally less
- replies 491 if the request method is INVITE and uac_pending_reply is true
- replies 500 and returns false if the request method is INVITE and uac_pending_reply is true
- returns true and calls server_transaction.on once if neither of the *_pending_reply properties are true, the request method is INVITE, and the request does not have a contact header
- returns true and calls server_transaction.on twice if neither of the *_pending_reply properties are true, the request method is INVITE, and the request has have a contact header
- returns true and calls server.transaction.on once if the request method is NOTIFY and the request has a contact header
- .sendRequest
- calls requestsender.send PENDING WITH MESSAGE: Temporarily disabled with xit
- .receiveRequest
- does not call owner.receiveRequest if checkInDialogRequest returns false
- calls owner.receiveRequest if checkInDialogRequest returns false
- EventEmitter
- starts with no events
- checks for events with listeners
- .on
- only accepts functions
- calls the callback synchronously on emission
- calls the callback over and over
- binds to the emitter by default
- .once
- adds a listener
- calls the callback synchronously on emission
- calls the callback just one time
- binds to the emitter by default
- returns this
- .off
- removes the matching listener
- removes once listeners
- can remove all listeners for an event
- does not affect other events
- can shut off an object entirely
- returns this
- .emit
- handles no listeners gracefully
- calls the callbacks
- binds to the parent object
- ignores off listeners
- passes arguments to callback
- Grammar
- Contacts parsed from '"Iñaki @ł€" <SIP:+1234@ALIAX.net;Transport=WS>;+sip.Instance="abCD", sip:bob@biloxi.COM;headerParam, <sips:DOMAIN.com:5>'
- first contact
- is a NameAddrHeader
- has the display name
- has parameter +sip.instance set to "abCD"
- doesn't have parameter nooo
- its URI
- is a SIP.URI
- has scheme: "sip"
- has user: "+1234"
- has host: "aliax.net"
- has port: undefined
- getParam("transport") is "ws"
- getParam("foo") is undefined
- getHeader("X-Header") is undefined
- can alter display name and URI parameters
- second contact
- has displayName: undefined
- hasParam("HEADERPARAM") is true
- toString("null") is "<sip:bob@biloxi.com>;headerparam"
- its URI
- is a SIP.URI
- has scheme: "sip"
- has user: "bob"
- has host: "biloxi.com"
- has port: undefined
- hasParam("headerParam") is false
- can alter display name
- third contact
- has displayName: undefined
- toString("null") is "<sips:domain.com:5>"
- its URI
- is a SIP.URI
- has scheme: "sips"
- has user: undefined
- has host: "domain.com"
- has port: 5
- hasParam("nooo") is false
- can set header params and uri params
- Via parsed from "SIP / 3.0 / UDP [1:ab::FF]:6060 ; BRanch=1234;Param1=Foo;paRAM2;param3=Bar"
- has protocol: "SIP"
- has transport: "UDP"
- has host: "[1:ab::FF]"
- has host_type: "IPv6"
- has port: 6060
- has branch: "1234"
- has params: {"param1":"Foo","param3":"Bar"}
- CSeq parsed from "123456 CHICKEN"
- has value: 123456
- has method: "CHICKEN"
- challenge parsed from 'Digest realm = "[1:ABCD::abc]", nonce = "31d0a89ed7781ce6877de5cb032bf114", qop="AUTH,autH-INt", algorithm = md5 , stale = TRUE , opaque = "00000188"'
- has realm: "[1:ABCD::abc]"
- has nonce: "31d0a89ed7781ce6877de5cb032bf114"
- has qop: ["auth","auth-int"]
- has algorithm: "MD5"
- has stale: true
- has opaque: "00000188"
- Event parsed from "Presence.winfo;Param1=QWe;paraM2"
- has event: "presence.winfo"
- has params: {"param1":"QWe"}
- Content-Disposition
- has type: "session"
- has type: "render"
- parsing a UUID
- returns the input for correct UUIDs
- returns -1 for incorrect UUIDs
- Replaces
- parses the good examples
- rejects the bad examples
- NameAddrHeader
- has the display name
- can create a string of itself
- can set the display name to null
- can set the display name to 0
- can set the display name to ""
- has an empty parameters object
- when setting parameter Foo to null
- has parameter FOO
- when setting parameter Baz to 123
- has parameter baz set to "123"
- can create a string of itself
- can delete parameter bAz
- can clear its parameters
- when cloning itself
- has the same string representation as its clone
- can set the display name of the clone
- has an undefined user
- when calling NameAddrHeader.parse('"Iñaki ðđøþ" <SIP:%61liCE@versaTICA.Com:6060;TRansport=TCp;Foo=ABc;baz?X-Header-1=AaA1&X-Header-2=BbB&x-header-1=AAA2>;QWE=QWE;ASd')
- returns a SIP.NameAddrHeader
- parses the display name
- has parameter "qwe"
- gets parameter "qwe" as "QWE"
- has parameter "asd"
- gets parameter "asd" as null
- doesn't have parameter "nooo"
- can set the display name to "Foo Bar"
- can set the display name to null
- its URI:
- parses the scheme
- parses the user
- parses the host
- parses the port
- hasParam("transport") is true
- getParam("transport") is "tcp"
- hasParam("nooo") is false
- getParam("foo") is "abc"
- getParam("baz") is null
- getParam("noo") is undefined
- getHeader("x-header-1") is ["AaA1","AAA2"]
- getHeader("X-HEADER-2") is ["BbB"]
- getHeader("nooo") is undefined
- Utils.normalizeTarget
- fails to normalize "alice" on no domain
- when the domain is "sip.js.net"
- normalizes "%61lice" to "sip:alice@sip.js.net"
- normalizes "ALICE" to "sip:ALICE@sip.js.net"
- normalizes "alice@DOMAIN.com" to "sip:alice@domain.com"
- normalizes "iñaki" to "sip:i%C3%B1aki@sip.js.net"
- normalizes "€€€" to "sip:%E2%82%AC%E2%82%AC%E2%82%AC@sip.js.net"
- normalizes "iñaki@aliax.net" to "sip:i%C3%B1aki@aliax.net"
- normalizes "SIP:iñaki@aliax.net:7070" to "sip:i%C3%B1aki@aliax.net:7070"
- normalizes "SIPs:iñaki@aliax.net:7070" to "sip:i%C3%B1aki@aliax.net:7070"
- normalizes "ibc@gmail.com@aliax.net" to "sip:ibc%40gmail.com@aliax.net"
- normalizes "alice-1:passwd" to "sip:alice-1:passwd@sip.js.net"
- normalizes "SIP:alice-2:passwd" to "sip:alice-2:passwd@sip.js.net"
- normalizes "sips:alice-2:passwd" to "sip:alice-2:passwd@sip.js.net"
- normalizes "alice-3:passwd@domain.COM" to "sip:alice-3:passwd@domain.com"
- normalizes "SIP:alice-4:passwd@domain.COM" to "sip:alice-4:passwd@domain.com"
- normalizes "sip:+1234@aliax.net" to "sip:+1234@aliax.net"
- normalizes "+999" to "sip:+999@sip.js.net"
- normalizes "*999" to "sip:*999@sip.js.net"
- normalizes "#999/?:1234" to "sip:%23999/?:1234@sip.js.net"
- normalizes "tel:+12345678" to "sip:+12345678@sip.js.net"
- normalizes "tel:(+34)-944-43-89" to "sip:+349444389@sip.js.net"
- normalizes "+123.456.78-9" to "sip:+123456789@sip.js.net"
- normalizes "+ALICE-123.456.78-9" to "sip:+ALICE-123.456.78-9@sip.js.net"
- fails to normalize null
- fails to normalize undefined
- fails to normalize null
- fails to normalize false
- fails to normalize true
- fails to normalize ""
- fails to normalize "ibc@iñaki.com"
- fails to normalize "ibc@aliax.net;;;;;"
- RegisterContext
- initialize instance variables
- .register
- sets up the receiveResponse function
- sets up the onRequestTimeout function
- sets up the onTransportError function
- sends params and the extra headers
- retries with the min-expires header on 423
- fails registration on 423 with no min-expires header
- sets its closeHeaders property if options.closeWithHeaders flag is true
- .registrationFailure
- emits failed with the response and cause provided to it
- emits failed with null and the cause provided if no response is provided
- does not unregister
- .onTransportClosed
- takes the registered variable and move it to registered_before variable
- clears the registration timer if it is set
- calls unregistered if it is registered
- .onTransportConnected
- calls register
- .close
- takes registered and move it to registered_before
- calls unregister with closeHeaders
- .unregister
- does nothing if the registered variable is false
- changes registered variable to false if it was true
- clears the registration timer
- pushes extra headers Contact: *, Expires: 0 if options.all is truthy
- even when unregistered, pushes extra headers Contact: *, Expires: 0 if options.all is truthy
- pushes extra headers Contact: <contact>, Expires: 0 if options.all is falsy
- calls send with the params call_id, and cseq+=1
- defines receiveResponse
- defines onRequestTimeout
- defines onTransportError
- .unregistered
- sets RegisterContext.registered to false if RegisterContext.registered is true
- sets RegisterContext.registered to false if RegisterContext.registered is false
- emits unregistered with the response and cause passed to it
- emits unregistered with a null response and a null cause if one is not provided
- SIPMessage
- OutgoingRequest
- sets up instance variables
- .setHeader
- sets the headers headerized name property to an array of the value
- sets the headers headerized name property to the array passed to it
- .getHeader
- returns the header that exists
- returns the header from extra headers if it is not in headers
- returns undefined if the header does not exist in headers or extraHeaders
- .getHeaders
- returns all of the headers in an array with the given name
- returns all the headers in an array with the given name from extraHeaders if the header is not in headers
- returns an empty array if the header is not found in headers and the header is not found in extraHeaders
- .hasHeader
- returns true if the header exists in headers
- returns true if the header exists in extraHeaders
- returns false if the header does not exist in headers or extraHeaders
- .toString
- calculates the correct Content-lenght for a given body
- IncomingRequest
- initialize the instance variables
- .addHeader
- creates the header in the headers object if it does not already exist
- adds the header to the array in the headers object if it already exists
- .getHeader
- returns undefined if the header does not exist
- returns the value of the header that exists
- returns the first header value if multiple values exist
- .getHeaders
- returns an empty array if the header does not exist
- returns an array with one value if there is only one value for the header provided
- returns an array with all of the values if they exist for the header provided
- .hasHeader
- returns true if the header exists
- returns false if the header does not exist
- .parseHeader
- returns undefined if the header does not exist in the headers object
- returns undefined if the idx is greater than the array for the header that exists
- returns the already parsed header if it exists
- returns a newly parsed header and creates a parsed property
- .setHeader
- adds the header if it does not alredy exist
- replaces a header that already exists
- .toString
- returns the data instance variable
- .reply
- throws a TypeError if no code exists
- throws a TypeError if the code is less than 100 or greater than 699
- throws a TypeError if a valid code is provided but reason is not a string
- .reply_sl
- IncomingResponse
- initialize the instance variables
- .addHeader
- creates the header in the headers object if it does not already exist
- adds the header to the array in the headers object if it already exists
- .getHeader
- returns undefined if the header does not exist
- returns the value of the header that exists
- returns the first header value if multiple values exist
- .getHeaders
- returns an empty array if the header does not exist
- returns an array with one value if there is only one value for the header provided
- returns an array with all of the values if they exist for the header provided
- .hasHeader
- returns true if the header exists
- returns false if the header does not exist
- .parseHeader
- returns undefined if the header does not exist in the headers object
- returns undefined if the idx is greater than the array for the header that exists
- returns the already parsed header if it exists
- returns a newly parsed header and creates a parsed property
- .setHeader
- adds the header if it does not alredy exist
- replaces a header that already exists
- .toString
- returns the data instance variable
- SanityCheck
- for all IncomingMessages
- minimumHeaders check
- accepts messages with minimum headers
- accepts messages with mininum short-form headers
- rejects messages with no From header
- rejects messages with no To header
- rejects messages with no Call-Id header
- rejects messages with no CSeq header
- rejects messages with no Via header
- for IncomingRequests
- rfc3261 check
- 8.2.2.1
- rejects requests with an invalid RURI scheme
- does not examine the To header PENDING WITH MESSAGE: Temporarily disabled with xit
- 16.3.4
- rejects messages from itself as loops
- accepts messages from other places
- 18.3_request
- rejects messages that are too short
- accepts messages with no Content-Length
- truncates messages that are too long
- 8.2.2.2
- rejects merged INVITE requests
- rejects very different matching INVITE requests
- rejects merged non-INVITE requests
- rejects very different matching non-INVITE requests
- for IncomingResponses
- rfc3261 check
- 8.1.3.3
- drops messages with two vias
- 18.1.2
- drops messages with inappropriate via sent-by host
- drops messages with inappropriate via sent-by port
- accepts messages with correct via sent-by host
- 18.3_response
- drops messages that are too short
- accepts messages with no Content-Length
- truncates messages that are too long
- ServerContext
- sets the ua
- sets the logger
- sets the method
- sets the request
- sets the body
- sets the contentType
- sets the transaction based on the request method
- initializes data
- .progress
- defaults to status code 180 if none is provided
- throws an error with an invalid status code
- calls reply with a valid status code and passes along a reason phrase, extra headers, and body
- emits event progress with a valid status code and response
- returns itself
- .accept
- defaults to status code 200 if none is provided
- throws an error with an invalid status code
- calls reply with a valid status code and passes along a reason phrase, extra headers, and body
- emits event accepted with a valid status code and null response
- returns itself
- .reject
- defaults to status code 480 if none is provided
- throws an error with an invalid status code
- calls reply with a valid status code and passes along a reason phrase, extra headers, and body
- emits event rejected and event fails with a valid status code and null response and reasonPhrase for a cause
- returns itself
- .reply
- passes along the status code, reason phrase, header, and body as is to request reply
- returns itself
- .onRequestTimeout
- emits failed with a status code 0, null response, and request timeout cause
- .onTransportError
- emits failed with a status code 0, null response, and connection error cause
- Session
- initializes session objects
- initializes session timers
- initializes session info
- initializes mute/hold state info
- initializes the pending actions array and functions
- .pending_actions
- .length
- returns the length
- .isPending
- returns true for objects that are present
- returns false for objects that are not present
- .shift
- returns foo and leaves bar as the only element in the array
- .push
- adds seven to the array
- .pop
- removes foo from the array
- initializes early_sdp, and rel100
- .dtmf
- throws an error if tones is undefined
- throws an error if the session status is incorrect
- throws an error if tones is the wrong type
- accepts a string argument
- throws an error if tone duration is invalid PENDING WITH MESSAGE: Temporarily disabled with xit
- resets duration to 70 if it's too low PENDING WITH MESSAGE: Temporarily disabled with xit
- resets duration to 6000 if it's too high PENDING WITH MESSAGE: Temporarily disabled with xit
- resets duration to positive if it's negative PENDING WITH MESSAGE: Temporarily disabled with xit
- throws an error if interToneGap is invalid PENDING WITH MESSAGE: Temporarily disabled with xit
- queues up tones if tones are already queued
- sets tones if no tones are queued PENDING WITH MESSAGE: Temporarily disabled with xit
- returns Session on success
- .bye
- logs an error and returns this if the session status is terminated
- emits bye and terminated on any status code >= 200
- throws an error for any other status code
- .refer
- throws an error if target is undefined
- throws an error if target is not an Session and status is not confirmed
- returns Session on success
- .sendRequest
- returns Session on success
- .close
- returns Session if the status is terminated
- deletes the session from the ua, deletes the dialog, and returns the Session on success
- .createDialog
- returns true and puts the dialog in the early dialogs array on a success call with early = true, type = UAS
- returns true and puts the dialog in the early dialogs array on a success call with early = true, type = UAC
- returns false if early_dialog.error is true when early = true
- creates an early dialog, then updates it; returns true, no longer in early dialog array
- returns false if dialog.error is true when early = false
- returns true on a call where early = false
- .isReadyToReinvite
- returns false if mediaHandler.isReady() returns false
- returns false if either of the pending_reply options are true
- returns true if all above conditions are met
- .hold
- throws an error if the session is in the incorrect state
- does not emit hold if local hold is true
- emits hold on success
- .unhold
- throws an error if the session is in the incorrect state
- does not emit unhold if local hold is false
- emits unhold on success
- .isOnHold
- returns the values of local_hold and remote_hold
- .receiveReinvite
- does not call setDescription and replies with 415 if contentType is not application/sdp
- calls setDescription on success
- .sendReinvite
- on success, sets receiveResponse, reinviteSucceeded, and reinviteFailed, and calls getDescription
- .receiveReinviteResponse
- returns without calling sendRequest or reinviteFailed when status is terminated
- returns without calling sendRequest or reinviteFailed when response status code is 1xx
- calls reInviteFailed when the response has no body with a 2xx status code
- calls reInviteFailed when the response's content-type is not application/sdp with a 2xx status code
- calls sendRequest and setDescription when response has a 2xx status code, a body, and content-type of application/sdp
- returns without calling sendRequest or reinviteFailed when response status code is neither 1xx or 2xx
- .acceptAndTerminate
- calls sendRequest twice and returns Session on success
- calls createDialog if this.dialog is null
- .setInvite2xxTimer
- defines timers.invite2xxTimer
- .setACKTimer
- defines timers.ackTimer
- .onReadyToReinvite
- returns without calling hold/unhold if pending_actions is empty
- calls hold if that is the next action
- calls unhold if that is the next action
- .onTransportError
- does not call failed if the status is terminated
- does not call failed if the status is terminated
- calls failed if the status is neither terminated or confirmed
- .onRequestTimeout
- does not call failed or terminated if the status is terminated
- calls terminated if the status is confirmed
- calls failed if the status is neither terminated or confirmed
- .onDialogError
- does not call failed or terminated if the status is terminated
- calls terminated if the status is confirmed
- calls failed if the status is neither terminated or confirmed
- .onhold
- sets local_hold to true and emits hold when originator is local
- sets remote_hold to true and emits hold when originator is remote
- .onunhold
- sets local_hold to false and emits unhold when originator is local
- sets remote_hold to false and emit unhold when originator is remote
- .onmute
- emits muted
- .onunmute
- emits unmuted
- .failed
- emits and returns Session
- .rejected
- emits and returns Session
- .refer
- emits and returns Session PENDING WITH MESSAGE: Temporarily disabled with xit
- .canceled
- emits, and returns Session
- .accepted
- calls emit, sets a startTime, and returns Session
- .terminated
- calls close, emits, sets an endTime, and returns Session
- .connecting
- calls emit
- InviteServerContext
- sets contentDisp correctly
- replies 415 from non-application/sdp content-type with a session content-disp
- calls augment using ServerContext and Session
- sets status, from_tag, id, request, contact, logger, and sessions
- sets 100rel, requires
- sets 100rel, supported
- replies 500 and returns if the createDialog call fails
- calls fireNewSession if request.body is null
- calls mediaHandler.setDescription otherwise PENDING WITH MESSAGE: Temporarily disabled with xit
- .reject
- throws an invalid state error is the status is terminated
- throws a type error when the status code is valid and less than 300
- replies to the request (480 is default)
- calls rejected, failed, and terminated
- calls close
- returns the InviteServerContext object
- .terminate
- emits bye and calls terminated if the status is WAITING_FOR_ACK
- sets the dialog in the ua dialogs array if the status is WAITING_FOR_ACK
- calls bye if the status is CONFIRMED
- calls reject if the status is neither WAITING_FOR_ACK or CONFIRMED
- .accept
- changes status to ANSWERED_WAITING_FOR_PRACK and returns this if status is WAITING_FOR_PRACK
- throws Invalid State Error if status is not WAITING_FOR_PRACK, WAITING_FOR_ANSWER, or EARLY_MEDIA
- replies 500 and returns this if createDialog fails
- clears the userNoAnswerTimer
- sets the constraints to false if they were set to true earlier when there is no audio or video streams PENDING WITH MESSAGE: Temporarily disabled with xit
- does not call getDescription and returns this when the status is EARLY_MEDIA
- calls getDescription and returns this on a successful call where the status is not EARLY_MEDIA
- .receiveRequest
- method is CANCELED
- status is WAITING_FOR_ANSWER, timers cleared
- status is WAITING_FOR_PRACK, timers cleared
- status is ANSWERED_WAITING_FOR_PRACK, timers cleared
- status is EARLY_MEDIA, timers cleared
- status is ANSWERED, timers cleared
- method is ACK
- calls mediaHandler.setDescription when the ACK contains an answer to an invite w/o sdp
- calls confirmSession if session.early_sdp is true and above is false
- calls failed if the above two conditions are not true
- calls confirmSession if there was an invite w/ sdp originally
- method is PRACK
- calls mediaHandler.setDescription when the invite had no body, but the request had sdp
- calls terminate and failed when invite has no body, but the request has a non-sdp body
- calls reply(200) and other smaller things when the invite had a body (accept not called)
- calls reply(200) and other smaller things when the invite had a body (accept also called)
- method is BYE
- replies 200, emits bye, and terminates
- method is INVITE
- calls receiveReinvite
- method is INFO
- makes a new DTMF
- returns a 415 if DTMF packet had the wrong content-type header
- SPEC HAS NO EXPECTATIONS invokes onInfo if onInfo is set
- method is REFER
- replies 202, then calls callback and terminate if there is a session.followRefer listener
- InviteClientContext
- throws a type error if target is undefined
- throws a not supported error if WebRTC is not supported
- throws a type error if normalizeTarget fails with the given target
- calls augment using ClientContext and Session
- throws an invalid state error if the status is null
- sets several parameters at the end of the constructor
- throws a type error if invalid stun servers are passed in
- throws a type error if invalid turn servers are passed in
- sets anonymous, custom data, and contact
- sets ua.applicants, request, local and remote identity, id, and logger
- .invite
- sets MediaHandler and ua.sessions
- calls mediaHandler.getDescription async and returns this on success
- .receiveInviteResponse
- accepts and terminates a 200 OK from a branch that's replying after the call has been established
- emits failed if the branch on which early media was established is not the branch that picks up first (invite w/ sdp case)
- ACKs any 200 OKs from the branch on which the call is up after the initial 200 OK
- PRACKS any non 200 response that are not retransmissions when it already chose a dialog
- cancels the request if the call was canceled and the response is 1xx
- accepts and terminates the response if the call was canceled and the response is 2xx
- sets received_100 to true when the response is 100
- the response status code is 101-199
- logs a warning and breaks if the response does not have a to tag
- creates a dialog if the response has a contact; breaks if createDialog doesn't return correctly
- changes the status to 1XX_RECEIVED and emits progress
- does not PRACK a response with no body (and requires: 100rel) if there is already a confirmed dialog PENDING WITH MESSAGE: Temporarily disabled with xit
- does not PRACK a response with no body (and requires: 100rel) if there is an illegal rseq header
- PRACKs (when require: 100rel is present) a response without a body
- calls MediaHandler.setDescription for a response with a body with require: 100rel and confirms the dialog
- calls MediaHandler.setDescription for a 100rel response with a body where the request had a non-sdp body PENDING WITH MESSAGE: Temporarily disabled with xit
- the response status code is 2xx
- returns after doing nothing because of an incorrect cseq (same as below, but the cseq is not reset)
- sets the status to confirmed, ACKS, and calls accepted if the status was earlyMedia
- returns after doing nothing because there is already a confirmed dialog (same conditions as below otherwise
- calls acceptAndTerminate and failed if the response has no body
- uses the dialog with pre-established media, changes the status to confirmed, ACKS, and calls accepted if that dialog exists for this response and the request had no body
- calls mediaHandler.setDescription if the request had no body and the response had no early dialog with media connected to it
- same as above, but does not make the call if the createDialog fails
- calls mediaHandler.setDescription if the request has a body
- same as above, but does not make the call if the createDialog fails
- calls failed, rejected for any other response code
- .cancel
- throws an invalid state error if the status is TERMINATED
- throws a type error if the status code is invalid or less than 200
- sets isCanceled to true, calls canceled, and returns this if status is NULL
- sets isCanceled to true, calls canceled, and returns this if status is INVITE_SENT and received_100 is false
- calls request.cancel, canceled, and returns this if status is INVITE_SENT and received_100 is true
- calls request.cancel, canceled, and returns this if status is 1XX_RECEIVED
- .terminate
- calls bye and returns this if the status is WAITING_FOR_ACK
- calls bye and returns this if the status is CONFIRMED
- calls cancel and returns this if the status is anything else
- .receiveRequest
- sets the status to CANCELED, replies 487, and calls canceled and failed if the status is EARLY_MEDIA and the request method is CANCELED PENDING WITH MESSAGE: Temporarily disabled with xit
- replies 200 and emits bye and terminated if the request method is BYE
- logs and calls receiveReinvite if request method is INVITE
- clears timers and sets the status to confirmed if request method was ACK and the status was WAITING_FOR_ACK PENDING WITH MESSAGE: Temporarily disabled with xit
- DTMF case PENDING WITH MESSAGE: Temporarily disabled with xit
- logs, replies 202, then calls callback and terminate if session.followRefer listener present
- logs then 603 Declines if no session.followRefer listener present
- Subscription
- initialization
- sets id and state
- throws a type error if event is not set
- sets expires to 3600 if nothing is passed, or a non-number is passed
- allows expires less than 3600
- sets expires to a valid number passed in
- sets body if body is passed in
- sets the contact
- calls augment with ClientContext
- sets logger, dialog, timers, and error codes
- .subscribe
- calls clearTimeout on each of the timers
- sets Timer_N to fire timer_fire after TIMER_N time
- calls send
- sets the state to notify_wait (that rhymes)
- returns the Subscription
- .receiveResponse
- calls fail if the status code is one of the error codes
- calls clearTimeout on Timer N
- creates a dialog, sets the id, emits accepted, and puts this subscription in the ua's subscriptions array
- sets the sub_duration timer if there was a valid expires header
- calls failed and warns if expires header was missing
- calls close, failed, and warns if expires header was higher than original offer
- .unsubscribe
- sets the state to terminated
- sends a request using the same dialog as the subscription
- calls clearTimeout on each of the timers
- sets Timer_N to fire timer_fire after TIMER_N time
- .timer_fire
- calls terminateDialog if state is terminated
- calls clearTimeout on both timers if state is terminated
- deletes the subscription from the UA if state is terminated
- calls close if the state is pending or notify_wait
- calls refresh for all other states (active, init)
- .close
- calls unsubscribe if the state is not terminated or notify_wait
- .createConfirmedDialog
- creates a dialog, sets it to the subscription, and returns true on success
- returns false, doesn't set the dialog on dialog creation failure
- .terminateDialog
- terminates and deletes the subscription's dialog if it exists
- .receiveRequest
- replies 489 returns if matchEvent fails
- replies 200 if match event passes
- clear both timers
- emits notify
- if sub_state.state is active, changes state to active and sets the duration timer if there is an expires as well
- expires is not reset if under 3600
- expires is reset correctly if too high
- if sub_state.state is pending and current state is notify_wait, set sub_duration, otherwise just change state
- if sub_state.state is terminated with reason deactivated or timeout and state is not terminated, subscribe will be called without close (always a log)
- if sub_state.state is terminated with reason deactivated or timeout and state is not terminated, the Subscription will be gracefully shut down
- if sub_state.state is terminated with reason probation or giveup, subscribe will be called or the sub_duration timer will be set if retry-after is present, both without close
- if sub_state.state is terminated with reason rejected, noresource, or invariant, close will be called
- .failed
- calls close and emits failed
- .onDialogError
- does not throw an exception
- .matchEvent
- logs a warning and returns false if Event header is missing
- logs a warning and returns false if Subscription-State header is missing
- logs a warning, replies 481, and returns false if the events don't match
- returns true if none of the above happens
- UA
- has no mandatory parameters
- can be created with just a string URI
- can be created with just a String (object) URI
- can be created with empty stunServers list
- sets the instance variables
- creates a new register context
- .start
- creates a SIP transport if the status is C.STATUS_INIT
- sets the status to ready and connect the transport if the status is C.STATUS_USER_CLOSED
- logs if the status is set to starting
- logs if the status is set to ready
- logs an error if the status is not C.STATUS_INIT, C.STATUS_STARTING, C.STATUS_USER_CLOSED, C.STATUS_READY
- returns itself
- does not register if not configured
- .stop
- logs a warning and returns this if the ua has already been closed
- clears the transportRecoveryTimer
- unregisters
- terminates any active sessions
- closes any active subscriptions
- closes any applicants
- disconnects from the Web Socket if there are no non-invite transactions left
- disconnects from the Web Socket if after transaction destroyed is emitted once there are no non-invite transactions left
- .register
- does not require any arguments
- sets the register configuration option to true
- calls the Register Context register method with the options that were passed to the method
- returns itself
- .unregister
- does not require any arguments
- sets the register configuration option to false
- calls the Register Context unregister method with the options that were passed to the method
- returns itself
- .isRegistered
- returns the value stored by register context registered
- .isConnected
- returns false if the transport is undefined
- returns transport.connected if the transport is defined
- .message
- throws an exception if body argument is missing
- sets up a listener for connected if the transport has not connected
- passes no options to message.send
- creates a ClientContext with itself, target, body, options.contentType and options as parameters
- calls ClientContext.send method with no options provided to it
- .invite
- sets up a listener for connected if the transport has not connected
- creates an Invite Client Context with itself, target, and options as parameters
- .subscribe
- sets up a listener for connected if the transport has not connected
- creates a Subscription with itself, target, and options as parameters
- calls the Subscription method with no arguments
- .request
- sets up a listener for connected if the transport has not connected
- creates a ClientContext with itself, the method, target and options provided
- calls ClientContext.send method with no parameters
- .normalizeTarget
- calls SIP.Utils.normalizeTarget with the target and the hostport params
- returns the result of calling SIP.Utils.normalizeTarget
- .saveCredentials
- should create the credentials realm object if it does not exist
- adds the credentials uri to the credentials realm
- returns itself
- .getCredentials
- returns undefined if the credentials are not found
- returns the credentials that are found
- .getLogger
- calls this.log.getLogger function with the category and label passed to it and return the result
- .onTransportClosed
- .onTransportError
- .onTransportConnected
- .onTransportConnecting
- emits a connecting event
- .newTransaction
- emits a newTransaction event
- adds the trasaction to the transactions object
- .destroyTransaction
- emits a transactionDestroyed event
- deletes the transaction from the transactions object
- .receiveRequest
- checks that the ruri points to us
- replies with a 404 if the request method is not ACK
- checks the transaction and returns if invalid
- creates a new NIST if the SIP method is options
- Accepts SIP MESSAGE requests
- creates a ServerContext if the SIP method is anything besides options, message, invite, and ack PENDING WITH MESSAGE: Temporarily disabled with xit
- sends a 488 if an invite is received but there is no WebRTC support
- sends a 481 if a BYE is received
- finds the session and call receiveRequest on the session if it exists if a CANCEL is received
- logs a warning if the session does not exist if a CANCEL is a received
- should not do nothing if an ACK is received
- replies with a 481 if allowLegacyNotifications is false when a NOTIFY is received
- replies with a 481 if allowLegacyNotifications is true, but no listener is set, when a NOTIFY is received
- emits notified and replies 200 OK if allowLegacyNotifications is true, but no listener is set, when a NOTIFY is received
- replies with a 405 if it cannot interpret the message
- creates a new Invite Server Transaction and call receive request if it receives an in dialog invite request
- should not create a new Invite Server Transaction and just call receive request if it receives an in dialog request other than invite
- replies 481 on the request if the dialog is not found and the request is an invite
- calls receiveRequest on the dialog if there is one
- calls receive response on the session if it exists and the dialog does not for an in dialog notify request
- replies with a 481 and subscription does not exist if an in dialog notify request is received and no dialog or session is found
- replies with a 481 if an in dialog request is received that is not a NOTIFY OR ACK and no dialog is found
- should not do anything if an ACK is received and no dialog is found
- .findSession
- returns the session based on the call_id and from_tag
- returns the session based on the call_id and to_tag
- returns null if the session is not found
- .findDialog
- returns the dialog based on the call_id and from_tag and to_tag
- returns the dialog based on the call_id and to_tag and from_tag
- returns null if the session is not found
- .getNextWsServer
- selects the candidate with the highest weight
- selects one of the candidates with the highest weight
- does not select a candidate that has a transport error
- .closeSessionsOnTransportError
- calls onTransportError for all the sessions in the sessions object
- calls onTransportClosed on register context
- .recoverTransport
- logs if the next retry time exceeds the max_interval
- calls getNextWsServer
- sets the transportRecoveryTimer
- logs before setting the transport recovery timer, then attempts to make a new transport
- asynchronously
- .loadConfig
- sets default settings for many parameters
- throws a configuration error when a mandatory parameter is missing
- throws a configuration error if a mandatory parameter's passed-in value is invalid
- sets a mandatory value successfully in settings
- throws a ConfigurationError if an optional value is passed in which is invalid
- sets an optional value successfully in settings
- makes sure the connection recovery max interval is greater than the min interval
- allows 0 to be passed as a display name
- sets an instanceId if one is not passed in also sets sipjsId
- sets auth user to uri user if auth user is not passed in
- sets iceCheckingTimeout as low as 0.5 seconds
- sets the registrarServer to the uri (without user) if it is not passed in
- uses getRandomTestNetIP for viaHost if hackIpInContact is set to true
- creates the contact object
- .configuration_skeleton
- sets all parameters (except register) as writable/configurable false
- sets all the register parameter as writable true, configurable false
- .configuration_check
- .uri
- fails if nothing is passed in
- fails if there is no user
- passes if there is a correctly parsed uri
- .wsServers
- fails for types that are not string or array (of strings or objects
- fails for an empty array
- fails if ws_uri attribute is missing
- fails if weight attribute is not a number
- fails if the ws_uri is invalid
- fails if the url scheme is not wss or ws
- returns correctly if none of the above is wrong
- .authorizationUser
- fails if a type besides a string is passed in PENDING WITH MESSAGE: Temporarily disabled with xit
- ALWAYS PASSES
- .connectionRecoveryMaxInterval
- fails for anything but numbers
- fails for negative numbers and 0
- passes for positive numbers
- .connectionRecoveryMinInterval
- fails for anything but numbers
- fails for negative numbers and 0
- passes for positive numbers
- .displayName
- fails if a type besides a string is passed in PENDING WITH MESSAGE: Temporarily disabled with xit
- ALWAYS PASSES
- .hackViaTcp
- fails for all types except boolean
- passes for boolean parameters
- .hackIpInContact
- fails for all types except boolean and string
- passes for boolean parameters
- passes for string parameters that can be parsed as a host
- .instanceId
- fails for everything but string hex pattern (see below)
- passes if passed (hex8)-(hex4)-(hex4)-(hex4)-(hex12) as a string (may have uuid: in front, but removes this)
- .noAnswerTimeout
- fails for anything but numbers
- fails for negative numbers and 0
- passes for positive numbers
- .password
- ALWAYS PASSES
- .rel100
- returns SIP.C.supported.REQUIRED if SIP.C.supported.REQUIRED is passed in
- returns SIP.C.supported.REQUIRED if "required" is passed in
- returns SIP.C.supported.SUPPORTED if SIP.C.supported.SUPPORTED is passed in
- returns SIP.C.supported.SUPPORTED if "supported" is passed in as well as adding it to the supported list
- returns SIP.C.supported.NONE for all other arguments passed in
- .replaces
- returns SIP.C.supported.REQUIRED if SIP.C.supported.REQUIRED is passed in
- returns SIP.C.supported.SUPPORTED if SIP.C.supported.SUPPORTED is passed in
- returns SIP.C.supported.UNSUPPORTED for all other arguments passed in
- .register
- fails for all types except boolean
- passes for boolean parameters
- .registerExpires
- fails for anything but numbers
- fails for negative numbers and 0
- passes for positive numbers
- .registrarServer
- only accepts strings
- fails for a string that is not a valid uri (parse returns nothing)
- fails for a string that is a valid uri, but has a user
- passes for a string that is a valid uri without a user and returns a URI
- .stunServers
- fails for anything except a string or an array
- fails for an invalid stun_uri PENDING WITH MESSAGE: Temporarily disabled with xit
- works with a string or an array
- .traceSip
- fails for all types except boolean
- passes for boolean parameters
- .turnServers
- works whether an array is passed or not
- works if you pass in server instead of urls (backwards compatible
- fails if urls, username, or server is missing
- fails if the url passed is not a valid turn_uri
- .userAgentString
- fails for all types except string
- passes for string parameters
- .usePreloadedRoute
- fails for all types except boolean
- passes for boolean parameters
- .wsServerMaxReconnection
- fails for anything but numbers
- fails for negative numbers and 0
- passes for positive numbers
- .wsServerReconnectionTimeout
- fails for anything but numbers
- fails for negative numbers and 0
- passes for positive numbers
- .autostart
- fails for all types except boolean
- passes for boolean parameters
- .allowLegacyNotifications
- fails for all types except boolean
- passes for boolean parameters
- URI
- defines parameters
- defines headers
- sets the scheme
- sets the user
- sets the host
- sets the port
- .setParam
- does not set a parameter with a null key
- sets a parameter with a null value
- sets a parameter with a key and value
- sets a parameter and make the key lowercase
- sets a parameter and make the parameter lowercase
- .getParam
- does not get a parameter for a null key
- gets a parameter for a key
- gets a parameter for a key that is uppercase
- .hasParam
- is undefined for a null key
- is false for a parameter that does not exist
- is true for a parameter that does exist
- is true for a parameter that does exist regardless of case
- .deleteParam
- deletes the entry from the parameters list
- returns the value of the deleted key
- does not delete a key that does not exist
- does not return a value if the key does not exist
- .clearParams
- empties the parameter list
- does not make the parameter list undefined
- .setHeader
- adds the header if it does not exist
- replaces the header if it already exists
- .getHeader
- returns undefined if the header does not exist
- returns an array of the header that it found
- .hasHeader
- returns true if the header exists
- returns false if the header does not exist
- .deleteHeader
- deletes the given header from the headers list
- returns the deleted value
- does not delete anything if it cannot find the header
- .clearHeaders
- should remove all the headers from the headers variable
- .clone: be able to clone itself
- .toString: be able to create a string of itself
- should parse a URI from a valid string
- .parse does not parse a URI from an invalid string
- URI.parse with "SIP:%61liCE@versaTICA.Com:6060;TRansport=TCp;Foo=ABc;baz?X-Header-1=AaA1&X-Header-2=BbB&x-header-1=AAA2"
- produces a SIP.URI
- parses the scheme
- parses the user
- parses the host
- parses the port
- parses non-null parameter "transport"
- doesn't parse missing parameter "nooo"
- parses non-null parameter foo
- parses null parameter baz
- parses header list x-header-1
- parses header X-HEADER-2
- doesn't parse missing header "nooo"
- correctly toString()s itself
- correctly toRaw()s itself
- when setting the user to "Iñaki:PASSWD"
- sets the user correctly
- can delete parameter "foo" and delete header "x-header-1"
- can clear parameters and headers, and nullify the port
- WebRTC.MediaHandler
- sets mediaStreamManager if passed to constructor
- echoes MediaStreamManager events
- initializes mute state info
- .render
- doesn't throw if renderHint and this.mediaHint are missing
- .getLocalStreams
- returns peerConnection.getLocalStreams()
- .getRemoteStreams
- returns peerConnection.getRemoteStreams()
- .mute
- sets audio and video muted to true if they are both present (no options)
- sets audio and video muted to true if they are both present (options)
- only sets video if audio is not present
- only sets audio if video is not present
- sets neither if neither is present and does not emit muted
- sets neither if both are already muted and does not emit muted
- .unmute
- sets audio and video muted to false if they are both present (no options)
- sets audio and video muted to false if they are both present (options)
- only sets video if audio is not present
- onlys set audio if video is not present
- sets neither if neither is present and does not emit unmuted
- sets neither if both are already unmuted and does not emit unmuted
- .isMuted
- returns the audioMuted and videoMuted variables
- .toggleMuteAudio
- sets enabled to false
- sets enabled to true
- does not set enabled
- .toggleMuteVideo
- sets enabled to false
- sets enabled to true
- does not set enabled
- .setDescription
- emits setDescription before creating RTCSessionDescription
- .getReferMedia
- returns audio-only constraints if local audio/video and remote audio
- .prepareIceServers
- returns the expected structure for a single url
- returns the expected structure for multiple urls
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement