Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
130
Issues
130
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
7c11d095
Commit
7c11d095
authored
Jul 15, 2017
by
Asad Salman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added correct newCallCreated callback
Change-Id: Id05c1f9198b80bc459fa0e2250b37ecb93a52060
parent
2038837b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
bin/nodejs/callback.h
bin/nodejs/callback.h
+13
-3
bin/nodejs/nodejs_interface.i
bin/nodejs/nodejs_interface.i
+1
-1
No files found.
bin/nodejs/callback.h
View file @
7c11d095
...
...
@@ -25,7 +25,6 @@ Persistent<Function> callStateChangedCb;
Persistent
<
Function
>
incomingMessageCb
;
Persistent
<
Function
>
incomingCallCb
;
Persistent
<
Function
>
newCallCreatedCb
;
Persistent
<
Function
>
sipCallStateChangedCb
;
std
::
queue
<
std
::
function
<
void
()
>>
pendingSignals
;
std
::
mutex
pendingSignalsLock
;
...
...
@@ -65,8 +64,6 @@ Persistent<Function>* getPresistentCb(const std::string &signal) {
return
&
incomingCallCb
;
else
if
(
signal
==
"NewCallCreated"
)
return
&
newCallCreatedCb
;
else
if
(
signal
==
"SipCallStateChanged"
)
return
&
sipCallStateChangedCb
;
else
return
nullptr
;
}
...
...
@@ -330,5 +327,18 @@ void incomingCall(const std::string& account_id, const std::string& call_id, con
}
});
uv_async_send
(
&
signalAsync
);
}
void
newCallCreated
(
const
std
::
string
&
account_id
,
const
std
::
string
&
call_id
,
const
std
::
string
&
to_uri
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
pendingSignalsLock
);
pendingSignals
.
emplace
([
account_id
,
call_id
,
to_uri
]()
{
Local
<
Function
>
func
=
Local
<
Function
>::
New
(
Isolate
::
GetCurrent
(),
newCallCreatedCb
);
if
(
!
func
.
IsEmpty
())
{
Local
<
Value
>
callback_args
[]
=
{
V8_STRING_NEW
(
account_id
),
V8_STRING_NEW
(
call_id
),
V8_STRING_NEW
(
to_uri
)};
func
->
Call
(
SWIGV8_CURRENT_CONTEXT
()
->
Global
(),
3
,
callback_args
);
}
});
uv_async_send
(
&
signalAsync
);
}
\ No newline at end of file
bin/nodejs/nodejs_interface.i
View file @
7c11d095
...
...
@@ -135,7 +135,7 @@ void init(const v8::Handle<v8::Value> &funcMap){
exportable_callback
<
CallSignal
::
StateChange
>
(
bind
(
&
callStateChanged,
_1,
_2,
_3)),
exportable_callback
<
CallSignal
::
IncomingMessage
>
(
bind
(
&
incomingMessage,
_1,
_2,
_3)),
exportable_callback
<
CallSignal
::
IncomingCall
>
(
bind
(
&
incomingCall,
_1,
_2,
_3)),
//
exportable_callback<CallSignal::NewCallCreated>(bind(&newCallCreated, _1, _2, _3))
exportable_callback
<
CallSignal
::
NewCallCreated
>
(
bind
(
&
newCallCreated,
_1,
_2,
_3))
}
;
const
std
::
map
<
std
::
string
,
SharedCallback
>
configEvHandlers
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment