From 631a93856257ff50c95ead238ef0080afdff0408 Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Tue, 26 Feb 2013 12:38:27 +0000 Subject: Close #1627: invoke on_tsx_state_changed() callback from on_call_state(DISCONNECTED). git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4371 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsua-lib/pjsua_call.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'pjsip/src/pjsua-lib/pjsua_call.c') diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index b801167f..f42ccf09 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -3503,6 +3503,15 @@ static void pjsua_call_on_state_changed(pjsip_inv_session *inv, } } + /* Ticket #1627: Invoke on_call_tsx_state() when call is disconnected. */ + if (inv->state == PJSIP_INV_STATE_DISCONNECTED && + e->type == PJSIP_EVENT_TSX_STATE && + call->inv && + pjsua_var.ua_cfg.cb.on_call_tsx_state) + { + (*pjsua_var.ua_cfg.cb.on_call_tsx_state)(call->index, + e->body.tsx_state.tsx, e); + } if (pjsua_var.ua_cfg.cb.on_call_state) (*pjsua_var.ua_cfg.cb.on_call_state)(call->index, e); @@ -4414,11 +4423,7 @@ static void pjsua_call_on_tsx_state_changed(pjsip_inv_session *inv, goto on_return; if (call->inv == NULL) { - /* Shouldn't happen. It happens only when we don't terminate the - * server subscription caused by REFER after the call has been - * transfered (and this call has been disconnected), and we - * receive another REFER for this call. - */ + /* Call has been disconnected. */ goto on_return; } -- cgit v1.2.3