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
8b454e25
Commit
8b454e25
authored
11 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
sipaccount: add getTransportType method
parent
ef8a06fc
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
daemon/src/sip/sipaccount.cpp
+17
-7
17 additions, 7 deletions
daemon/src/sip/sipaccount.cpp
daemon/src/sip/sipaccount.h
+4
-1
4 additions, 1 deletion
daemon/src/sip/sipaccount.h
with
21 additions
and
8 deletions
daemon/src/sip/sipaccount.cpp
+
17
−
7
View file @
8b454e25
...
...
@@ -88,8 +88,8 @@ SIPAccount::SIPAccount(const std::string& accountID, bool presenceEnabled)
,
registrationExpire_
(
MIN_REGISTRATION_TIME
)
,
interface_
(
"default"
)
,
publishedSameasLocal_
(
true
)
,
publishedIpAddress_
()
,
publishedIp_
()
,
publishedIpAddress_
()
,
localPort_
(
DEFAULT_SIP_PORT
)
,
publishedPort_
(
DEFAULT_SIP_PORT
)
,
serviceRoute_
()
...
...
@@ -890,10 +890,13 @@ void SIPAccount::registerVoIPLink()
if
(
hostname_
.
length
()
>=
PJ_MAX_HOSTNAME
)
return
;
DEBUG
(
"SIPAccount::registerVoIPLink
"
);
DEBUG
(
"SIPAccount::registerVoIPLink
%s "
,
hostname_
.
c_str
()
);
#if HAVE_TLS
auto
IPs
=
ip_utils
::
getAddrList
(
hostname_
);
for
(
const
auto
&
ip
:
IPs
)
DEBUG
(
"--- %s "
,
ip_utils
::
addrToStr
(
ip
).
c_str
());
#if HAVE_TLS
// Init TLS settings if the user wants to use TLS
if
(
tlsEnable_
)
{
DEBUG
(
"TLS is enabled for account %s"
,
accountID_
.
c_str
());
...
...
@@ -905,11 +908,18 @@ void SIPAccount::registerVoIPLink()
// PJSIP does not currently support TLS over IPv6
transportType_
=
PJSIP_TRANSPORT_TLS
;
initTlsConfiguration
();
}
else
{
transportType_
=
PJSIP_TRANSPORT_UDP
;
}
}
else
#endif
{
bool
IPv6
=
false
;
if
(
isIP2IP
())
{
DEBUG
(
"SIPAccount::registerVoIPLink isIP2IP."
);
//IPv6 = SipTransport::getInterfaceAddr(interface_).addr.sa_family == pj_AF_INET6();
}
else
if
(
!
IPs
.
empty
())
IPv6
=
IPs
[
0
].
addr
.
sa_family
==
pj_AF_INET6
();
transportType_
=
IPv6
?
PJSIP_TRANSPORT_UDP6
:
PJSIP_TRANSPORT_UDP
;
}
// Init STUN settings for this account if the user selected it
if
(
stunEnabled_
)
{
...
...
This diff is collapsed.
Click to expand it.
daemon/src/sip/sipaccount.h
+
4
−
1
View file @
8b454e25
...
...
@@ -398,7 +398,6 @@ class SIPAccount : public Account {
/**
* Get the contact header for
* @param prefer_ipv6 If we are dual-stack, use IPv6 contact header.
* @return pj_str_t The contact header based on account information
*/
pj_str_t
getContactHeader
();
...
...
@@ -549,6 +548,10 @@ class SIPAccount : public Account {
*/
pjsip_transport
*
transport_
;
pjsip_transport_type_e
getTransportType
()
const
{
return
transportType_
;
}
/* Returns true if the username and/or hostname match this account */
MatchRank
matches
(
const
std
::
string
&
username
,
const
std
::
string
&
hostname
,
pjsip_endpoint
*
endpt
,
pj_pool_t
*
pool
)
const
;
...
...
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