Guest User

Untitled

a guest
Feb 1st, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. import {
  2. Readable,
  3. Writeable
  4. } from 'stream';
  5.  
  6. export interface IOptions {
  7. host: string;
  8. port?: number;
  9. username: string;
  10. password: string;
  11. }
  12.  
  13. export type DialHandler = (
  14. // stream to hear interlocutor
  15. input: Readable,
  16. // stream to play sounds
  17. output: Writeable,
  18. // function to finish the call
  19. finishCall: () => void
  20. ) => void;
  21.  
  22. export default class SipDialer {
  23.  
  24. constructor(options: IOptions);
  25.  
  26. dial(
  27. // phone number to dial
  28. phoneNumber: string,
  29. // `dialHandler` should be called after beeps
  30. dialHandler: DialHandler
  31. );
  32. }
Add Comment
Please, Sign In to add comment