JsSIP icon indicating copy to clipboard operation
JsSIP copied to clipboard

SessionDirection enum is undefined

Open Catlike14 opened this issue 4 years ago • 4 comments

I'm using typescript and I need to detect the direction of a RTCSession. In according to typescript definition of RTCSession, the direction is a SessionDirection, that is an enum described here:

https://github.com/versatica/JsSIP/blob/master/lib/RTCSession.d.ts#L17

However, when I try to use it, I get this error:

TypeError: Cannot read properties of undefined (reading 'INCOMING')

Here a reproduction: https://codesandbox.io/s/typescript-forked-ri3w0?file=/src/index.ts

Catlike14 avatar Nov 12 '21 08:11 Catlike14

@phwb,

Any chance you could comment on this one?

jmillan avatar Nov 12 '21 13:11 jmillan

Hi, I'm on vacation right now. I can review this problem in a few days

phwb avatar Nov 14 '21 17:11 phwb

Same problem with Originator, described here:

https://github.com/versatica/JsSIP/blob/master/lib/RTCSession.d.ts#L22

I think that this happens with all enums.

Catlike14 avatar Nov 15 '21 13:11 Catlike14

@jmillan Hi, I fix this problem in https://github.com/versatica/JsSIP/pull/648

phwb avatar Nov 18 '21 05:11 phwb

Please, check your TS environment and whether the file is accessible, it clearly exposes the given type SessionDirection

jmillan avatar Nov 05 '22 15:11 jmillan

reopening, #648 waiting for @ibc 's approval.

jmillan avatar Nov 05 '22 17:11 jmillan

merged

ibc avatar Nov 05 '22 17:11 ibc