Advertisement
Guest User

Untitled

a guest
Jul 25th, 2016
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 69.26 KB | None | 0 0
  1. 974 specs, 0 failures, 41 pending specs
  2.  
  3. An INVITE sent from a UAC
  4. inits instance attributes
  5. has a custom .data attribute
  6. sends an INVITE on the WebSocket PENDING WITH MESSAGE: Temporarily disabled with xit
  7. has no dialogs at first
  8. following RFC3261 request generation rules (8.1.1)
  9. contains minimum header fields
  10. sets the Request-URI to the To URI
  11. sets the To URI from the given target
  12. must not contain a To tag
  13. sets the From URI from the UA
  14. contains a From tag
  15. generates a new Call-ID PENDING WITH MESSAGE: Temporarily disabled with xit
  16. guarantees no other UA will inadvertently overlap Call-IDs PENDING WITH MESSAGE: Temporarily disabled with xit
  17. generates a valid CSeq
  18. sets the Max-Forwards to 70
  19. the Via header
  20. uses SIP/2.0
  21. has a branch parameter
  22. has a Contact with one valid SIP URI
  23. declares Support for UA-supported extensions PENDING WITH MESSAGE: Temporarily disabled with xit
  24. must declare Support only for RFC-defined extensions PENDING WITH MESSAGE: Temporarily disabled with xit
  25. with options.media
  26. not defined, defaults to audio+video
  27. defined as constraints, follows those constraints
  28. TODO defined as stream, uses the stream PENDING WITH MESSAGE: Temporarily disabled with xit
  29. TODO defined as manager, uses the manager PENDING WITH MESSAGE: Temporarily disabled with xit
  30. with options.mediaStream
  31. with options.rtcConstraints
  32. with options.extraHeaders
  33. with options.params
  34. with options.anonymous
  35. with options.stunServers
  36. with options.turnServers
  37. with options.offer
  38. with options.renderBody
  39. with options.renderType
  40. with options.rel100
  41. when receiving a 1xx response
  42. fires the `progress` event
  43. when receiving a 2xx response
  44. fires the `accepted` event PENDING WITH MESSAGE: Temporarily disabled with xit
  45. sends an ACK PENDING WITH MESSAGE: Temporarily disabled with xit
  46. when receiving a 3xx-6xx response
  47. fires the `rejected` event PENDING WITH MESSAGE: Temporarily disabled with xit
  48. sends an ACK PENDING WITH MESSAGE: Temporarily disabled with xit
  49. when terminated
  50. before it has been accepted
  51. by a [3-6]xx response
  52. (300)
  53. fires a `rejected` event
  54. fires a `failed` event
  55. fires a `terminated` event
  56. (302)
  57. fires a `rejected` event
  58. fires a `failed` event
  59. fires a `terminated` event
  60. (400)
  61. fires a `rejected` event
  62. fires a `failed` event
  63. fires a `terminated` event
  64. (404)
  65. fires a `rejected` event
  66. fires a `failed` event
  67. fires a `terminated` event
  68. (500)
  69. fires a `rejected` event
  70. fires a `failed` event
  71. fires a `terminated` event
  72. (503)
  73. fires a `rejected` event
  74. fires a `failed` event
  75. fires a `terminated` event
  76. (600)
  77. fires a `rejected` event
  78. fires a `failed` event
  79. fires a `terminated` event
  80. (603)
  81. fires a `rejected` event
  82. fires a `failed` event
  83. fires a `terminated` event
  84. by a system error
  85. (onRequestTimeout)
  86. fires a `failed` event
  87. fires a `terminated` event
  88. does not fire a `rejected` event
  89. (onDialogError)
  90. fires a `failed` event
  91. fires a `terminated` event
  92. does not fire a `rejected` event
  93. using the `cancel` method
  94. fires a `cancel` event
  95. does not immediately fire `rejected`
  96. does not immediately fire `failed`
  97. does not immediately fire `terminated`
  98. after receiving a 487
  99. fires a `rejected` event
  100. fires a `failed` event
  101. fires a `terminated` event
  102. using the `terminate` method
  103. uses `cancel`
  104. does not fire `terminated` on its own
  105. after it has been accepted
  106. cannot be canceled
  107. by a BYE request
  108. fires a `bye` event
  109. fires a `terminated` event
  110. does not fire a `rejected` or `failed` event
  111. using the `bye` method
  112. fires a `bye` event
  113. fires a `terminated` event
  114. does not fire a `rejected` or `failed` event
  115. by a system failure
  116. fires a `bye` event PENDING WITH MESSAGE: Temporarily disabled with xit
  117. sends a BYE with a reason PENDING WITH MESSAGE: Temporarily disabled with xit
  118. fires a `terminated` event PENDING WITH MESSAGE: Temporarily disabled with xit
  119. does not fire a `rejected` or `failed` event PENDING WITH MESSAGE: Temporarily disabled with xit
  120. using the `terminated` method
  121. uses `bye`
  122. fires `terminated` synchronously with the bye
  123. does not fire the `failed` event
  124.  
  125. A UAS receiving an INVITE
  126. without SDP
  127. creates an invite server context with the UA's mediaHandlerFactory, the ISC emits invite
  128. with 100rel unsupported
  129. sending a progress response
  130. sends 100 unreliably with no body
  131. sends 1xx unreliably with no body
  132. with 100rel supported
  133. sending a progress response
  134. sends 100 unreliably with no body
  135. sends 1xx unreliably with no body
  136. SPEC HAS NO EXPECTATIONS sends 1xx reliably with a body, when rel100 specified
  137. with 100rel required
  138. sending a progress response
  139. sends 100 unreliably with no body
  140. SPEC HAS NO EXPECTATIONS sends 1xx reliably with a body
  141. with a Replaces header
  142. matching another dialog
  143. with "replaces" supported
  144. SPEC HAS NO EXPECTATIONS emits "replaced" on the replaced session, then terminates it
  145. with "replaces" unsupported
  146. SPEC HAS NO EXPECTATIONS neither emits "replaced" on the replaced session, nor terminates it
  147. that is then terminated
  148. cannot cancel the request
  149. before it has been accepted
  150. by a [3-6]xx response
  151. (300)
  152. fires a `rejected` event
  153. fires a `failed` event
  154. fires a `terminated` event
  155. (302)
  156. fires a `rejected` event
  157. fires a `failed` event
  158. fires a `terminated` event
  159. (400)
  160. fires a `rejected` event
  161. fires a `failed` event
  162. fires a `terminated` event
  163. (404)
  164. fires a `rejected` event
  165. fires a `failed` event
  166. fires a `terminated` event
  167. (500)
  168. fires a `rejected` event
  169. fires a `failed` event
  170. fires a `terminated` event
  171. (503)
  172. fires a `rejected` event
  173. fires a `failed` event
  174. fires a `terminated` event
  175. (600)
  176. fires a `rejected` event
  177. fires a `failed` event
  178. fires a `terminated` event
  179. (603)
  180. fires a `rejected` event
  181. fires a `failed` event
  182. fires a `terminated` event
  183. by a system error
  184. (onDialogError)
  185. fires a `failed` event
  186. fires a `terminated` event
  187. does not fire a `rejected` event
  188. by a CANCEL from the UAC
  189. fires a `cancel` event
  190. fires a `rejected` event
  191. fires a `failed` event
  192. fires a `terminated` event
  193. between being accepted and getting media
  194. does not fire an accepted event
  195. fires pre-acceptance events
  196. after it has been accepted
  197. by a BYE request
  198. fires a `bye` event
  199. fires a `terminated` event
  200. does not fire a `rejected` or `failed` event
  201. using the `bye` method
  202. fires a `bye` event
  203. fires a `terminated` event
  204. does not fire a `rejected` or `failed` event
  205. by a system failure
  206. fires a `bye` event PENDING WITH MESSAGE: Temporarily disabled with xit
  207. sends a BYE with a reason PENDING WITH MESSAGE: Temporarily disabled with xit
  208. fires a `terminated` event PENDING WITH MESSAGE: Temporarily disabled with xit
  209. does not fire a `rejected` or `failed` event PENDING WITH MESSAGE: Temporarily disabled with xit
  210.  
  211. MediaStreamManager
  212. throws an exception if WebRTC is not supported
  213. defines mediaHint and acquisitions
  214. .acquire({constraints})
  215. passes constraints to SIP.WebRTC.getUserMedia
  216. emits userMediaRequest before calling getUserMedia
  217. emits userMedia when getUserMedia calls a success callback
  218. asynchronously
  219. emits userMediaFailed when getUserMedia calls a failure callback
  220. does not require local streams
  221. .release
  222. calls stop() on the tracks of the MediaStream it was passed
  223. .acquire({stream})
  224. .acquire ignores constraints and succeeds with the stream
  225. .acquire called twice in a row does not fail
  226. .release does not stop the stream's tracks
  227.  
  228. ClientContext
  229. sets the ua
  230. sets the logger
  231. sets the method
  232. sets the body
  233. has no body by default
  234. sets the contentType
  235. has no contentType by default
  236. initializes data
  237. checks that the target is not undefined
  238. checks that the target is valid
  239. creates a new outgoing request
  240. .send
  241. calls the send method
  242. returns itself
  243. .receiveResponse
  244. emits progress on a 100-199 response
  245. emits accepted on a 2xx response
  246. emits rejected and failed on all other responses
  247. .onRequestTimeout
  248. emits failed with a status code 0, null response, and request timeout cause
  249. .onTransportError
  250. emits failed with a status code 0, null response, and connection error cause
  251. .cancel
  252. calls request.cancel
  253. emits a cancel event
  254.  
  255. Dialogs
  256. sets the *_pending_reply properties
  257. returns an error if the message has no contact header
  258. sets the state correctly
  259. sets all settings for UAS
  260. sets all settings for UAC
  261. uses the mediaHandlerFactory of its owner session
  262. sets logger, owner, dialogs array, and logs
  263. .update
  264. sets the state to CONFIRMED and logs, doesn't set route set
  265. sets the state to CONFIRMED and logs, sets route set
  266. .terminate
  267. logs, and deletes the dialog from the ua dialogs array
  268. calls peerConnection.close if the dialog was in the EARLY state and there is an mediaHandler
  269. .createRequest
  270. returns a request with proper settings, doesn't increment local_seqnum
  271. returns a request with proper settings, increments local_seqnum
  272. .checkInDialogRequest
  273. sets the remote_seqnum if there is not one on the Dialog
  274. replies 500 to a non-ACK request where the request cseq is less than the Dialog cseq
  275. 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
  276. 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
  277. sets the remote seqnum to the request cseq if it is initally less
  278. replies 491 if the request method is INVITE and uac_pending_reply is true
  279. replies 500 and returns false if the request method is INVITE and uac_pending_reply is true
  280. 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
  281. 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
  282. returns true and calls server.transaction.on once if the request method is NOTIFY and the request has a contact header
  283. .sendRequest
  284. calls requestsender.send PENDING WITH MESSAGE: Temporarily disabled with xit
  285. .receiveRequest
  286. does not call owner.receiveRequest if checkInDialogRequest returns false
  287. calls owner.receiveRequest if checkInDialogRequest returns false
  288.  
  289. EventEmitter
  290. starts with no events
  291. checks for events with listeners
  292. .on
  293. only accepts functions
  294. calls the callback synchronously on emission
  295. calls the callback over and over
  296. binds to the emitter by default
  297. .once
  298. adds a listener
  299. calls the callback synchronously on emission
  300. calls the callback just one time
  301. binds to the emitter by default
  302. returns this
  303. .off
  304. removes the matching listener
  305. removes once listeners
  306. can remove all listeners for an event
  307. does not affect other events
  308. can shut off an object entirely
  309. returns this
  310. .emit
  311. handles no listeners gracefully
  312. calls the callbacks
  313. binds to the parent object
  314. ignores off listeners
  315. passes arguments to callback
  316.  
  317. Grammar
  318. Contacts parsed from '"Iñaki @ł€" <SIP:+1234@ALIAX.net;Transport=WS>;+sip.Instance="abCD", sip:bob@biloxi.COM;headerParam, <sips:DOMAIN.com:5>'
  319. first contact
  320. is a NameAddrHeader
  321. has the display name
  322. has parameter +sip.instance set to "abCD"
  323. doesn't have parameter nooo
  324. its URI
  325. is a SIP.URI
  326. has scheme: "sip"
  327. has user: "+1234"
  328. has host: "aliax.net"
  329. has port: undefined
  330. getParam("transport") is "ws"
  331. getParam("foo") is undefined
  332. getHeader("X-Header") is undefined
  333. can alter display name and URI parameters
  334. second contact
  335. has displayName: undefined
  336. hasParam("HEADERPARAM") is true
  337. toString("null") is "<sip:bob@biloxi.com>;headerparam"
  338. its URI
  339. is a SIP.URI
  340. has scheme: "sip"
  341. has user: "bob"
  342. has host: "biloxi.com"
  343. has port: undefined
  344. hasParam("headerParam") is false
  345. can alter display name
  346. third contact
  347. has displayName: undefined
  348. toString("null") is "<sips:domain.com:5>"
  349. its URI
  350. is a SIP.URI
  351. has scheme: "sips"
  352. has user: undefined
  353. has host: "domain.com"
  354. has port: 5
  355. hasParam("nooo") is false
  356. can set header params and uri params
  357. Via parsed from "SIP / 3.0 / UDP [1:ab::FF]:6060 ; BRanch=1234;Param1=Foo;paRAM2;param3=Bar"
  358. has protocol: "SIP"
  359. has transport: "UDP"
  360. has host: "[1:ab::FF]"
  361. has host_type: "IPv6"
  362. has port: 6060
  363. has branch: "1234"
  364. has params: {"param1":"Foo","param3":"Bar"}
  365. CSeq parsed from "123456 CHICKEN"
  366. has value: 123456
  367. has method: "CHICKEN"
  368. challenge parsed from 'Digest realm = "[1:ABCD::abc]", nonce = "31d0a89ed7781ce6877de5cb032bf114", qop="AUTH,autH-INt", algorithm = md5 , stale = TRUE , opaque = "00000188"'
  369. has realm: "[1:ABCD::abc]"
  370. has nonce: "31d0a89ed7781ce6877de5cb032bf114"
  371. has qop: ["auth","auth-int"]
  372. has algorithm: "MD5"
  373. has stale: true
  374. has opaque: "00000188"
  375. Event parsed from "Presence.winfo;Param1=QWe;paraM2"
  376. has event: "presence.winfo"
  377. has params: {"param1":"QWe"}
  378. Content-Disposition
  379. has type: "session"
  380. has type: "render"
  381. parsing a UUID
  382. returns the input for correct UUIDs
  383. returns -1 for incorrect UUIDs
  384. Replaces
  385. parses the good examples
  386. rejects the bad examples
  387.  
  388. NameAddrHeader
  389. has the display name
  390. can create a string of itself
  391. can set the display name to null
  392. can set the display name to 0
  393. can set the display name to ""
  394. has an empty parameters object
  395. when setting parameter Foo to null
  396. has parameter FOO
  397. when setting parameter Baz to 123
  398. has parameter baz set to "123"
  399. can create a string of itself
  400. can delete parameter bAz
  401. can clear its parameters
  402. when cloning itself
  403. has the same string representation as its clone
  404. can set the display name of the clone
  405. has an undefined user
  406. 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')
  407. returns a SIP.NameAddrHeader
  408. parses the display name
  409. has parameter "qwe"
  410. gets parameter "qwe" as "QWE"
  411. has parameter "asd"
  412. gets parameter "asd" as null
  413. doesn't have parameter "nooo"
  414. can set the display name to "Foo Bar"
  415. can set the display name to null
  416. its URI:
  417. parses the scheme
  418. parses the user
  419. parses the host
  420. parses the port
  421. hasParam("transport") is true
  422. getParam("transport") is "tcp"
  423. hasParam("nooo") is false
  424. getParam("foo") is "abc"
  425. getParam("baz") is null
  426. getParam("noo") is undefined
  427. getHeader("x-header-1") is ["AaA1","AAA2"]
  428. getHeader("X-HEADER-2") is ["BbB"]
  429. getHeader("nooo") is undefined
  430.  
  431. Utils.normalizeTarget
  432. fails to normalize "alice" on no domain
  433. when the domain is "sip.js.net"
  434. normalizes "%61lice" to "sip:alice@sip.js.net"
  435. normalizes "ALICE" to "sip:ALICE@sip.js.net"
  436. normalizes "alice@DOMAIN.com" to "sip:alice@domain.com"
  437. normalizes "iñaki" to "sip:i%C3%B1aki@sip.js.net"
  438. normalizes "€€€" to "sip:%E2%82%AC%E2%82%AC%E2%82%AC@sip.js.net"
  439. normalizes "iñaki@aliax.net" to "sip:i%C3%B1aki@aliax.net"
  440. normalizes "SIP:iñaki@aliax.net:7070" to "sip:i%C3%B1aki@aliax.net:7070"
  441. normalizes "SIPs:iñaki@aliax.net:7070" to "sip:i%C3%B1aki@aliax.net:7070"
  442. normalizes "ibc@gmail.com@aliax.net" to "sip:ibc%40gmail.com@aliax.net"
  443. normalizes "alice-1:passwd" to "sip:alice-1:passwd@sip.js.net"
  444. normalizes "SIP:alice-2:passwd" to "sip:alice-2:passwd@sip.js.net"
  445. normalizes "sips:alice-2:passwd" to "sip:alice-2:passwd@sip.js.net"
  446. normalizes "alice-3:passwd@domain.COM" to "sip:alice-3:passwd@domain.com"
  447. normalizes "SIP:alice-4:passwd@domain.COM" to "sip:alice-4:passwd@domain.com"
  448. normalizes "sip:+1234@aliax.net" to "sip:+1234@aliax.net"
  449. normalizes "+999" to "sip:+999@sip.js.net"
  450. normalizes "*999" to "sip:*999@sip.js.net"
  451. normalizes "#999/?:1234" to "sip:%23999/?:1234@sip.js.net"
  452. normalizes "tel:+12345678" to "sip:+12345678@sip.js.net"
  453. normalizes "tel:(+34)-944-43-89" to "sip:+349444389@sip.js.net"
  454. normalizes "+123.456.78-9" to "sip:+123456789@sip.js.net"
  455. normalizes "+ALICE-123.456.78-9" to "sip:+ALICE-123.456.78-9@sip.js.net"
  456. fails to normalize null
  457. fails to normalize undefined
  458. fails to normalize null
  459. fails to normalize false
  460. fails to normalize true
  461. fails to normalize ""
  462. fails to normalize "ibc@iñaki.com"
  463. fails to normalize "ibc@aliax.net;;;;;"
  464.  
  465. RegisterContext
  466. initialize instance variables
  467. .register
  468. sets up the receiveResponse function
  469. sets up the onRequestTimeout function
  470. sets up the onTransportError function
  471. sends params and the extra headers
  472. retries with the min-expires header on 423
  473. fails registration on 423 with no min-expires header
  474. sets its closeHeaders property if options.closeWithHeaders flag is true
  475. .registrationFailure
  476. emits failed with the response and cause provided to it
  477. emits failed with null and the cause provided if no response is provided
  478. does not unregister
  479. .onTransportClosed
  480. takes the registered variable and move it to registered_before variable
  481. clears the registration timer if it is set
  482. calls unregistered if it is registered
  483. .onTransportConnected
  484. calls register
  485. .close
  486. takes registered and move it to registered_before
  487. calls unregister with closeHeaders
  488. .unregister
  489. does nothing if the registered variable is false
  490. changes registered variable to false if it was true
  491. clears the registration timer
  492. pushes extra headers Contact: *, Expires: 0 if options.all is truthy
  493. even when unregistered, pushes extra headers Contact: *, Expires: 0 if options.all is truthy
  494. pushes extra headers Contact: <contact>, Expires: 0 if options.all is falsy
  495. calls send with the params call_id, and cseq+=1
  496. defines receiveResponse
  497. defines onRequestTimeout
  498. defines onTransportError
  499. .unregistered
  500. sets RegisterContext.registered to false if RegisterContext.registered is true
  501. sets RegisterContext.registered to false if RegisterContext.registered is false
  502. emits unregistered with the response and cause passed to it
  503. emits unregistered with a null response and a null cause if one is not provided
  504.  
  505. SIPMessage
  506. OutgoingRequest
  507. sets up instance variables
  508. .setHeader
  509. sets the headers headerized name property to an array of the value
  510. sets the headers headerized name property to the array passed to it
  511. .getHeader
  512. returns the header that exists
  513. returns the header from extra headers if it is not in headers
  514. returns undefined if the header does not exist in headers or extraHeaders
  515. .getHeaders
  516. returns all of the headers in an array with the given name
  517. returns all the headers in an array with the given name from extraHeaders if the header is not in headers
  518. returns an empty array if the header is not found in headers and the header is not found in extraHeaders
  519. .hasHeader
  520. returns true if the header exists in headers
  521. returns true if the header exists in extraHeaders
  522. returns false if the header does not exist in headers or extraHeaders
  523. .toString
  524. calculates the correct Content-lenght for a given body
  525. IncomingRequest
  526. initialize the instance variables
  527. .addHeader
  528. creates the header in the headers object if it does not already exist
  529. adds the header to the array in the headers object if it already exists
  530. .getHeader
  531. returns undefined if the header does not exist
  532. returns the value of the header that exists
  533. returns the first header value if multiple values exist
  534. .getHeaders
  535. returns an empty array if the header does not exist
  536. returns an array with one value if there is only one value for the header provided
  537. returns an array with all of the values if they exist for the header provided
  538. .hasHeader
  539. returns true if the header exists
  540. returns false if the header does not exist
  541. .parseHeader
  542. returns undefined if the header does not exist in the headers object
  543. returns undefined if the idx is greater than the array for the header that exists
  544. returns the already parsed header if it exists
  545. returns a newly parsed header and creates a parsed property
  546. .setHeader
  547. adds the header if it does not alredy exist
  548. replaces a header that already exists
  549. .toString
  550. returns the data instance variable
  551. .reply
  552. throws a TypeError if no code exists
  553. throws a TypeError if the code is less than 100 or greater than 699
  554. throws a TypeError if a valid code is provided but reason is not a string
  555. .reply_sl
  556. IncomingResponse
  557. initialize the instance variables
  558. .addHeader
  559. creates the header in the headers object if it does not already exist
  560. adds the header to the array in the headers object if it already exists
  561. .getHeader
  562. returns undefined if the header does not exist
  563. returns the value of the header that exists
  564. returns the first header value if multiple values exist
  565. .getHeaders
  566. returns an empty array if the header does not exist
  567. returns an array with one value if there is only one value for the header provided
  568. returns an array with all of the values if they exist for the header provided
  569. .hasHeader
  570. returns true if the header exists
  571. returns false if the header does not exist
  572. .parseHeader
  573. returns undefined if the header does not exist in the headers object
  574. returns undefined if the idx is greater than the array for the header that exists
  575. returns the already parsed header if it exists
  576. returns a newly parsed header and creates a parsed property
  577. .setHeader
  578. adds the header if it does not alredy exist
  579. replaces a header that already exists
  580. .toString
  581. returns the data instance variable
  582.  
  583. SanityCheck
  584. for all IncomingMessages
  585. minimumHeaders check
  586. accepts messages with minimum headers
  587. accepts messages with mininum short-form headers
  588. rejects messages with no From header
  589. rejects messages with no To header
  590. rejects messages with no Call-Id header
  591. rejects messages with no CSeq header
  592. rejects messages with no Via header
  593. for IncomingRequests
  594. rfc3261 check
  595. 8.2.2.1
  596. rejects requests with an invalid RURI scheme
  597. does not examine the To header PENDING WITH MESSAGE: Temporarily disabled with xit
  598. 16.3.4
  599. rejects messages from itself as loops
  600. accepts messages from other places
  601. 18.3_request
  602. rejects messages that are too short
  603. accepts messages with no Content-Length
  604. truncates messages that are too long
  605. 8.2.2.2
  606. rejects merged INVITE requests
  607. rejects very different matching INVITE requests
  608. rejects merged non-INVITE requests
  609. rejects very different matching non-INVITE requests
  610. for IncomingResponses
  611. rfc3261 check
  612. 8.1.3.3
  613. drops messages with two vias
  614. 18.1.2
  615. drops messages with inappropriate via sent-by host
  616. drops messages with inappropriate via sent-by port
  617. accepts messages with correct via sent-by host
  618. 18.3_response
  619. drops messages that are too short
  620. accepts messages with no Content-Length
  621. truncates messages that are too long
  622.  
  623. ServerContext
  624. sets the ua
  625. sets the logger
  626. sets the method
  627. sets the request
  628. sets the body
  629. sets the contentType
  630. sets the transaction based on the request method
  631. initializes data
  632. .progress
  633. defaults to status code 180 if none is provided
  634. throws an error with an invalid status code
  635. calls reply with a valid status code and passes along a reason phrase, extra headers, and body
  636. emits event progress with a valid status code and response
  637. returns itself
  638. .accept
  639. defaults to status code 200 if none is provided
  640. throws an error with an invalid status code
  641. calls reply with a valid status code and passes along a reason phrase, extra headers, and body
  642. emits event accepted with a valid status code and null response
  643. returns itself
  644. .reject
  645. defaults to status code 480 if none is provided
  646. throws an error with an invalid status code
  647. calls reply with a valid status code and passes along a reason phrase, extra headers, and body
  648. emits event rejected and event fails with a valid status code and null response and reasonPhrase for a cause
  649. returns itself
  650. .reply
  651. passes along the status code, reason phrase, header, and body as is to request reply
  652. returns itself
  653. .onRequestTimeout
  654. emits failed with a status code 0, null response, and request timeout cause
  655. .onTransportError
  656. emits failed with a status code 0, null response, and connection error cause
  657.  
  658. Session
  659. initializes session objects
  660. initializes session timers
  661. initializes session info
  662. initializes mute/hold state info
  663. initializes the pending actions array and functions
  664. .pending_actions
  665. .length
  666. returns the length
  667. .isPending
  668. returns true for objects that are present
  669. returns false for objects that are not present
  670. .shift
  671. returns foo and leaves bar as the only element in the array
  672. .push
  673. adds seven to the array
  674. .pop
  675. removes foo from the array
  676. initializes early_sdp, and rel100
  677. .dtmf
  678. throws an error if tones is undefined
  679. throws an error if the session status is incorrect
  680. throws an error if tones is the wrong type
  681. accepts a string argument
  682. throws an error if tone duration is invalid PENDING WITH MESSAGE: Temporarily disabled with xit
  683. resets duration to 70 if it's too low PENDING WITH MESSAGE: Temporarily disabled with xit
  684. resets duration to 6000 if it's too high PENDING WITH MESSAGE: Temporarily disabled with xit
  685. resets duration to positive if it's negative PENDING WITH MESSAGE: Temporarily disabled with xit
  686. throws an error if interToneGap is invalid PENDING WITH MESSAGE: Temporarily disabled with xit
  687. queues up tones if tones are already queued
  688. sets tones if no tones are queued PENDING WITH MESSAGE: Temporarily disabled with xit
  689. returns Session on success
  690. .bye
  691. logs an error and returns this if the session status is terminated
  692. emits bye and terminated on any status code >= 200
  693. throws an error for any other status code
  694. .refer
  695. throws an error if target is undefined
  696. throws an error if target is not an Session and status is not confirmed
  697. returns Session on success
  698. .sendRequest
  699. returns Session on success
  700. .close
  701. returns Session if the status is terminated
  702. deletes the session from the ua, deletes the dialog, and returns the Session on success
  703. .createDialog
  704. returns true and puts the dialog in the early dialogs array on a success call with early = true, type = UAS
  705. returns true and puts the dialog in the early dialogs array on a success call with early = true, type = UAC
  706. returns false if early_dialog.error is true when early = true
  707. creates an early dialog, then updates it; returns true, no longer in early dialog array
  708. returns false if dialog.error is true when early = false
  709. returns true on a call where early = false
  710. .isReadyToReinvite
  711. returns false if mediaHandler.isReady() returns false
  712. returns false if either of the pending_reply options are true
  713. returns true if all above conditions are met
  714. .hold
  715. throws an error if the session is in the incorrect state
  716. does not emit hold if local hold is true
  717. emits hold on success
  718. .unhold
  719. throws an error if the session is in the incorrect state
  720. does not emit unhold if local hold is false
  721. emits unhold on success
  722. .isOnHold
  723. returns the values of local_hold and remote_hold
  724. .receiveReinvite
  725. does not call setDescription and replies with 415 if contentType is not application/sdp
  726. calls setDescription on success
  727. .sendReinvite
  728. on success, sets receiveResponse, reinviteSucceeded, and reinviteFailed, and calls getDescription
  729. .receiveReinviteResponse
  730. returns without calling sendRequest or reinviteFailed when status is terminated
  731. returns without calling sendRequest or reinviteFailed when response status code is 1xx
  732. calls reInviteFailed when the response has no body with a 2xx status code
  733. calls reInviteFailed when the response's content-type is not application/sdp with a 2xx status code
  734. calls sendRequest and setDescription when response has a 2xx status code, a body, and content-type of application/sdp
  735. returns without calling sendRequest or reinviteFailed when response status code is neither 1xx or 2xx
  736. .acceptAndTerminate
  737. calls sendRequest twice and returns Session on success
  738. calls createDialog if this.dialog is null
  739. .setInvite2xxTimer
  740. defines timers.invite2xxTimer
  741. .setACKTimer
  742. defines timers.ackTimer
  743. .onReadyToReinvite
  744. returns without calling hold/unhold if pending_actions is empty
  745. calls hold if that is the next action
  746. calls unhold if that is the next action
  747. .onTransportError
  748. does not call failed if the status is terminated
  749. does not call failed if the status is terminated
  750. calls failed if the status is neither terminated or confirmed
  751. .onRequestTimeout
  752. does not call failed or terminated if the status is terminated
  753. calls terminated if the status is confirmed
  754. calls failed if the status is neither terminated or confirmed
  755. .onDialogError
  756. does not call failed or terminated if the status is terminated
  757. calls terminated if the status is confirmed
  758. calls failed if the status is neither terminated or confirmed
  759. .onhold
  760. sets local_hold to true and emits hold when originator is local
  761. sets remote_hold to true and emits hold when originator is remote
  762. .onunhold
  763. sets local_hold to false and emits unhold when originator is local
  764. sets remote_hold to false and emit unhold when originator is remote
  765. .onmute
  766. emits muted
  767. .onunmute
  768. emits unmuted
  769. .failed
  770. emits and returns Session
  771. .rejected
  772. emits and returns Session
  773. .refer
  774. emits and returns Session PENDING WITH MESSAGE: Temporarily disabled with xit
  775. .canceled
  776. emits, and returns Session
  777. .accepted
  778. calls emit, sets a startTime, and returns Session
  779. .terminated
  780. calls close, emits, sets an endTime, and returns Session
  781. .connecting
  782. calls emit
  783.  
  784. InviteServerContext
  785. sets contentDisp correctly
  786. replies 415 from non-application/sdp content-type with a session content-disp
  787. calls augment using ServerContext and Session
  788. sets status, from_tag, id, request, contact, logger, and sessions
  789. sets 100rel, requires
  790. sets 100rel, supported
  791. replies 500 and returns if the createDialog call fails
  792. calls fireNewSession if request.body is null
  793. calls mediaHandler.setDescription otherwise PENDING WITH MESSAGE: Temporarily disabled with xit
  794. .reject
  795. throws an invalid state error is the status is terminated
  796. throws a type error when the status code is valid and less than 300
  797. replies to the request (480 is default)
  798. calls rejected, failed, and terminated
  799. calls close
  800. returns the InviteServerContext object
  801. .terminate
  802. emits bye and calls terminated if the status is WAITING_FOR_ACK
  803. sets the dialog in the ua dialogs array if the status is WAITING_FOR_ACK
  804. calls bye if the status is CONFIRMED
  805. calls reject if the status is neither WAITING_FOR_ACK or CONFIRMED
  806. .accept
  807. changes status to ANSWERED_WAITING_FOR_PRACK and returns this if status is WAITING_FOR_PRACK
  808. throws Invalid State Error if status is not WAITING_FOR_PRACK, WAITING_FOR_ANSWER, or EARLY_MEDIA
  809. replies 500 and returns this if createDialog fails
  810. clears the userNoAnswerTimer
  811. 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
  812. does not call getDescription and returns this when the status is EARLY_MEDIA
  813. calls getDescription and returns this on a successful call where the status is not EARLY_MEDIA
  814. .receiveRequest
  815. method is CANCELED
  816. status is WAITING_FOR_ANSWER, timers cleared
  817. status is WAITING_FOR_PRACK, timers cleared
  818. status is ANSWERED_WAITING_FOR_PRACK, timers cleared
  819. status is EARLY_MEDIA, timers cleared
  820. status is ANSWERED, timers cleared
  821. method is ACK
  822. calls mediaHandler.setDescription when the ACK contains an answer to an invite w/o sdp
  823. calls confirmSession if session.early_sdp is true and above is false
  824. calls failed if the above two conditions are not true
  825. calls confirmSession if there was an invite w/ sdp originally
  826. method is PRACK
  827. calls mediaHandler.setDescription when the invite had no body, but the request had sdp
  828. calls terminate and failed when invite has no body, but the request has a non-sdp body
  829. calls reply(200) and other smaller things when the invite had a body (accept not called)
  830. calls reply(200) and other smaller things when the invite had a body (accept also called)
  831. method is BYE
  832. replies 200, emits bye, and terminates
  833. method is INVITE
  834. calls receiveReinvite
  835. method is INFO
  836. makes a new DTMF
  837. returns a 415 if DTMF packet had the wrong content-type header
  838. SPEC HAS NO EXPECTATIONS invokes onInfo if onInfo is set
  839. method is REFER
  840. replies 202, then calls callback and terminate if there is a session.followRefer listener
  841.  
  842. InviteClientContext
  843. throws a type error if target is undefined
  844. throws a not supported error if WebRTC is not supported
  845. throws a type error if normalizeTarget fails with the given target
  846. calls augment using ClientContext and Session
  847. throws an invalid state error if the status is null
  848. sets several parameters at the end of the constructor
  849. throws a type error if invalid stun servers are passed in
  850. throws a type error if invalid turn servers are passed in
  851. sets anonymous, custom data, and contact
  852. sets ua.applicants, request, local and remote identity, id, and logger
  853. .invite
  854. sets MediaHandler and ua.sessions
  855. calls mediaHandler.getDescription async and returns this on success
  856. .receiveInviteResponse
  857. accepts and terminates a 200 OK from a branch that's replying after the call has been established
  858. emits failed if the branch on which early media was established is not the branch that picks up first (invite w/ sdp case)
  859. ACKs any 200 OKs from the branch on which the call is up after the initial 200 OK
  860. PRACKS any non 200 response that are not retransmissions when it already chose a dialog
  861. cancels the request if the call was canceled and the response is 1xx
  862. accepts and terminates the response if the call was canceled and the response is 2xx
  863. sets received_100 to true when the response is 100
  864. the response status code is 101-199
  865. logs a warning and breaks if the response does not have a to tag
  866. creates a dialog if the response has a contact; breaks if createDialog doesn't return correctly
  867. changes the status to 1XX_RECEIVED and emits progress
  868. 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
  869. does not PRACK a response with no body (and requires: 100rel) if there is an illegal rseq header
  870. PRACKs (when require: 100rel is present) a response without a body
  871. calls MediaHandler.setDescription for a response with a body with require: 100rel and confirms the dialog
  872. 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
  873. the response status code is 2xx
  874. returns after doing nothing because of an incorrect cseq (same as below, but the cseq is not reset)
  875. sets the status to confirmed, ACKS, and calls accepted if the status was earlyMedia
  876. returns after doing nothing because there is already a confirmed dialog (same conditions as below otherwise
  877. calls acceptAndTerminate and failed if the response has no body
  878. 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
  879. calls mediaHandler.setDescription if the request had no body and the response had no early dialog with media connected to it
  880. same as above, but does not make the call if the createDialog fails
  881. calls mediaHandler.setDescription if the request has a body
  882. same as above, but does not make the call if the createDialog fails
  883. calls failed, rejected for any other response code
  884. .cancel
  885. throws an invalid state error if the status is TERMINATED
  886. throws a type error if the status code is invalid or less than 200
  887. sets isCanceled to true, calls canceled, and returns this if status is NULL
  888. sets isCanceled to true, calls canceled, and returns this if status is INVITE_SENT and received_100 is false
  889. calls request.cancel, canceled, and returns this if status is INVITE_SENT and received_100 is true
  890. calls request.cancel, canceled, and returns this if status is 1XX_RECEIVED
  891. .terminate
  892. calls bye and returns this if the status is WAITING_FOR_ACK
  893. calls bye and returns this if the status is CONFIRMED
  894. calls cancel and returns this if the status is anything else
  895. .receiveRequest
  896. 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
  897. replies 200 and emits bye and terminated if the request method is BYE
  898. logs and calls receiveReinvite if request method is INVITE
  899. 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
  900. DTMF case PENDING WITH MESSAGE: Temporarily disabled with xit
  901. logs, replies 202, then calls callback and terminate if session.followRefer listener present
  902. logs then 603 Declines if no session.followRefer listener present
  903.  
  904. Subscription
  905. initialization
  906. sets id and state
  907. throws a type error if event is not set
  908. sets expires to 3600 if nothing is passed, or a non-number is passed
  909. allows expires less than 3600
  910. sets expires to a valid number passed in
  911. sets body if body is passed in
  912. sets the contact
  913. calls augment with ClientContext
  914. sets logger, dialog, timers, and error codes
  915. .subscribe
  916. calls clearTimeout on each of the timers
  917. sets Timer_N to fire timer_fire after TIMER_N time
  918. calls send
  919. sets the state to notify_wait (that rhymes)
  920. returns the Subscription
  921. .receiveResponse
  922. calls fail if the status code is one of the error codes
  923. calls clearTimeout on Timer N
  924. creates a dialog, sets the id, emits accepted, and puts this subscription in the ua's subscriptions array
  925. sets the sub_duration timer if there was a valid expires header
  926. calls failed and warns if expires header was missing
  927. calls close, failed, and warns if expires header was higher than original offer
  928. .unsubscribe
  929. sets the state to terminated
  930. sends a request using the same dialog as the subscription
  931. calls clearTimeout on each of the timers
  932. sets Timer_N to fire timer_fire after TIMER_N time
  933. .timer_fire
  934. calls terminateDialog if state is terminated
  935. calls clearTimeout on both timers if state is terminated
  936. deletes the subscription from the UA if state is terminated
  937. calls close if the state is pending or notify_wait
  938. calls refresh for all other states (active, init)
  939. .close
  940. calls unsubscribe if the state is not terminated or notify_wait
  941. .createConfirmedDialog
  942. creates a dialog, sets it to the subscription, and returns true on success
  943. returns false, doesn't set the dialog on dialog creation failure
  944. .terminateDialog
  945. terminates and deletes the subscription's dialog if it exists
  946. .receiveRequest
  947. replies 489 returns if matchEvent fails
  948. replies 200 if match event passes
  949. clear both timers
  950. emits notify
  951. if sub_state.state is active, changes state to active and sets the duration timer if there is an expires as well
  952. expires is not reset if under 3600
  953. expires is reset correctly if too high
  954. if sub_state.state is pending and current state is notify_wait, set sub_duration, otherwise just change state
  955. 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)
  956. if sub_state.state is terminated with reason deactivated or timeout and state is not terminated, the Subscription will be gracefully shut down
  957. 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
  958. if sub_state.state is terminated with reason rejected, noresource, or invariant, close will be called
  959. .failed
  960. calls close and emits failed
  961. .onDialogError
  962. does not throw an exception
  963. .matchEvent
  964. logs a warning and returns false if Event header is missing
  965. logs a warning and returns false if Subscription-State header is missing
  966. logs a warning, replies 481, and returns false if the events don't match
  967. returns true if none of the above happens
  968.  
  969. UA
  970. has no mandatory parameters
  971. can be created with just a string URI
  972. can be created with just a String (object) URI
  973. can be created with empty stunServers list
  974. sets the instance variables
  975. creates a new register context
  976. .start
  977. creates a SIP transport if the status is C.STATUS_INIT
  978. sets the status to ready and connect the transport if the status is C.STATUS_USER_CLOSED
  979. logs if the status is set to starting
  980. logs if the status is set to ready
  981. logs an error if the status is not C.STATUS_INIT, C.STATUS_STARTING, C.STATUS_USER_CLOSED, C.STATUS_READY
  982. returns itself
  983. does not register if not configured
  984. .stop
  985. logs a warning and returns this if the ua has already been closed
  986. clears the transportRecoveryTimer
  987. unregisters
  988. terminates any active sessions
  989. closes any active subscriptions
  990. closes any applicants
  991. disconnects from the Web Socket if there are no non-invite transactions left
  992. disconnects from the Web Socket if after transaction destroyed is emitted once there are no non-invite transactions left
  993. .register
  994. does not require any arguments
  995. sets the register configuration option to true
  996. calls the Register Context register method with the options that were passed to the method
  997. returns itself
  998. .unregister
  999. does not require any arguments
  1000. sets the register configuration option to false
  1001. calls the Register Context unregister method with the options that were passed to the method
  1002. returns itself
  1003. .isRegistered
  1004. returns the value stored by register context registered
  1005. .isConnected
  1006. returns false if the transport is undefined
  1007. returns transport.connected if the transport is defined
  1008. .message
  1009. throws an exception if body argument is missing
  1010. sets up a listener for connected if the transport has not connected
  1011. passes no options to message.send
  1012. creates a ClientContext with itself, target, body, options.contentType and options as parameters
  1013. calls ClientContext.send method with no options provided to it
  1014. .invite
  1015. sets up a listener for connected if the transport has not connected
  1016. creates an Invite Client Context with itself, target, and options as parameters
  1017. .subscribe
  1018. sets up a listener for connected if the transport has not connected
  1019. creates a Subscription with itself, target, and options as parameters
  1020. calls the Subscription method with no arguments
  1021. .request
  1022. sets up a listener for connected if the transport has not connected
  1023. creates a ClientContext with itself, the method, target and options provided
  1024. calls ClientContext.send method with no parameters
  1025. .normalizeTarget
  1026. calls SIP.Utils.normalizeTarget with the target and the hostport params
  1027. returns the result of calling SIP.Utils.normalizeTarget
  1028. .saveCredentials
  1029. should create the credentials realm object if it does not exist
  1030. adds the credentials uri to the credentials realm
  1031. returns itself
  1032. .getCredentials
  1033. returns undefined if the credentials are not found
  1034. returns the credentials that are found
  1035. .getLogger
  1036. calls this.log.getLogger function with the category and label passed to it and return the result
  1037. .onTransportClosed
  1038. .onTransportError
  1039. .onTransportConnected
  1040. .onTransportConnecting
  1041. emits a connecting event
  1042. .newTransaction
  1043. emits a newTransaction event
  1044. adds the trasaction to the transactions object
  1045. .destroyTransaction
  1046. emits a transactionDestroyed event
  1047. deletes the transaction from the transactions object
  1048. .receiveRequest
  1049. checks that the ruri points to us
  1050. replies with a 404 if the request method is not ACK
  1051. checks the transaction and returns if invalid
  1052. creates a new NIST if the SIP method is options
  1053. Accepts SIP MESSAGE requests
  1054. creates a ServerContext if the SIP method is anything besides options, message, invite, and ack PENDING WITH MESSAGE: Temporarily disabled with xit
  1055. sends a 488 if an invite is received but there is no WebRTC support
  1056. sends a 481 if a BYE is received
  1057. finds the session and call receiveRequest on the session if it exists if a CANCEL is received
  1058. logs a warning if the session does not exist if a CANCEL is a received
  1059. should not do nothing if an ACK is received
  1060. replies with a 481 if allowLegacyNotifications is false when a NOTIFY is received
  1061. replies with a 481 if allowLegacyNotifications is true, but no listener is set, when a NOTIFY is received
  1062. emits notified and replies 200 OK if allowLegacyNotifications is true, but no listener is set, when a NOTIFY is received
  1063. replies with a 405 if it cannot interpret the message
  1064. creates a new Invite Server Transaction and call receive request if it receives an in dialog invite request
  1065. should not create a new Invite Server Transaction and just call receive request if it receives an in dialog request other than invite
  1066. replies 481 on the request if the dialog is not found and the request is an invite
  1067. calls receiveRequest on the dialog if there is one
  1068. calls receive response on the session if it exists and the dialog does not for an in dialog notify request
  1069. replies with a 481 and subscription does not exist if an in dialog notify request is received and no dialog or session is found
  1070. replies with a 481 if an in dialog request is received that is not a NOTIFY OR ACK and no dialog is found
  1071. should not do anything if an ACK is received and no dialog is found
  1072. .findSession
  1073. returns the session based on the call_id and from_tag
  1074. returns the session based on the call_id and to_tag
  1075. returns null if the session is not found
  1076. .findDialog
  1077. returns the dialog based on the call_id and from_tag and to_tag
  1078. returns the dialog based on the call_id and to_tag and from_tag
  1079. returns null if the session is not found
  1080. .getNextWsServer
  1081. selects the candidate with the highest weight
  1082. selects one of the candidates with the highest weight
  1083. does not select a candidate that has a transport error
  1084. .closeSessionsOnTransportError
  1085. calls onTransportError for all the sessions in the sessions object
  1086. calls onTransportClosed on register context
  1087. .recoverTransport
  1088. logs if the next retry time exceeds the max_interval
  1089. calls getNextWsServer
  1090. sets the transportRecoveryTimer
  1091. logs before setting the transport recovery timer, then attempts to make a new transport
  1092. asynchronously
  1093. .loadConfig
  1094. sets default settings for many parameters
  1095. throws a configuration error when a mandatory parameter is missing
  1096. throws a configuration error if a mandatory parameter's passed-in value is invalid
  1097. sets a mandatory value successfully in settings
  1098. throws a ConfigurationError if an optional value is passed in which is invalid
  1099. sets an optional value successfully in settings
  1100. makes sure the connection recovery max interval is greater than the min interval
  1101. allows 0 to be passed as a display name
  1102. sets an instanceId if one is not passed in also sets sipjsId
  1103. sets auth user to uri user if auth user is not passed in
  1104. sets iceCheckingTimeout as low as 0.5 seconds
  1105. sets the registrarServer to the uri (without user) if it is not passed in
  1106. uses getRandomTestNetIP for viaHost if hackIpInContact is set to true
  1107. creates the contact object
  1108. .configuration_skeleton
  1109. sets all parameters (except register) as writable/configurable false
  1110. sets all the register parameter as writable true, configurable false
  1111. .configuration_check
  1112. .uri
  1113. fails if nothing is passed in
  1114. fails if there is no user
  1115. passes if there is a correctly parsed uri
  1116. .wsServers
  1117. fails for types that are not string or array (of strings or objects
  1118. fails for an empty array
  1119. fails if ws_uri attribute is missing
  1120. fails if weight attribute is not a number
  1121. fails if the ws_uri is invalid
  1122. fails if the url scheme is not wss or ws
  1123. returns correctly if none of the above is wrong
  1124. .authorizationUser
  1125. fails if a type besides a string is passed in PENDING WITH MESSAGE: Temporarily disabled with xit
  1126. ALWAYS PASSES
  1127. .connectionRecoveryMaxInterval
  1128. fails for anything but numbers
  1129. fails for negative numbers and 0
  1130. passes for positive numbers
  1131. .connectionRecoveryMinInterval
  1132. fails for anything but numbers
  1133. fails for negative numbers and 0
  1134. passes for positive numbers
  1135. .displayName
  1136. fails if a type besides a string is passed in PENDING WITH MESSAGE: Temporarily disabled with xit
  1137. ALWAYS PASSES
  1138. .hackViaTcp
  1139. fails for all types except boolean
  1140. passes for boolean parameters
  1141. .hackIpInContact
  1142. fails for all types except boolean and string
  1143. passes for boolean parameters
  1144. passes for string parameters that can be parsed as a host
  1145. .instanceId
  1146. fails for everything but string hex pattern (see below)
  1147. passes if passed (hex8)-(hex4)-(hex4)-(hex4)-(hex12) as a string (may have uuid: in front, but removes this)
  1148. .noAnswerTimeout
  1149. fails for anything but numbers
  1150. fails for negative numbers and 0
  1151. passes for positive numbers
  1152. .password
  1153. ALWAYS PASSES
  1154. .rel100
  1155. returns SIP.C.supported.REQUIRED if SIP.C.supported.REQUIRED is passed in
  1156. returns SIP.C.supported.REQUIRED if "required" is passed in
  1157. returns SIP.C.supported.SUPPORTED if SIP.C.supported.SUPPORTED is passed in
  1158. returns SIP.C.supported.SUPPORTED if "supported" is passed in as well as adding it to the supported list
  1159. returns SIP.C.supported.NONE for all other arguments passed in
  1160. .replaces
  1161. returns SIP.C.supported.REQUIRED if SIP.C.supported.REQUIRED is passed in
  1162. returns SIP.C.supported.SUPPORTED if SIP.C.supported.SUPPORTED is passed in
  1163. returns SIP.C.supported.UNSUPPORTED for all other arguments passed in
  1164. .register
  1165. fails for all types except boolean
  1166. passes for boolean parameters
  1167. .registerExpires
  1168. fails for anything but numbers
  1169. fails for negative numbers and 0
  1170. passes for positive numbers
  1171. .registrarServer
  1172. only accepts strings
  1173. fails for a string that is not a valid uri (parse returns nothing)
  1174. fails for a string that is a valid uri, but has a user
  1175. passes for a string that is a valid uri without a user and returns a URI
  1176. .stunServers
  1177. fails for anything except a string or an array
  1178. fails for an invalid stun_uri PENDING WITH MESSAGE: Temporarily disabled with xit
  1179. works with a string or an array
  1180. .traceSip
  1181. fails for all types except boolean
  1182. passes for boolean parameters
  1183. .turnServers
  1184. works whether an array is passed or not
  1185. works if you pass in server instead of urls (backwards compatible
  1186. fails if urls, username, or server is missing
  1187. fails if the url passed is not a valid turn_uri
  1188. .userAgentString
  1189. fails for all types except string
  1190. passes for string parameters
  1191. .usePreloadedRoute
  1192. fails for all types except boolean
  1193. passes for boolean parameters
  1194. .wsServerMaxReconnection
  1195. fails for anything but numbers
  1196. fails for negative numbers and 0
  1197. passes for positive numbers
  1198. .wsServerReconnectionTimeout
  1199. fails for anything but numbers
  1200. fails for negative numbers and 0
  1201. passes for positive numbers
  1202. .autostart
  1203. fails for all types except boolean
  1204. passes for boolean parameters
  1205. .allowLegacyNotifications
  1206. fails for all types except boolean
  1207. passes for boolean parameters
  1208.  
  1209. URI
  1210. defines parameters
  1211. defines headers
  1212. sets the scheme
  1213. sets the user
  1214. sets the host
  1215. sets the port
  1216. .setParam
  1217. does not set a parameter with a null key
  1218. sets a parameter with a null value
  1219. sets a parameter with a key and value
  1220. sets a parameter and make the key lowercase
  1221. sets a parameter and make the parameter lowercase
  1222. .getParam
  1223. does not get a parameter for a null key
  1224. gets a parameter for a key
  1225. gets a parameter for a key that is uppercase
  1226. .hasParam
  1227. is undefined for a null key
  1228. is false for a parameter that does not exist
  1229. is true for a parameter that does exist
  1230. is true for a parameter that does exist regardless of case
  1231. .deleteParam
  1232. deletes the entry from the parameters list
  1233. returns the value of the deleted key
  1234. does not delete a key that does not exist
  1235. does not return a value if the key does not exist
  1236. .clearParams
  1237. empties the parameter list
  1238. does not make the parameter list undefined
  1239. .setHeader
  1240. adds the header if it does not exist
  1241. replaces the header if it already exists
  1242. .getHeader
  1243. returns undefined if the header does not exist
  1244. returns an array of the header that it found
  1245. .hasHeader
  1246. returns true if the header exists
  1247. returns false if the header does not exist
  1248. .deleteHeader
  1249. deletes the given header from the headers list
  1250. returns the deleted value
  1251. does not delete anything if it cannot find the header
  1252. .clearHeaders
  1253. should remove all the headers from the headers variable
  1254. .clone: be able to clone itself
  1255. .toString: be able to create a string of itself
  1256. should parse a URI from a valid string
  1257. .parse does not parse a URI from an invalid string
  1258. 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"
  1259. produces a SIP.URI
  1260. parses the scheme
  1261. parses the user
  1262. parses the host
  1263. parses the port
  1264. parses non-null parameter "transport"
  1265. doesn't parse missing parameter "nooo"
  1266. parses non-null parameter foo
  1267. parses null parameter baz
  1268. parses header list x-header-1
  1269. parses header X-HEADER-2
  1270. doesn't parse missing header "nooo"
  1271. correctly toString()s itself
  1272. correctly toRaw()s itself
  1273. when setting the user to "Iñaki:PASSWD"
  1274. sets the user correctly
  1275. can delete parameter "foo" and delete header "x-header-1"
  1276. can clear parameters and headers, and nullify the port
  1277.  
  1278. WebRTC.MediaHandler
  1279. sets mediaStreamManager if passed to constructor
  1280. echoes MediaStreamManager events
  1281. initializes mute state info
  1282. .render
  1283. doesn't throw if renderHint and this.mediaHint are missing
  1284. .getLocalStreams
  1285. returns peerConnection.getLocalStreams()
  1286. .getRemoteStreams
  1287. returns peerConnection.getRemoteStreams()
  1288. .mute
  1289. sets audio and video muted to true if they are both present (no options)
  1290. sets audio and video muted to true if they are both present (options)
  1291. only sets video if audio is not present
  1292. only sets audio if video is not present
  1293. sets neither if neither is present and does not emit muted
  1294. sets neither if both are already muted and does not emit muted
  1295. .unmute
  1296. sets audio and video muted to false if they are both present (no options)
  1297. sets audio and video muted to false if they are both present (options)
  1298. only sets video if audio is not present
  1299. onlys set audio if video is not present
  1300. sets neither if neither is present and does not emit unmuted
  1301. sets neither if both are already unmuted and does not emit unmuted
  1302. .isMuted
  1303. returns the audioMuted and videoMuted variables
  1304. .toggleMuteAudio
  1305. sets enabled to false
  1306. sets enabled to true
  1307. does not set enabled
  1308. .toggleMuteVideo
  1309. sets enabled to false
  1310. sets enabled to true
  1311. does not set enabled
  1312. .setDescription
  1313. emits setDescription before creating RTCSessionDescription
  1314. .getReferMedia
  1315. returns audio-only constraints if local audio/video and remote audio
  1316. .prepareIceServers
  1317. returns the expected structure for a single url
  1318. returns the expected structure for multiple urls
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement