-
Notifications
You must be signed in to change notification settings - Fork 774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assertion due to deleted account during incoming call in PJSUA2 #4024
Conversation
/* For PJSUA2, avoid invoking this callback again when it has been | ||
* invoked from on_media_transport_created(). | ||
*/ | ||
if (call->incoming_data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it impact somehow on pjsua interface callbacks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not. The call->incoming_data
is only released & set to NULL after invoking incoming call callback.
pjsip/src/pjsua-lib/pjsua_call.c
Outdated
@@ -2167,7 +2167,12 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata) | |||
* otherwise hangup the call with 480 | |||
*/ | |||
if (pjsua_var.ua_cfg.cb.on_incoming_call) { | |||
pjsua_var.ua_cfg.cb.on_incoming_call(acc_id, call_id, rdata); | |||
/* For PJSUA2, avoid invoking this callback again when it has been | |||
* invoked from on_media_transport_created(). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on_create_media_transport()?
Perhaps also fix L#2144 above: https://github.com/pjsip/pjproject/pull/4024/files#diff-38326e41666262ac676da6de5d00a2f2ef0741b5ed851d1f1fae46aded951bf1L2144
Reported that assertion occurs in incoming call callback due to the selected account is being deleted:
Initially this sounds strange as
pjsua_call_on_incoming()
andpjsua_acc_del()
seem to be mutually exclusive, i.e: protected by PJSUA lock. However, after investigation, it is possible becausepjsua_call_on_state_changed()
may temporarily release the PJSUA lock. In PJSUA2 (not the case in PJSUA), thepjsua_call_on_state_changed()
will be called when a 100/Trying response is sent and the incoming call callback is called early (before media transport creation callback and before sending 100 response).The assertion seems to occur when PJSUA invokes incoming call callback (after sending 100 response or
pjsua_call_on_state_changed()
) which eventually will be ignored by PJSUA2 as such callback has been called earlier, so the proposed solution here is to avoid invoking the PJSUA callback when PJSUA2 has invoke the incoming call callback earlier.Thanks to Valery Kolesnikov for the report.