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
604a080f
Commit
604a080f
authored
Jul 18, 2019
by
Ming Rui Zhang
Committed by
Adrien Béraud
Jul 18, 2019
Browse files
sip: fix the issue when the endpoint request fails, system crashes
Change-Id: I434ed02a0a019a254c547b52ff134939ffa7d65d
parent
d2132142
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sip/sipaccount.cpp
View file @
604a080f
...
...
@@ -2137,14 +2137,12 @@ SIPAccount::sendTextMessage(const std::string& to, const std::map<std::string, s
im
::
fillPJSIPMessageBody
(
*
tdata
,
payloads
);
// Send message request with callback onComplete
auto
token
=
t
.
release
();
status
=
pjsip_endpt_send_request
(
link_
->
getEndpoint
(),
tdata
,
-
1
,
token
,
&
onComplete
);
// Send message request with callback SendMessageOnComplete
status
=
pjsip_endpt_send_request
(
link_
->
getEndpoint
(),
tdata
,
-
1
,
t
.
release
(),
&
onComplete
);
if
(
status
!=
PJ_SUCCESS
)
{
JAMI_ERR
(
"Unable to send request: %s"
,
sip_utils
::
sip_strerror
(
status
).
c_str
());
messageEngine_
.
onMessageSent
(
to
,
id
,
false
);
delete
token
;
return
;
}
}
...
...
@@ -2179,13 +2177,11 @@ SIPAccount::onComplete(void *token, pjsip_event *event)
cseq_hdr
->
cseq
+=
1
;
// Resend request
auto
data
=
c
.
release
();
status
=
pjsip_endpt_send_request
(
acc
->
link_
->
getEndpoint
(),
new_request
,
-
1
,
data
,
&
onComplete
);
status
=
pjsip_endpt_send_request
(
acc
->
link_
->
getEndpoint
(),
new_request
,
-
1
,
c
.
release
(),
&
onComplete
);
if
(
status
!=
PJ_SUCCESS
)
{
JAMI_ERR
(
"Unable to send request: %s"
,
sip_utils
::
sip_strerror
(
status
).
c_str
());
acc
->
messageEngine_
.
onMessageSent
(
c
->
to
,
c
->
id
,
false
);
delete
data
;
}
return
;
}
...
...
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