Skip to content
GitLab
Explore
Sign in
Register
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
ecc55769
Commit
ecc55769
authored
2 years ago
by
Adrien Béraud
Committed by
Adrien Béraud
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
sipvoiplink: cleanup
Change-Id: Ibdb2592704bd36cb95d165237507fe1fd3e7d215
parent
a5d4bfb8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sip/sipvoiplink.cpp
+7
-13
7 additions, 13 deletions
src/sip/sipvoiplink.cpp
with
7 additions
and
13 deletions
src/sip/sipvoiplink.cpp
+
7
−
13
View file @
ecc55769
...
...
@@ -1646,7 +1646,7 @@ SIPVoIPLink::findLocalAddressFromSTUN(pjsip_transport* transport,
pj_sock_t
sipSocket
=
pjsip_udp_transport_get_socket
(
transport
);
const
pjstun_setting
stunOpt
=
{
PJ_TRUE
,
localIp
.
getFamily
(),
*
stunServerName
,
stunPort
,
*
stunServerName
,
stunPort
};
const
pj_status_t
stunStatus
=
pjstun_get_mapped_addr2
(
&
cp_
.
factory
,
pj_status_t
stunStatus
=
pjstun_get_mapped_addr2
(
&
cp_
.
factory
,
&
stunOpt
,
1
,
&
sipSocket
,
...
...
@@ -1654,9 +1654,8 @@ SIPVoIPLink::findLocalAddressFromSTUN(pjsip_transport* transport,
switch
(
stunStatus
)
{
case
PJLIB_UTIL_ESTUNNOTRESPOND
:
JAMI_ERR
(
"No response from STUN server %.*s"
,
(
int
)
stunServerName
->
slen
,
stunServerName
->
ptr
);
JAMI_ERROR
(
"No response from STUN server {:s}"
,
sip_utils
::
as_view
(
*
stunServerName
));
return
false
;
case
PJLIB_UTIL_ESTUNSYMMETRIC
:
...
...
@@ -1665,18 +1664,13 @@ SIPVoIPLink::findLocalAddressFromSTUN(pjsip_transport* transport,
case
PJ_SUCCESS
:
port
=
pj_sockaddr_in_get_port
(
&
mapped_addr
);
addr
=
IpAddr
((
const
sockaddr_in
&
)
mapped_addr
).
toString
();
JAMI_DBG
(
"STUN server %.*s replied '%s:%u'"
,
(
int
)
stunServerName
->
slen
,
stunServerName
->
ptr
,
addr
.
c_str
(),
port
);
addr
=
IpAddr
((
const
sockaddr_in
&
)
mapped_addr
).
toString
(
true
);
JAMI_DEBUG
(
"STUN server {:s} replied '{}'"
,
sip_utils
::
as_view
(
*
stunServerName
),
addr
);
return
true
;
default:
// use given address, silent any not handled error
JAMI_WARN
(
"Error from STUN server %.*s, using source address"
,
(
int
)
stunServerName
->
slen
,
stunServerName
->
ptr
);
JAMI_WARNING
(
"Error from STUN server {:s}, using source address"
,
sip_utils
::
as_view
(
*
stunServerName
));
return
false
;
}
}
...
...
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