diff options
author | Benny Prijono <bennylp@teluu.com> | 2010-09-28 08:03:23 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2010-09-28 08:03:23 +0000 |
commit | c31e3c462b475902964707fe5a75df33b34474d7 (patch) | |
tree | 2a5d7597186eb9f3992f6ca45f3ad921a9cfa1b9 | |
parent | 6e7c99b00209bbdb5403cec88f6b7ad01e25526c (diff) |
Fixed #1131: Callee disconnects call without sending BYE if ACK is not received (thanks Montevecchi Massimiliano and Klaus Darilion for the report)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3324 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjsip/src/pjsip-ua/sip_inv.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c index ac136825..b7130a6c 100644 --- a/pjsip/src/pjsip-ua/sip_inv.c +++ b/pjsip/src/pjsip-ua/sip_inv.c @@ -3729,8 +3729,21 @@ static void inv_on_state_connecting( pjsip_inv_session *inv, pjsip_event *e) * error. */ if (tsx->status_code/100 != 2) { - inv_set_cause(inv, tsx->status_code, &tsx->status_text); - inv_set_state(inv, PJSIP_INV_STATE_DISCONNECTED, e); + if (tsx->role == PJSIP_ROLE_UAC) { + inv_set_cause(inv, tsx->status_code, &tsx->status_text); + inv_set_state(inv, PJSIP_INV_STATE_DISCONNECTED, e); + } else { + pjsip_tx_data *bye; + pj_status_t status; + + /* Send BYE */ + status = pjsip_dlg_create_request(inv->dlg, + pjsip_get_bye_method(), + -1, &bye); + if (status == PJ_SUCCESS) { + pjsip_inv_send_msg(inv, bye); + } + } } break; |