import { SrtcpContext } from "./context/srtcp" ; import { Config , Session } from "./session" ; export class SrtcpSession extends Session < SrtcpContext > { constructor ( public config ) { super ( SrtcpContext ) ; this . start ( config . keys . localMasterKey , config . keys . localMasterSalt , config . keys . remoteMasterKey , config . keys . remoteMasterSalt , config . profile ) ; } decrypt = ( buf ) => { const [ decrypted ] = this . remoteContext . decryptRTCP ( buf ) ; return decrypted ; } ; encrypt ( rawRtcp ) { const enc = this . localContext . encryptRTCP ( rawRtcp ) ; return enc ; } }