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
63a40673
Commit
63a40673
authored
11 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #27724: sdp: use published IP address for STUN
parent
7fb07ff3
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
daemon/src/sip/sdp.cpp
+3
-3
3 additions, 3 deletions
daemon/src/sip/sdp.cpp
daemon/src/sip/sdp.h
+5
-5
5 additions, 5 deletions
daemon/src/sip/sdp.h
daemon/src/sip/sipvoiplink.cpp
+9
-5
9 additions, 5 deletions
daemon/src/sip/sipvoiplink.cpp
with
17 additions
and
13 deletions
daemon/src/sip/sdp.cpp
+
3
−
3
View file @
63a40673
...
...
@@ -65,7 +65,7 @@ Sdp::Sdp(pj_pool_t *pool)
,
video_codec_list_
()
,
sessionAudioMedia_
()
,
sessionVideoMedia_
()
,
local
IpAddr_
()
,
published
IpAddr_
()
,
remoteIpAddr_
()
,
localAudioDataPort_
(
0
)
,
localAudioControlPort_
(
0
)
...
...
@@ -323,7 +323,7 @@ Sdp::setMediaDescriptorLines(bool audio)
void
Sdp
::
addRTCPAttribute
(
pjmedia_sdp_media
*
med
)
{
std
::
ostringstream
os
;
os
<<
local
IpAddr_
<<
":"
<<
localAudioControlPort_
;
os
<<
published
IpAddr_
<<
":"
<<
localAudioControlPort_
;
const
std
::
string
str
(
os
.
str
());
pj_str_t
input_str
=
pj_str
((
char
*
)
str
.
c_str
());
pj_sockaddr
outputAddr
;
...
...
@@ -424,7 +424,7 @@ int Sdp::createLocalSession(const vector<int> &selectedAudioCodecs, const vector
localSession_
->
origin
.
id
=
tv
.
sec
+
2208988800UL
;
localSession_
->
origin
.
net_type
=
pj_str
((
char
*
)
"IN"
);
localSession_
->
origin
.
addr_type
=
pj_str
((
char
*
)
"IP4"
);
localSession_
->
origin
.
addr
=
pj_str
((
char
*
)
local
IpAddr_
.
c_str
());
localSession_
->
origin
.
addr
=
pj_str
((
char
*
)
published
IpAddr_
.
c_str
());
localSession_
->
name
=
pj_str
((
char
*
)
PACKAGE
);
...
...
This diff is collapsed.
Click to expand it.
daemon/src/sip/sdp.h
+
5
−
5
View file @
63a40673
...
...
@@ -153,15 +153,15 @@ class Sdp {
/*
* Write accessor. Set the local IP address that will be used in the sdp session
*/
void
set
Local
IP
(
const
std
::
string
&
ip_addr
)
{
local
IpAddr_
=
ip_addr
;
void
set
Published
IP
(
const
std
::
string
&
ip_addr
)
{
published
IpAddr_
=
ip_addr
;
}
/*
* Read accessor. Get the local IP address
*/
std
::
string
get
Local
IP
()
const
{
return
local
IpAddr_
;
std
::
string
get
Published
IP
()
const
{
return
published
IpAddr_
;
}
void
setLocalPublishedAudioPort
(
int
port
)
{
...
...
@@ -311,7 +311,7 @@ class Sdp {
std
::
vector
<
sfl
::
AudioCodec
*>
sessionAudioMedia_
;
std
::
vector
<
std
::
string
>
sessionVideoMedia_
;
std
::
string
local
IpAddr_
;
std
::
string
published
IpAddr_
;
std
::
string
remoteIpAddr_
;
int
localAudioDataPort_
;
...
...
This diff is collapsed.
Click to expand it.
daemon/src/sip/sipvoiplink.cpp
+
9
−
5
View file @
63a40673
...
...
@@ -227,6 +227,7 @@ void updateSDPFromSTUN(SIPCall &call, SIPAccount &account, const SipTransport &t
account
.
setPublishedAddress
(
pj_inet_ntoa
(
stunPorts
[
0
].
sin_addr
));
call
.
getLocalSDP
()
->
updatePorts
(
stunPorts
);
call
.
getLocalSDP
()
->
setPublishedIP
(
account
.
getPublishedAddress
());
}
catch
(
const
std
::
runtime_error
&
e
)
{
ERROR
(
"%s"
,
e
.
what
());
}
...
...
@@ -343,7 +344,7 @@ pj_bool_t transaction_request_cb(pjsip_rx_data *rdata)
setCallMediaLocal
(
call
,
addrToUse
);
call
->
getLocalSDP
()
->
set
Local
IP
(
addrSdp
);
call
->
getLocalSDP
()
->
set
Published
IP
(
addrSdp
);
call
->
getAudioRtp
().
initConfig
();
try
{
...
...
@@ -932,7 +933,7 @@ Call *SIPVoIPLink::SIPNewIpToIpCall(const std::string& id, const std::string& to
// Building the local SDP offer
Sdp
*
localSDP
=
call
->
getLocalSDP
();
localSDP
->
set
Local
IP
(
localAddress
);
localSDP
->
set
Published
IP
(
localAddress
);
const
bool
created
=
localSDP
->
createOffer
(
account
->
getActiveAudioCodecs
(),
account
->
getActiveVideoCodecs
());
if
(
not
created
or
not
SIPStartCall
(
call
))
{
...
...
@@ -1001,7 +1002,7 @@ Call *SIPVoIPLink::newRegisteredAccountCall(const std::string& id, const std::st
call
->
initRecFilename
(
toUrl
);
Sdp
*
localSDP
=
call
->
getLocalSDP
();
localSDP
->
set
Local
IP
(
addrSdp
);
localSDP
->
set
Published
IP
(
addrSdp
);
const
bool
created
=
localSDP
->
createOffer
(
account
->
getActiveAudioCodecs
(),
account
->
getActiveVideoCodecs
());
if
(
not
created
or
not
SIPStartCall
(
call
))
{
...
...
@@ -1021,8 +1022,11 @@ SIPVoIPLink::answer(Call *call)
SIPCall
*
sipCall
=
static_cast
<
SIPCall
*>
(
call
);
if
(
!
sipCall
->
inv
->
neg
)
{
WARN
(
"Negotiator is NULL, we've received an INVITE without an SDP"
);
pjmedia_sdp_session
*
dummy
;
pjmedia_sdp_session
*
dummy
=
0
;
sdp_create_offer_cb
(
sipCall
->
inv
,
&
dummy
);
SIPAccount
*
account
=
Manager
::
instance
().
getSipAccount
(
sipCall
->
getAccountId
());
if
(
account
and
account
->
isStunEnabled
())
updateSDPFromSTUN
(
*
sipCall
,
*
account
,
SIPVoIPLink
::
instance
()
->
sipTransport
);
}
call
->
answer
();
...
...
@@ -1788,7 +1792,7 @@ void sdp_create_offer_cb(pjsip_inv_session *inv, pjmedia_sdp_session **p_offer)
setCallMediaLocal
(
call
,
localAddress
);
Sdp
*
localSDP
=
call
->
getLocalSDP
();
localSDP
->
set
Local
IP
(
addrSdp
);
localSDP
->
set
Published
IP
(
addrSdp
);
const
bool
created
=
localSDP
->
createOffer
(
account
->
getActiveAudioCodecs
(),
account
->
getActiveVideoCodecs
());
if
(
created
)
*
p_offer
=
localSDP
->
getLocalSdpSession
();
...
...
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