JsSIP
JsSIP copied to clipboard
Error with event handler "newOptions"
Hi. When I tried to use event handler "newOptions", I obtained error:
Argument of type '"newOptions"' is not assignable to parameter of type '"connecting" | "connected" | "disconnected" | "registered" | "unregistered" | "registrationFailed" | "registrationExpiring" | "newRTCSession" | "newMessage" | "sipEvent"'. TS2345
Library version: 3.9.0 According documentation
Code snippet:
import { UA, WebSocketInterface } from 'jssip'
const ua = new UA({
sockets: new WebSocketInterface(`wss://<somehost>:8089/ws`),
uri: `sip:<somelogin>@<somehost>`,
password: <somepassword>,
})
ua.on('newOptions', (e) => {
console.log('Options: ', e)
})
You can create a PR and add the type in https://github.com/versatica/JsSIP/blob/master/lib/UA.d.ts file