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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
de3b93a1
Commit
de3b93a1
authored
12 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #14434: sip: don't start call if offer was not created
parent
3c9925ad
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
+10
-3
10 additions, 3 deletions
daemon/src/sip/sdp.cpp
daemon/src/sip/sdp.h
+4
-1
4 additions, 1 deletion
daemon/src/sip/sdp.h
daemon/src/sip/sipvoiplink.cpp
+13
-10
13 additions, 10 deletions
daemon/src/sip/sipvoiplink.cpp
with
27 additions
and
14 deletions
daemon/src/sip/sdp.cpp
+
10
−
3
View file @
de3b93a1
...
@@ -351,12 +351,19 @@ int Sdp::createLocalSession(const vector<int> &selectedAudioCodecs, const vector
...
@@ -351,12 +351,19 @@ int Sdp::createLocalSession(const vector<int> &selectedAudioCodecs, const vector
return
pjmedia_sdp_validate
(
localSession_
);
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"
);
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"
);
ERROR
(
"Failed to create an initial SDP negotiator"
);
result
=
false
;
}
return
result
;
}
}
void
Sdp
::
receiveOffer
(
const
pjmedia_sdp_session
*
remote
,
void
Sdp
::
receiveOffer
(
const
pjmedia_sdp_session
*
remote
,
...
...
This diff is collapsed.
Click to expand it.
daemon/src/sip/sdp.h
+
4
−
1
View file @
de3b93a1
...
@@ -118,8 +118,11 @@ class Sdp {
...
@@ -118,8 +118,11 @@ class Sdp {
/*
/*
* On building an invite outside a dialog, build the local offer and create the
* On building an invite outside a dialog, build the local offer and create the
* SDP negotiator instance with it.
* 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
* On receiving an invite outside a dialog, build the local offer and create the
...
...
This diff is collapsed.
Click to expand it.
daemon/src/sip/sipvoiplink.cpp
+
13
−
10
View file @
de3b93a1
...
@@ -785,10 +785,11 @@ Call *SIPVoIPLink::SIPNewIpToIpCall(const std::string& id, const std::string& to
...
@@ -785,10 +785,11 @@ Call *SIPVoIPLink::SIPNewIpToIpCall(const std::string& id, const std::string& to
call
->
getAudioRtp
().
start
(
ac
);
call
->
getAudioRtp
().
start
(
ac
);
// Building the local SDP offer
// Building the local SDP offer
call
->
getLocalSDP
()
->
setLocalIP
(
localAddress
);
Sdp
*
localSDP
=
call
->
getLocalSDP
();
call
->
getLocalSDP
()
->
createOffer
(
account
->
getActiveAudioCodecs
(),
account
->
getActiveVideoCodecs
());
localSDP
->
setLocalIP
(
localAddress
);
const
bool
created
=
localSDP
->
createOffer
(
account
->
getActiveAudioCodecs
(),
account
->
getActiveVideoCodecs
());
if
(
!
SIPStartCall
(
call
))
{
if
(
not
created
or
not
SIPStartCall
(
call
))
{
delete
call
;
delete
call
;
throw
VoipLinkException
(
"Could not create new call"
);
throw
VoipLinkException
(
"Could not create new call"
);
}
}
...
@@ -847,10 +848,11 @@ Call *SIPVoIPLink::newRegisteredAccountCall(const std::string& id, const std::st
...
@@ -847,10 +848,11 @@ Call *SIPVoIPLink::newRegisteredAccountCall(const std::string& id, const std::st
call
->
initRecFilename
(
toUrl
);
call
->
initRecFilename
(
toUrl
);
call
->
getLocalSDP
()
->
setLocalIP
(
addrSdp
);
Sdp
*
localSDP
=
call
->
getLocalSDP
();
call
->
getLocalSDP
()
->
createOffer
(
account
->
getActiveAudioCodecs
(),
account
->
getActiveVideoCodecs
());
localSDP
->
setLocalIP
(
addrSdp
);
const
bool
created
=
localSDP
->
createOffer
(
account
->
getActiveAudioCodecs
(),
account
->
getActiveVideoCodecs
());
if
(
!
SIPStartCall
(
call
))
{
if
(
not
created
or
not
SIPStartCall
(
call
))
{
delete
call
;
delete
call
;
throw
VoipLinkException
(
"Could not send outgoing INVITE request for new 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)
...
@@ -1478,10 +1480,11 @@ void sdp_create_offer_cb(pjsip_inv_session *inv, pjmedia_sdp_session **p_offer)
setCallMediaLocal
(
call
,
localAddress
);
setCallMediaLocal
(
call
,
localAddress
);
call
->
getLocalSDP
()
->
setLocalIP
(
addrSdp
);
Sdp
*
localSDP
=
call
->
getLocalSDP
();
call
->
getLocalSDP
()
->
createOffer
(
account
->
getActiveAudioCodecs
(),
account
->
getActiveVideoCodecs
());
localSDP
->
setLocalIP
(
addrSdp
);
const
bool
created
=
localSDP
->
createOffer
(
account
->
getActiveAudioCodecs
(),
account
->
getActiveVideoCodecs
());
*
p_offer
=
call
->
getLocalSDP
()
->
getLocalSdpSession
();
if
(
created
)
*
p_offer
=
localSDP
->
getLocalSdpSession
();
}
}
// This callback is called after SDP offer/answer session has completed.
// This callback is called after SDP offer/answer session has completed.
...
...
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