JsSIP icon indicating copy to clipboard operation
JsSIP copied to clipboard

Error with event handler "newOptions"

Open IBlasterus opened this issue 2 years ago • 1 comments

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)
        })

IBlasterus avatar May 16 '22 05:05 IBlasterus

You can create a PR and add the type in https://github.com/versatica/JsSIP/blob/master/lib/UA.d.ts file

jmillan avatar May 17 '22 11:05 jmillan