Created
January 31, 2019 15:18
-
-
Save dangreen/d5b0ea1e266a2a47aee129381b824f2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
Readable, | |
Writeable | |
} from 'stream'; | |
export interface IOptions { | |
host: string; | |
port?: number; | |
username: string; | |
password: string; | |
} | |
export type DialHandler = ( | |
// stream to hear interlocutor | |
input: Readable, | |
// stream to play sounds | |
output: Writeable, | |
// function to finish the call | |
finishCall: () => void | |
) => void; | |
export default class SipDialer { | |
constructor(options: IOptions); | |
dial( | |
// phone number to dial | |
phoneNumber: string, | |
// `dialHandler` should be called after beeps | |
dialHandler: DialHandler | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment