Skip to content

Instantly share code, notes, and snippets.

@dangreen
Created January 31, 2019 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dangreen/d5b0ea1e266a2a47aee129381b824f2d to your computer and use it in GitHub Desktop.
Save dangreen/d5b0ea1e266a2a47aee129381b824f2d to your computer and use it in GitHub Desktop.
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