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
c891cd82
Commit
c891cd82
authored
15 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#2943] Set destination ip address during updateDestinationIpAddress
Was previously called in start rtp session too
parent
5c34d5a8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sflphone-common/src/audio/audiortp/AudioRtpSession.h
+56
-55
56 additions, 55 deletions
sflphone-common/src/audio/audiortp/AudioRtpSession.h
with
56 additions
and
55 deletions
sflphone-common/src/audio/audiortp/AudioRtpSession.h
+
56
−
55
View file @
c891cd82
...
@@ -109,6 +109,7 @@ namespace sfl {
...
@@ -109,6 +109,7 @@ namespace sfl {
// this destination and update a new one.
// this destination and update a new one.
ost
::
InetHostAddress
_remote_ip
;
ost
::
InetHostAddress
_remote_ip
;
// Main destination port for this rtp session.
// Main destination port for this rtp session.
// Stored in case reINVITE, which may require to forget
// Stored in case reINVITE, which may require to forget
// this destination and update a new one
// this destination and update a new one
...
@@ -208,7 +209,7 @@ namespace sfl {
...
@@ -208,7 +209,7 @@ namespace sfl {
assert
(
_ca
);
assert
(
_ca
);
_
debug
(
"
Local audio port %i will be used"
,
_ca
->
getLocalAudioPort
());
_
info
(
"Rtp:
Local audio port %i will be used"
,
_ca
->
getLocalAudioPort
());
//mic, we receive from soundcard in stereo, and we send encoded
//mic, we receive from soundcard in stereo, and we send encoded
_audiolayer
=
_manager
->
getAudioDriver
();
_audiolayer
=
_manager
->
getAudioDriver
();
...
@@ -223,7 +224,7 @@ namespace sfl {
...
@@ -223,7 +224,7 @@ namespace sfl {
template
<
typename
D
>
template
<
typename
D
>
AudioRtpSession
<
D
>::~
AudioRtpSession
()
AudioRtpSession
<
D
>::~
AudioRtpSession
()
{
{
_debug
(
"Delete AudioRtpSession instance"
);
_debug
(
"
Rtp:
Delete AudioRtpSession instance"
);
try
{
try
{
terminate
();
terminate
();
...
@@ -232,8 +233,6 @@ namespace sfl {
...
@@ -232,8 +233,6 @@ namespace sfl {
throw
;
throw
;
}
}
_debug
(
"Unbind audio RTP stream for call id %s"
,
_ca
->
getCallId
().
c_str
());
// _audiolayer->getMainBuffer()->unBindAll(_ca->getCallId());
_manager
->
getAudioDriver
()
->
getMainBuffer
()
->
unBindAll
(
_ca
->
getCallId
());
_manager
->
getAudioDriver
()
->
getMainBuffer
()
->
unBindAll
(
_ca
->
getCallId
());
delete
[]
_micData
;
delete
[]
_micData
;
...
@@ -243,7 +242,6 @@ namespace sfl {
...
@@ -243,7 +242,6 @@ namespace sfl {
delete
[]
_spkrDataConverted
;
delete
[]
_spkrDataConverted
;
delete
_time
;
delete
_time
;
delete
_converter
;
delete
_converter
;
_debug
(
"AudioRtpSession instance deleted"
);
}
}
template
<
typename
D
>
template
<
typename
D
>
...
@@ -318,26 +316,29 @@ namespace sfl {
...
@@ -318,26 +316,29 @@ namespace sfl {
void
AudioRtpSession
<
D
>::
setDestinationIpAddress
(
void
)
void
AudioRtpSession
<
D
>::
setDestinationIpAddress
(
void
)
{
{
if
(
_ca
==
NULL
)
{
if
(
_ca
==
NULL
)
{
_
debug
(
"
Sipcall is gone."
);
_
warn
(
"Rtp:
Sipcall is gone."
);
throw
AudioRtpSessionException
();
throw
AudioRtpSessionException
();
}
}
_
debug
(
"
Setting IP address for the RTP session"
);
_
info
(
"RTP:
Setting IP address for the RTP session"
);
// Store remote ip in case we would need to forget current destination
// Store remote ip in case we would need to forget current destination
_remote_ip
=
ost
::
InetHostAddress
(
_ca
->
getLocalSDP
()
->
get_remote_ip
().
c_str
());
_remote_ip
=
ost
::
InetHostAddress
(
_ca
->
getLocalSDP
()
->
get_remote_ip
().
c_str
());
_debug
(
"Init audio RTP session: remote ip %s"
,
_ca
->
getLocalSDP
()
->
get_remote_ip
().
data
());
if
(
!
_remote_ip
)
{
if
(
!
_remote_ip
)
{
_debug
(
"Target IP address [%s] is not correct!"
,
_ca
->
getLocalSDP
()
->
get_remote_ip
().
data
());
_warn
(
"Rtp: Target IP address (%s) is not correct!"
,
_ca
->
getLocalSDP
()
->
get_remote_ip
().
data
());
return
;
return
;
}
}
// Store remote port in case we would need to forget current destination
// Store remote port in case we would need to forget current destination
_remote_port
=
(
unsigned
short
)
_ca
->
getLocalSDP
()
->
get_remote_audio_port
();
_remote_port
=
(
unsigned
short
)
_ca
->
getLocalSDP
()
->
get_remote_audio_port
();
_info
(
"RTP: New remote address for session: %s:%d"
,
_ca
->
getLocalSDP
()
->
get_remote_ip
().
data
(),
_remote_port
);
if
(
!
static_cast
<
D
*>
(
this
)
->
addDestination
(
_remote_ip
,
_remote_port
))
{
if
(
!
static_cast
<
D
*>
(
this
)
->
addDestination
(
_remote_ip
,
_remote_port
))
{
_
debug
(
"
Can't add destination to session!"
);
_
warn
(
"Rtp:
Can't add
new
destination to session!"
);
return
;
return
;
}
}
}
}
...
@@ -346,9 +347,10 @@ namespace sfl {
...
@@ -346,9 +347,10 @@ namespace sfl {
void
AudioRtpSession
<
D
>::
updateDestinationIpAddress
(
void
)
void
AudioRtpSession
<
D
>::
updateDestinationIpAddress
(
void
)
{
{
// Destination address are stored in a list in ccrtp
// Destination address are stored in a list in ccrtp
// This method clear off this entry
// This method remove the current destination entry
_debug
(
"updateDestinationIpAddress: remove destination %s"
,
_ca
->
getLocalSDP
()
->
get_remote_ip
().
c_str
());
static_cast
<
D
*>
(
this
)
->
forgetDestination
(
_remote_ip
,
_remote_port
);
if
(
!
static_cast
<
D
*>
(
this
)
->
forgetDestination
(
_remote_ip
,
_remote_port
,
_remote_port
+
1
))
_warn
(
"Rtp: Could not remove previous destination"
);
// new destination is stored in call
// new destination is stored in call
// we just need to recall this method
// we just need to recall this method
...
@@ -534,7 +536,6 @@ namespace sfl {
...
@@ -534,7 +536,6 @@ namespace sfl {
{
{
setSessionTimeouts
();
setSessionTimeouts
();
setDestinationIpAddress
();
setSessionMedia
();
setSessionMedia
();
initBuffers
();
initBuffers
();
...
...
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