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
de3b93a1
Commit
de3b93a1
authored
Aug 07, 2012
by
Tristan Matthews
Browse files
* #14434: sip: don't start call if offer was not created
parent
3c9925ad
Changes
3
Hide whitespace changes
Inline
Side-by-side
daemon/src/sip/sdp.cpp
View file @
de3b93a1
...
...
@@ -351,12 +351,19 @@ int Sdp::createLocalSession(const vector<int> &selectedAudioCodecs, const vector
return
pjmedia_sdp_validate
(
localSession_
);
}
void
Sdp
::
createOffer
(
const
vector
<
int
>
&
selectedCodecs
,
const
vector
<
map
<
string
,
string
>
>
&
videoCodecs
)
bool
Sdp
::
createOffer
(
const
vector
<
int
>
&
selectedCodecs
,
const
vector
<
map
<
string
,
string
>
>
&
videoCodecs
)
{
if
(
createLocalSession
(
selectedCodecs
,
videoCodecs
)
!=
PJ_SUCCESS
)
bool
result
=
true
;
if
(
createLocalSession
(
selectedCodecs
,
videoCodecs
)
!=
PJ_SUCCESS
)
{
ERROR
(
"Failed to create initial offer"
);
else
if
(
pjmedia_sdp_neg_create_w_local_offer
(
memPool_
,
localSession_
,
&
negotiator_
)
!=
PJ_SUCCESS
)
result
=
false
;
}
else
if
(
pjmedia_sdp_neg_create_w_local_offer
(
memPool_
,
localSession_
,
&
negotiator_
)
!=
PJ_SUCCESS
)
{
ERROR
(
"Failed to create an initial SDP negotiator"
);
result
=
false
;
}
return
result
;
}
void
Sdp
::
receiveOffer
(
const
pjmedia_sdp_session
*
remote
,
...
...
daemon/src/sip/sdp.h
View file @
de3b93a1
...
...
@@ -118,8 +118,11 @@ class Sdp {
/*
* On building an invite outside a dialog, build the local offer and create the
* SDP negotiator instance with it.
* @returns true if offer was created, false otherwise
*/
void
createOffer
(
const
std
::
vector
<
int
>
&
selectedCodecs
,
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>
&
videoCodecs
);
bool
createOffer
(
const
std
::
vector
<
int
>
&
selectedCodecs
,
const
std
::
vector
<
std
::
map
<
std
::
string
,
std
::
string
>
>
&
videoCodecs
);
/*
* On receiving an invite outside a dialog, build the local offer and create the
...
...
daemon/src/sip/sipvoiplink.cpp
View file @
de3b93a1
...
...
@@ -785,10 +785,11 @@ Call *SIPVoIPLink::SIPNewIpToIpCall(const std::string& id, const std::string& to
call
->
getAudioRtp
().
start
(
ac
);
// Building the local SDP offer
call
->
getLocalSDP
()
->
setLocalIP
(
localAddress
);
call
->
getLocalSDP
()
->
createOffer
(
account
->
getActiveAudioCodecs
(),
account
->
getActiveVideoCodecs
());
Sdp
*
localSDP
=
call
->
getLocalSDP
();
localSDP
->
setLocalIP
(
localAddress
);
const
bool
created
=
localSDP
->
createOffer
(
account
->
getActiveAudioCodecs
(),
account
->
getActiveVideoCodecs
());
if
(
!
SIPStartCall
(
call
))
{
if
(
not
created
or
not
SIPStartCall
(
call
))
{
delete
call
;
throw
VoipLinkException
(
"Could not create new call"
);
}
...
...
@@ -847,10 +848,11 @@ Call *SIPVoIPLink::newRegisteredAccountCall(const std::string& id, const std::st
call
->
initRecFilename
(
toUrl
);
call
->
getLocalSDP
()
->
setLocalIP
(
addrSdp
);
call
->
getLocalSDP
()
->
createOffer
(
account
->
getActiveAudioCodecs
(),
account
->
getActiveVideoCodecs
());
Sdp
*
localSDP
=
call
->
getLocalSDP
();
localSDP
->
setLocalIP
(
addrSdp
);
const
bool
created
=
localSDP
->
createOffer
(
account
->
getActiveAudioCodecs
(),
account
->
getActiveVideoCodecs
());
if
(
!
SIPStartCall
(
call
))
{
if
(
not
created
or
not
SIPStartCall
(
call
))
{
delete
call
;
throw
VoipLinkException
(
"Could not send outgoing INVITE request for new call"
);
}
...
...
@@ -1478,10 +1480,11 @@ void sdp_create_offer_cb(pjsip_inv_session *inv, pjmedia_sdp_session **p_offer)
setCallMediaLocal
(
call
,
localAddress
);
call
->
getLocalSDP
()
->
setLocalIP
(
addrSdp
);
call
->
getLocalSDP
()
->
createOffer
(
account
->
getActiveAudioCodecs
(),
account
->
getActiveVideoCodecs
());
*
p_offer
=
call
->
getLocalSDP
()
->
getLocalSdpSession
();
Sdp
*
localSDP
=
call
->
getLocalSDP
();
localSDP
->
setLocalIP
(
addrSdp
);
const
bool
created
=
localSDP
->
createOffer
(
account
->
getActiveAudioCodecs
(),
account
->
getActiveVideoCodecs
());
if
(
created
)
*
p_offer
=
localSDP
->
getLocalSdpSession
();
}
// This callback is called after SDP offer/answer session has completed.
...
...
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