Ticket #1923 (closed defect: fixed)

Opened 21 months ago

Last modified 21 months ago

Assertion in answering call from onIncomingCall() callback

Reported by: nanang Owned by: bennylp
Priority: normal Milestone: release-2.5.1
Component: pjsua2 Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no

Description (last modified by nanang) (diff)

onIncomingCall() callback may be simulated by onCreateMediaTransport() (see #1916). And if app happens to answer the call from the callback, assertion is raised:

Assertion failed: inv->last_answer, file pjsip/src/pjsip-ua/sip_inv.c, line 2321

Call stack:

abort()  Line 59 + 0x7 bytes	C
_wassert(const wchar_t * expr=0x00820b4c, const wchar_t * filename=0x0081fc60, unsigned int lineno=2321)  Line 212	C
pjsip_inv_answer(pjsip_inv_session * inv=0x02ac9244, int st_code=200, const pj_str_t * st_text=0x00000000, const pjmedia_sdp_session * local_sdp=0x00000000, pjsip_tx_data * * p_tdata=0x034ae44c)  Line 2321 + 0x2b bytes	C
pjsua_call_answer2(int call_id=0, const pjsua_call_setting * opt=0x00000000, unsigned int code=200, const pj_str_t * reason=0x00000000, const pjsua_msg_data * msg_data=0x00000000)  Line 2261 + 0x1a bytes	C
pj::Call::answer(const pj::CallOpParam & prm={...})  Line 498 + 0x1f bytes	C++
MyAccount::onIncomingCall(pj::OnIncomingCallParam & iprm={...})  Line 91	C++
pj::Endpoint::on_incoming_call(int acc_id=0, int call_id=0, pjsip_rx_data * rdata=0x02ac5b84)  Line 622	C++
pj::Endpoint::on_create_media_transport(int call_id=0, unsigned int media_idx=0, pjmedia_transport * base_tp=0x02acdbc4, unsigned int flags=1)  Line 1247 + 0x1a bytes	C++
media_channel_init_cb(int call_id=0, const pjsua_med_tp_state_info * info=0x00000000)  Line 1646 + 0x19 bytes	C
pjsua_media_channel_init(int call_id=0, pjsip_role_e role=PJSIP_ROLE_UAS, int security_level=0, pj_pool_t * tmp_pool=0x02ac0f90, const pjmedia_sdp_session * rem_sdp=0x02ac39a0, int * sip_err_code=0x034af564, int async=1, int (int, const pjsua_med_tp_state_info *)* cb=0x005e0a70)  Line 2029 + 0xb bytes	C
pjsua_call_on_incoming(pjsip_rx_data * rdata=0x02ac1fe4)  Line 1492 + 0x29 bytes	C

An idea is to delay the call-answer until initial answer is sent and some other call initializations are done.

Change History

comment:1 Changed 21 months ago by nanang

  • Status changed from new to closed
  • Resolution set to fixed

In 5314:

Fix #1923: Delay call-answer triggered from simulated onIncomingCall() to avoid assertion.

comment:2 Changed 21 months ago by nanang

  • Description modified (diff)

comment:3 Changed 21 months ago by riza

In 5323:

Re #1923: Delay call-hangup triggered from simulated onIncomingCall() to avoid assertion.

comment:4 Changed 21 months ago by nanang

In 5329:

Re #1923: Added check for call availability before processing delayed answer, as call may have been disconnected after call is answered with 200 from on_incoming_call() callback but media fails to start.

Note: See TracTickets for help on using tickets.