Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
36dc1109
Commit
36dc1109
authored
Nov 12, 2012
by
Tristan Matthews
Browse files
* #16856: sdp: look for connection in SDP and SDP media
This fixes the crash with pennytel SIP provider.
parent
565a7082
Changes
2
Hide whitespace changes
Inline
Side-by-side
daemon/src/sip/sdp.cpp
View file @
36dc1109
...
...
@@ -657,6 +657,22 @@ void Sdp::addAttributeToLocalVideoMedia(const char *attr)
pjmedia_sdp_media_add_attr
(
localSession_
->
media
[
i
],
attribute
);
}
void
Sdp
::
updateRemoteIP
(
unsigned
index
)
{
// Remote connection information may be in the SDP Session or in the media
// for that session
pjmedia_sdp_conn
*
conn
=
activeRemoteSession_
->
conn
?
activeRemoteSession_
->
conn
:
activeRemoteSession_
->
media
[
index
]
->
conn
?
activeRemoteSession_
->
media
[
index
]
->
conn
:
NULL
;
if
(
conn
)
remoteIpAddr_
=
std
::
string
(
conn
->
addr
.
ptr
,
conn
->
addr
.
slen
);
else
ERROR
(
"Could not get remote IP from SDP or SDP Media"
);
}
void
Sdp
::
setMediaTransportInfoFromRemoteSdp
()
{
if
(
!
activeRemoteSession_
)
{
...
...
@@ -667,10 +683,10 @@ void Sdp::setMediaTransportInfoFromRemoteSdp()
for
(
unsigned
i
=
0
;
i
<
activeRemoteSession_
->
media_count
;
++
i
)
{
if
(
pj_stricmp2
(
&
activeRemoteSession_
->
media
[
i
]
->
desc
.
media
,
"audio"
)
==
0
)
{
remoteAudioPort_
=
activeRemoteSession_
->
media
[
i
]
->
desc
.
port
;
remoteIpAddr_
=
std
::
string
(
activeRemoteSession_
->
conn
->
addr
.
ptr
,
activeRemoteSession_
->
conn
->
addr
.
slen
);
updateRemoteIP
(
i
);
}
else
if
(
pj_stricmp2
(
&
activeRemoteSession_
->
media
[
i
]
->
desc
.
media
,
"video"
)
==
0
)
{
remoteVideoPort_
=
activeRemoteSession_
->
media
[
i
]
->
desc
.
port
;
remoteIpAddr_
=
std
::
string
(
activeRemoteSession_
->
conn
->
addr
.
ptr
,
activeRemoteSession_
->
conn
->
addr
.
slen
);
updateRemoteIP
(
i
);
}
}
}
...
...
daemon/src/sip/sdp.h
View file @
36dc1109
...
...
@@ -255,6 +255,7 @@ class Sdp {
std
::
string
getOutgoingVideoField
(
const
std
::
string
&
codec
,
const
char
*
key
)
const
;
int
getOutgoingVideoPayload
()
const
;
void
getProfileLevelID
(
const
pjmedia_sdp_session
*
session
,
std
::
string
&
dest
,
int
payload
)
const
;
void
updateRemoteIP
(
unsigned
index
);
/**
* The pool to allocate memory, ownership to SipCall
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment