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
c3fdb98f
Commit
c3fdb98f
authored
Mar 25, 2010
by
Alexandre Savard
Browse files
[#3071] Fix segfault on receiving INVITE without SDP, send 488 error
parent
c4bae4ea
Changes
4
Hide whitespace changes
Inline
Side-by-side
sflphone-common/src/sip/sdp.cpp
View file @
c3fdb98f
...
...
@@ -211,6 +211,10 @@ int Sdp::receiving_initial_offer (pjmedia_sdp_session* remote, CodecOrder select
pj_status_t
status
;
if
(
!
remote
)
{
return
!
PJ_SUCCESS
;
}
// Create the SDP negociator instance by calling
// pjmedia_sdp_neg_create_w_remote_offer with the remote offer, and by providing the local offer ( optional )
...
...
@@ -531,6 +535,19 @@ AudioCodec* Sdp::get_session_media (void)
}
pj_status_t
Sdp
::
start_negociation
()
{
pj_status_t
status
;
if
(
_negociator
)
{
status
=
pjmedia_sdp_neg_negotiate
(
_pool
,
_negociator
,
0
);
}
else
{
status
=
!
PJ_SUCCESS
;
}
return
status
;
}
void
Sdp
::
toString
(
void
)
{
...
...
@@ -648,6 +665,9 @@ void Sdp::set_media_transport_info_from_remote_sdp (const pjmedia_sdp_session *r
_info
(
"SDP: Fetching media from sdp"
);
if
(
!
remote_sdp
)
return
;
pjmedia_sdp_media
*
r_media
;
this
->
get_remote_sdp_media_from_offer
(
remote_sdp
,
&
r_media
);
...
...
@@ -667,6 +687,9 @@ void Sdp::get_remote_sdp_media_from_offer (const pjmedia_sdp_session* remote_sdp
{
int
count
,
i
;
if
(
!
remote_sdp
)
return
;
count
=
remote_sdp
->
media_count
;
*
r_media
=
NULL
;
...
...
sflphone-common/src/sip/sdp.h
View file @
c3fdb98f
...
...
@@ -166,10 +166,7 @@ class Sdp {
* @return pj_status_t 0 on success
* 1 otherwise
*/
pj_status_t
start_negociation
(
void
){
return
pjmedia_sdp_neg_negotiate
(
_pool
,
_negociator
,
0
);
}
pj_status_t
start_negociation
(
void
);
/*
* Retrieve the negociated sdp offer from the sip payload.
...
...
@@ -221,7 +218,7 @@ class Sdp {
std
::
vector
<
sdpMedia
*>
get_session_media_list
(
void
)
{
return
_session_media
;
}
void
get_remote_sdp_crypto_from_offer
(
const
pjmedia_sdp_session
*
remote_sdp
,
CryptoOffer
&
crypto_offer
);
void
get_remote_sdp_crypto_from_offer
(
const
pjmedia_sdp_session
*
remote_sdp
,
CryptoOffer
&
crypto_offer
);
private:
/** Codec Map */
...
...
@@ -253,13 +250,13 @@ class Sdp {
/** Local audio port */
int
_local_extern_audio_port
;
/** Remote
's
audio port */
/** Remote audio port */
unsigned
int
_remote_audio_port
;
std
::
string
_zrtp_hello_hash
;
/** "a=crypto" sdes local attributes obtained from AudioSrtpSession */
std
::
vector
<
std
::
string
>
_srtp_crypto
;
/** "a=crypto" sdes local attributes obtained from AudioSrtpSession */
std
::
vector
<
std
::
string
>
_srtp_crypto
;
Sdp
(
const
Sdp
&
);
//No Copy Constructor
Sdp
&
operator
=
(
const
Sdp
&
);
//No Assignment Operator
...
...
@@ -350,12 +347,12 @@ class Sdp {
void
get_remote_sdp_media_from_offer
(
const
pjmedia_sdp_session
*
r_sdp
,
pjmedia_sdp_media
**
r_media
);
/*
/*
* Adds a sdes attribute to the given media section.
*
* @param media The media to add the srtp attribute to
*/
void
sdp_add_sdes_attribute
(
std
::
vector
<
std
::
string
>&
crypto
);
*/
void
sdp_add_sdes_attribute
(
std
::
vector
<
std
::
string
>&
crypto
);
/*
* Adds a zrtp-hash attribute to
...
...
sflphone-common/src/sip/sipvoiplink.cpp
View file @
c3fdb98f
...
...
@@ -820,30 +820,20 @@ SIPVoIPLink::newOutgoingCall (const CallID& id, const std::string& toUrl)
bool
SIPVoIPLink
::
answer
(
const
CallID
&
id
)
{
SIPCall
*
call
;
pj_status_t
status
;
pjsip_tx_data
*
tdata
;
Sdp
*
local_sdp
;
pjsip_inv_session
*
inv_session
;
_debug
(
"
SIPVoIPLink::answer: start answering "
);
_debug
(
"
UserAgent: Answering call %s"
,
id
.
c_str
()
);
call
=
getSIPCall
(
id
);
SIPCall
*
call
=
getSIPCall
(
id
);
if
(
call
==
0
)
{
_debug
(
"
! SIP Failure
: SIPCall doesn't exists
"
);
_debug
(
"
UserAgent
: SIPCall
%s
doesn't exists
while answering"
,
id
.
c_str
()
);
return
false
;
}
local_sdp
=
call
->
getLocalSDP
();
/*
try {
call->getAudioRtp()->initAudioRtpSession (call);
} catch (...) {
_debug ("Failed to create rtp thread from answer");
}
*/
Sdp
*
local_sdp
=
call
->
getLocalSDP
();
inv_session
=
call
->
getInvSession
();
...
...
@@ -3683,7 +3673,6 @@ mod_on_rx_request (pjsip_rx_data *rdata)
return
false
;
}
/* Create the local dialog (UAS) */
status
=
pjsip_dlg_create_uas
(
pjsip_ua_instance
(),
rdata
,
NULL
,
&
dialog
);
if
(
status
!=
PJ_SUCCESS
)
{
...
...
sflphone-common/src/sip/sipvoiplink.h
View file @
c3fdb98f
...
...
@@ -422,7 +422,7 @@ class SIPVoIPLink : public VoIPLink
* General Sip transport creation method according to the
* transport type specified in account settings
* @param id The account id for which a transport must
* be created.
* be created.
*/
bool
createSipTransport
(
AccountID
id
);
...
...
@@ -436,28 +436,28 @@ class SIPVoIPLink : public VoIPLink
*/
bool
addTransportToMap
(
std
::
string
key
,
pjsip_transport
*
transport
);
/**
/**
* Create SIP UDP transport from account's setting
* @param id The account id for which a transport must
* be created.
* be created.
* @return pj_status_t PJ_SUCCESS on success
*/
int
createUdpTransport
(
AccountID
=
""
);
/**
* Create a TLS transport from the default TLS listener from
* @param id The account id for which a transport must
* be created.
* @return pj_status_t PJ_SUCCESS on success
*/
pj_status_t
createTlsTransport
(
const
AccountID
&
id
,
std
::
string
remoteAddr
);
/**
* Create a TLS transport from the default TLS listener from
* @param id The account id for which a transport must
* be created.
* @return pj_status_t PJ_SUCCESS on success
*/
pj_status_t
createTlsTransport
(
const
AccountID
&
id
,
std
::
string
remoteAddr
);
/**
* Create a UDP transport using stun server to resove public address
* @param id The account id for which a transport must
* be created.
* @return pj_status_t PJ_SUCCESS on success
*/
* Create a UDP transport using stun server to resove public address
* @param id The account id for which a transport must
* be created.
* @return pj_status_t PJ_SUCCESS on success
*/
pj_status_t
createAlternateUdpTransport
(
AccountID
id
);
...
...
@@ -474,11 +474,11 @@ class SIPVoIPLink : public VoIPLink
EventThread
*
_evThread
;
ost
::
Mutex
_mutexSIP
;
/* Number of SIP accounts connected to the link */
int
_clients
;
/* Number of SIP accounts connected to the link */
int
_clients
;
/*
* Get the correct address to use (ie advertised) from
/*
* Get the correct address to use (ie advertised) from
* a uri. The corresponding transport that should be used
* with that uri will be discovered.
*
...
...
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