UNPKG

sip-mrcp

Version:

A SIP/MRCP module that permits to write MRCPv2 client/server apps and tools

22 lines (17 loc) 358 B
var safe_write = (conn, msg) => { try { if(!conn.destroyed) { conn.write(msg) } } catch(e) { console.error("safe_write catched:") console.error(e) } } var gen_random_int = (max) => { return Math.floor(Math.random() * Math.floor(max)); } module.exports = { safe_write, gen_random_int, }