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
16dc05e6
Commit
16dc05e6
authored
10 years ago
by
Adrien Béraud
Committed by
Guillaume Roguez
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
siptransport: move inline methods from .h to .cpp
Refs #63196 Change-Id: I76f22d7de82c380c5f7d984205627763e118b8e1
parent
a251e834
No related branches found
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
daemon/src/sip/siptransport.cpp
+33
-0
33 additions, 0 deletions
daemon/src/sip/siptransport.cpp
daemon/src/sip/siptransport.h
+5
-28
5 additions, 28 deletions
daemon/src/sip/siptransport.h
with
38 additions
and
28 deletions
daemon/src/sip/siptransport.cpp
+
33
−
0
View file @
16dc05e6
...
...
@@ -111,6 +111,39 @@ SipTransport::stateToStr(pjsip_transport_state state)
return
TRANSPORT_STATE_STR
[
std
::
min
<
size_t
>
(
state
,
TRANSPORT_STATE_SZ
-
1
)];
}
void
SipTransport
::
stateCallback
(
pjsip_transport_state
state
,
const
pjsip_transport_state_info
*
info
)
{
std
::
vector
<
SipTransportStateCallback
>
cbs
{};
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
stateListenersMutex_
);
cbs
.
reserve
(
stateListeners
.
size
());
for
(
auto
&
l
:
stateListeners
)
cbs
.
push_back
(
l
.
second
);
}
for
(
auto
&
cb
:
cbs
)
cb
(
state
,
info
);
}
void
SipTransport
::
addStateListener
(
uintptr_t
lid
,
SipTransportStateCallback
cb
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
stateListenersMutex_
);
stateListeners
[
lid
]
=
cb
;
}
bool
SipTransport
::
removeStateListener
(
uintptr_t
lid
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
stateListenersMutex_
);
auto
it
=
stateListeners
.
find
(
lid
);
if
(
it
!=
stateListeners
.
end
())
{
stateListeners
.
erase
(
it
);
return
true
;
}
return
false
;
}
SipTransportBroker
::
SipTransportBroker
(
pjsip_endpoint
*
endpt
,
pj_caching_pool
&
cp
,
pj_pool_t
&
pool
)
:
#if HAVE_DHT
iceTransports_
(),
...
...
This diff is collapsed.
Click to expand it.
daemon/src/sip/siptransport.h
+
5
−
28
View file @
16dc05e6
...
...
@@ -115,36 +115,14 @@ struct SipTransport
static
const
char
*
stateToStr
(
pjsip_transport_state
state
);
void
stateCallback
(
pjsip_transport_state
state
,
const
pjsip_transport_state_info
*
info
)
{
std
::
vector
<
SipTransportStateCallback
>
cbs
{};
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
stateListenersMutex_
);
cbs
.
reserve
(
stateListeners
.
size
());
for
(
auto
&
l
:
stateListeners
)
cbs
.
push_back
(
l
.
second
);
}
for
(
auto
&
cb
:
cbs
)
cb
(
state
,
info
);
}
void
stateCallback
(
pjsip_transport_state
state
,
const
pjsip_transport_state_info
*
info
);
pjsip_transport
*
get
()
{
return
transport
;
}
void
addStateListener
(
uintptr_t
lid
,
SipTransportStateCallback
cb
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
stateListenersMutex_
);
stateListeners
[
lid
]
=
cb
;
}
bool
removeStateListener
(
uintptr_t
lid
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
stateListenersMutex_
);
auto
it
=
stateListeners
.
find
(
lid
);
if
(
it
!=
stateListeners
.
end
())
{
stateListeners
.
erase
(
it
);
return
true
;
}
return
false
;
}
void
addStateListener
(
uintptr_t
lid
,
SipTransportStateCallback
cb
);
bool
removeStateListener
(
uintptr_t
lid
);
static
bool
isAlive
(
const
std
::
shared_ptr
<
SipTransport
>&
,
pjsip_transport_state
state
);
...
...
@@ -239,6 +217,8 @@ private:
* List of transports so we can bubble the events up.
*/
std
::
map
<
pjsip_transport
*
,
std
::
weak_ptr
<
SipTransport
>>
transports_
{};
std
::
mutex
transportMapMutex_
{};
std
::
condition_variable
transportDestroyedCv_
{};
/**
* Transports are stored in this map in order to retreive them in case
...
...
@@ -256,9 +236,6 @@ private:
std
::
mutex
iceMutex_
{};
#endif
std
::
mutex
transportMapMutex_
{};
std
::
condition_variable
transportDestroyedCv_
{};
pj_caching_pool
&
cp_
;
pj_pool_t
&
pool_
;
pjsip_endpoint
*
endpt_
;
...
...
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