Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
8750049b
Commit
8750049b
authored
3 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
nodejs: fix binding, update to Node 16 LTS
Change-Id: Id4eaaebee19c9739334b0652e7cdf560d8f8a202
parent
222934d9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/nodejs/Makefile.am
+2
-2
2 additions, 2 deletions
bin/nodejs/Makefile.am
bin/nodejs/callback.h
+22
-12
22 additions, 12 deletions
bin/nodejs/callback.h
bin/nodejs/callmanager.i
+12
-9
12 additions, 9 deletions
bin/nodejs/callmanager.i
with
36 additions
and
23 deletions
bin/nodejs/Makefile.am
+
2
−
2
View file @
8750049b
...
@@ -5,11 +5,11 @@ BUILT_SOURCES= \
...
@@ -5,11 +5,11 @@ BUILT_SOURCES= \
build/Makefile
\
build/Makefile
\
build/Release/obj.target/jami.node
build/Release/obj.target/jami.node
jami_wrapper.cpp
:
nodejs_interface.i configurationmanager.i managerimpl.i
jami_wrapper.cpp
:
nodejs_interface.i configurationmanager.i managerimpl.i
callmanager.i
$(
SWIG
)
-v
-c
++
-javascript
-node
-o
jami_wrapper.cpp nodejs_interface.i
$(
SWIG
)
-v
-c
++
-javascript
-node
-o
jami_wrapper.cpp nodejs_interface.i
build/Makefile
:
jami_wrapper.cpp binding.gyp
build/Makefile
:
jami_wrapper.cpp binding.gyp
node-gyp configure
--target
=
v1
4.1
6.1
--arch
=
x64
node-gyp configure
--target
=
v16.1
4.2
--arch
=
x64
build/Release/obj.target/jami.node
:
build/Makefile jami_wrapper.cpp callback.h
build/Release/obj.target/jami.node
:
build/Makefile jami_wrapper.cpp callback.h
node-gyp build
node-gyp build
...
...
This diff is collapsed.
Click to expand it.
bin/nodejs/callback.h
+
22
−
12
View file @
8750049b
...
@@ -441,16 +441,22 @@ incomingTrustRequest(const std::string& accountId,
...
@@ -441,16 +441,22 @@ incomingTrustRequest(const std::string& accountId,
}
}
void
void
callStateChanged
(
const
std
::
string
&
callId
,
const
std
::
string
&
state
,
int
detail_code
)
callStateChanged
(
const
std
::
string
&
accountId
,
const
std
::
string
&
callId
,
const
std
::
string
&
state
,
int
detail_code
)
{
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
pendingSignalsLock
);
std
::
lock_guard
<
std
::
mutex
>
lock
(
pendingSignalsLock
);
pendingSignals
.
emplace
([
callId
,
state
,
detail_code
]()
{
pendingSignals
.
emplace
([
accountId
,
callId
,
state
,
detail_code
]()
{
Local
<
Function
>
func
=
Local
<
Function
>::
New
(
Isolate
::
GetCurrent
(),
callStateChangedCb
);
Local
<
Function
>
func
=
Local
<
Function
>::
New
(
Isolate
::
GetCurrent
(),
callStateChangedCb
);
if
(
!
func
.
IsEmpty
())
{
if
(
!
func
.
IsEmpty
())
{
SWIGV8_VALUE
callback_args
[]
=
{
V8_STRING_NEW_LOCAL
(
callId
),
SWIGV8_VALUE
callback_args
[]
=
{
V8_STRING_NEW_LOCAL
(
state
),
V8_STRING_NEW_LOCAL
(
accountId
),
SWIGV8_INTEGER_NEW
(
detail_code
)};
V8_STRING_NEW_LOCAL
(
callId
),
func
->
Call
(
SWIGV8_CURRENT_CONTEXT
(),
SWIGV8_NULL
(),
3
,
callback_args
);
V8_STRING_NEW_LOCAL
(
state
),
SWIGV8_INTEGER_NEW
(
detail_code
)
};
func
->
Call
(
SWIGV8_CURRENT_CONTEXT
(),
SWIGV8_NULL
(),
4
,
callback_args
);
}
}
});
});
...
@@ -466,9 +472,11 @@ mediaChangeRequested(const std::string& accountId,
...
@@ -466,9 +472,11 @@ mediaChangeRequested(const std::string& accountId,
pendingSignals
.
emplace
([
accountId
,
callId
,
mediaList
]()
{
pendingSignals
.
emplace
([
accountId
,
callId
,
mediaList
]()
{
Local
<
Function
>
func
=
Local
<
Function
>::
New
(
Isolate
::
GetCurrent
(),
mediaChangeRequestedCb
);
Local
<
Function
>
func
=
Local
<
Function
>::
New
(
Isolate
::
GetCurrent
(),
mediaChangeRequestedCb
);
if
(
!
func
.
IsEmpty
())
{
if
(
!
func
.
IsEmpty
())
{
SWIGV8_VALUE
callback_args
[]
=
{
V8_STRING_NEW_LOCAL
(
accountId
),
SWIGV8_VALUE
callback_args
[]
=
{
V8_STRING_NEW_LOCAL
(
callId
),
V8_STRING_NEW_LOCAL
(
accountId
),
stringMapVecToJsMapArray
(
mediaList
)};
V8_STRING_NEW_LOCAL
(
callId
),
stringMapVecToJsMapArray
(
mediaList
)
};
func
->
Call
(
SWIGV8_CURRENT_CONTEXT
(),
SWIGV8_NULL
(),
3
,
callback_args
);
func
->
Call
(
SWIGV8_CURRENT_CONTEXT
(),
SWIGV8_NULL
(),
3
,
callback_args
);
}
}
});
});
...
@@ -477,15 +485,17 @@ mediaChangeRequested(const std::string& accountId,
...
@@ -477,15 +485,17 @@ mediaChangeRequested(const std::string& accountId,
}
}
void
void
incomingMessage
(
const
std
::
string
&
id
,
incomingMessage
(
const
std
::
string
&
accountId
,
const
std
::
string
&
id
,
const
std
::
string
&
from
,
const
std
::
string
&
from
,
const
std
::
map
<
std
::
string
,
std
::
string
>&
messages
)
const
std
::
map
<
std
::
string
,
std
::
string
>&
messages
)
{
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
pendingSignalsLock
);
std
::
lock_guard
<
std
::
mutex
>
lock
(
pendingSignalsLock
);
pendingSignals
.
emplace
([
id
,
from
,
messages
]()
{
pendingSignals
.
emplace
([
accountId
,
id
,
from
,
messages
]()
{
Local
<
Function
>
func
=
Local
<
Function
>::
New
(
Isolate
::
GetCurrent
(),
incomingMessageCb
);
Local
<
Function
>
func
=
Local
<
Function
>::
New
(
Isolate
::
GetCurrent
(),
incomingMessageCb
);
if
(
!
func
.
IsEmpty
())
{
if
(
!
func
.
IsEmpty
())
{
SWIGV8_VALUE
callback_args
[]
=
{
V8_STRING_NEW_LOCAL
(
id
),
SWIGV8_VALUE
callback_args
[]
=
{
V8_STRING_NEW_LOCAL
(
accountId
),
V8_STRING_NEW_LOCAL
(
id
),
V8_STRING_NEW_LOCAL
(
from
),
V8_STRING_NEW_LOCAL
(
from
),
stringMapToJsMap
(
messages
)};
stringMapToJsMap
(
messages
)};
func
->
Call
(
SWIGV8_CURRENT_CONTEXT
(),
SWIGV8_NULL
(),
3
,
callback_args
);
func
->
Call
(
SWIGV8_CURRENT_CONTEXT
(),
SWIGV8_NULL
(),
3
,
callback_args
);
...
...
This diff is collapsed.
Click to expand it.
bin/nodejs/callmanager.i
+
12
−
9
View file @
8750049b
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
class
Callback
{
class
Callback
{
public
:
public
:
virtual
~
Callback
()
{}
virtual
~
Callback
()
{}
virtual
void
callStateChanged
(
const
std
::
string&
callId
,
const
std
::
string&
state
,
int
detail_code
)
{}
virtual
void
callStateChanged
(
const
std
::
string&
accountId
,
const
std
::
string&
callId
,
const
std
::
string&
state
,
int
detail_code
)
{}
virtual
void
transferFailed
(
void
)
{}
virtual
void
transferFailed
(
void
)
{}
virtual
void
transferSucceeded
(
void
)
{}
virtual
void
transferSucceeded
(
void
)
{}
virtual
void
recordPlaybackStopped
(
const
std
::
string&
path
)
{}
virtual
void
recordPlaybackStopped
(
const
std
::
string&
path
)
{}
...
@@ -40,9 +40,9 @@ public:
...
@@ -40,9 +40,9 @@ public:
virtual
void
mediaChangeRequested
(
const
std
::
string&
accountId
,
const
std
::
string&
callId
,
virtual
void
mediaChangeRequested
(
const
std
::
string&
accountId
,
const
std
::
string&
callId
,
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>>
&
mediaList
)
{}
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>>
&
mediaList
)
{}
virtual
void
recordPlaybackFilepath
(
const
std
::
string&
id
,
const
std
::
string&
filename
)
{}
virtual
void
recordPlaybackFilepath
(
const
std
::
string&
id
,
const
std
::
string&
filename
)
{}
virtual
void
conferenceCreated
(
const
std
::
string&
accountId
,
const
std
::
string&
conf
_i
d
)
{}
virtual
void
conferenceCreated
(
const
std
::
string&
accountId
,
const
std
::
string&
conf
I
d
)
{}
virtual
void
conferenceChanged
(
const
std
::
string&
accountId
,
const
std
::
string&
conf
_i
d
,
const
std
::
string&
state
)
{}
virtual
void
conferenceChanged
(
const
std
::
string&
accountId
,
const
std
::
string&
conf
I
d
,
const
std
::
string&
state
)
{}
virtual
void
conferenceRemoved
(
const
std
::
string&
accountId
,
const
std
::
string&
conf
_i
d
)
{}
virtual
void
conferenceRemoved
(
const
std
::
string&
accountId
,
const
std
::
string&
conf
I
d
)
{}
virtual
void
updatePlaybackScale
(
const
std
::
string&
filepath
,
int
position
,
int
scale
)
{}
virtual
void
updatePlaybackScale
(
const
std
::
string&
filepath
,
int
position
,
int
scale
)
{}
virtual
void
newCall
(
const
std
::
string&
accountId
,
const
std
::
string&
callId
,
const
std
::
string&
to
)
{}
virtual
void
newCall
(
const
std
::
string&
accountId
,
const
std
::
string&
callId
,
const
std
::
string&
to
)
{}
virtual
void
recordingStateChanged
(
const
std
::
string&
callId
,
int
code
)
{}
virtual
void
recordingStateChanged
(
const
std
::
string&
callId
,
int
code
)
{}
...
@@ -50,6 +50,8 @@ public:
...
@@ -50,6 +50,8 @@ public:
virtual
void
onRtcpReportReceived
(
const
std
::
string&
callId
,
const
std
::
map
<
std
::
string
,
int
>
&
stats
)
{}
virtual
void
onRtcpReportReceived
(
const
std
::
string&
callId
,
const
std
::
map
<
std
::
string
,
int
>
&
stats
)
{}
virtual
void
onConferenceInfosUpdated
(
const
std
::
string&
confId
,
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>>
&
infos
)
{}
virtual
void
onConferenceInfosUpdated
(
const
std
::
string&
confId
,
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>>
&
infos
)
{}
virtual
void
peerHold
(
const
std
::
string&
callId
,
bool
holding
)
{}
virtual
void
peerHold
(
const
std
::
string&
callId
,
bool
holding
)
{}
virtual
void
audioMuted
(
const
std
::
string&
callId
,
bool
muted
)
{}
virtual
void
videoMuted
(
const
std
::
string&
callId
,
bool
muted
)
{}
virtual
void
connectionUpdate
(
const
std
::
string&
id
,
int
state
)
{}
virtual
void
connectionUpdate
(
const
std
::
string&
id
,
int
state
)
{}
virtual
void
remoteRecordingChanged
(
const
std
::
string&
callId
,
const
std
::
string&
peer_number
,
bool
state
)
{}
virtual
void
remoteRecordingChanged
(
const
std
::
string&
callId
,
const
std
::
string&
peer_number
,
bool
state
)
{}
virtual
void
mediaNegotiationStatus
(
const
std
::
string&
callId
,
const
std
::
string&
event
,
virtual
void
mediaNegotiationStatus
(
const
std
::
string&
callId
,
const
std
::
string&
event
,
...
@@ -64,7 +66,6 @@ public:
...
@@ -64,7 +66,6 @@ public:
namespace
DRing
{
namespace
DRing
{
/* Call related methods */
/* Call related methods */
std::string placeCall(const std::string& accountId, const std::string& to, const std::map<std::string, std::string>& volatileCallDetails);
std::string placeCallWithMedia(const std::string& accountId,
std::string placeCallWithMedia(const std::string& accountId,
const std::string& to,
const std::string& to,
const std::vector<std::map<std::string, std::string>>& mediaList);
const std::vector<std::map<std::string, std::string>>& mediaList);
...
@@ -129,7 +130,7 @@ void sendTextMessage(const std::string& accountId, const std::string& callId, co
...
@@ -129,7 +130,7 @@ void sendTextMessage(const std::string& accountId, const std::string& callId, co
class
Callback
{
class
Callback
{
public
:
public
:
virtual
~
Callback
()
{}
virtual
~
Callback
()
{}
virtual
void
callStateChanged
(
const
std
::
string&
callId
,
const
std
::
string&
state
,
int
detail_code
)
{}
virtual
void
callStateChanged
(
const
std
::
string&
accountId
,
const
std
::
string&
callId
,
const
std
::
string&
state
,
int
detail_code
)
{}
virtual
void
transferFailed
(
void
)
{}
virtual
void
transferFailed
(
void
)
{}
virtual
void
transferSucceeded
(
void
)
{}
virtual
void
transferSucceeded
(
void
)
{}
virtual
void
recordPlaybackStopped
(
const
std
::
string&
path
)
{}
virtual
void
recordPlaybackStopped
(
const
std
::
string&
path
)
{}
...
@@ -141,9 +142,9 @@ public:
...
@@ -141,9 +142,9 @@ public:
virtual
void
mediaChangeRequested
(
const
std
::
string&
accountId
,
const
std
::
string&
callId
,
virtual
void
mediaChangeRequested
(
const
std
::
string&
accountId
,
const
std
::
string&
callId
,
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>>
&
mediaList
)
{}
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>>
&
mediaList
)
{}
virtual
void
recordPlaybackFilepath
(
const
std
::
string&
id
,
const
std
::
string&
filename
)
{}
virtual
void
recordPlaybackFilepath
(
const
std
::
string&
id
,
const
std
::
string&
filename
)
{}
virtual
void
conferenceCreated
(
const
std
::
string&
accountId
,
const
std
::
string&
conf
_i
d
)
{}
virtual
void
conferenceCreated
(
const
std
::
string&
accountId
,
const
std
::
string&
conf
I
d
)
{}
virtual
void
conferenceChanged
(
const
std
::
string&
accountId
,
const
std
::
string&
conf
_i
d
,
const
std
::
string&
state
)
{}
virtual
void
conferenceChanged
(
const
std
::
string&
accountId
,
const
std
::
string&
conf
I
d
,
const
std
::
string&
state
)
{}
virtual
void
conferenceRemoved
(
const
std
::
string&
accountId
,
const
std
::
string&
conf
_i
d
)
{}
virtual
void
conferenceRemoved
(
const
std
::
string&
accountId
,
const
std
::
string&
conf
I
d
)
{}
virtual
void
updatePlaybackScale
(
const
std
::
string&
filepath
,
int
position
,
int
scale
)
{}
virtual
void
updatePlaybackScale
(
const
std
::
string&
filepath
,
int
position
,
int
scale
)
{}
virtual
void
newCall
(
const
std
::
string&
accountId
,
const
std
::
string&
callId
,
const
std
::
string&
to
)
{}
virtual
void
newCall
(
const
std
::
string&
accountId
,
const
std
::
string&
callId
,
const
std
::
string&
to
)
{}
virtual
void
recordingStateChanged
(
const
std
::
string&
callId
,
int
code
)
{}
virtual
void
recordingStateChanged
(
const
std
::
string&
callId
,
int
code
)
{}
...
@@ -151,6 +152,8 @@ public:
...
@@ -151,6 +152,8 @@ public:
virtual
void
onRtcpReportReceived
(
const
std
::
string&
callId
,
const
std
::
map
<
std
::
string
,
int
>
&
stats
)
{}
virtual
void
onRtcpReportReceived
(
const
std
::
string&
callId
,
const
std
::
map
<
std
::
string
,
int
>
&
stats
)
{}
virtual
void
onConferenceInfosUpdated
(
const
std
::
string&
confId
,
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>>
&
infos
)
{}
virtual
void
onConferenceInfosUpdated
(
const
std
::
string&
confId
,
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>>
&
infos
)
{}
virtual
void
peerHold
(
const
std
::
string&
callId
,
bool
holding
)
{}
virtual
void
peerHold
(
const
std
::
string&
callId
,
bool
holding
)
{}
virtual
void
audioMuted
(
const
std
::
string&
callId
,
bool
muted
)
{}
virtual
void
videoMuted
(
const
std
::
string&
callId
,
bool
muted
)
{}
virtual
void
connectionUpdate
(
const
std
::
string&
id
,
int
state
)
{}
virtual
void
connectionUpdate
(
const
std
::
string&
id
,
int
state
)
{}
virtual
void
remoteRecordingChanged
(
const
std
::
string&
callId
,
const
std
::
string&
peer_number
,
bool
state
)
{}
virtual
void
remoteRecordingChanged
(
const
std
::
string&
callId
,
const
std
::
string&
peer_number
,
bool
state
)
{}
virtual
void
mediaNegotiationStatus
(
const
std
::
string&
callId
,
const
std
::
string&
event
,
virtual
void
mediaNegotiationStatus
(
const
std
::
string&
callId
,
const
std
::
string&
event
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment