diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2016-05-25 05:25:12 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2016-05-25 05:25:12 +0000 |
commit | 05bfd4c43f25a31ccbc28929b2e6ced750f2f7ae (patch) | |
tree | 5137678d7a47713d0650436172b2a78fd5cf4f63 | |
parent | 43ef777450d68ad9ac3dd10300a8639070e6b89f (diff) |
Fix #1924: Put check whether dialog has been registered to pjsip UA before calling pjsip_ua_unregister_dlg() to avoid assertion.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5316 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjsip/src/pjsip/sip_dialog.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/pjsip/src/pjsip/sip_dialog.c b/pjsip/src/pjsip/sip_dialog.c index 1964caa9..0e7fadcd 100644 --- a/pjsip/src/pjsip/sip_dialog.c +++ b/pjsip/src/pjsip/sip_dialog.c @@ -787,11 +787,13 @@ static pj_status_t unregister_and_destroy_dialog( pjsip_dialog *dlg, /* MUST not have pending transactions. */ PJ_ASSERT_RETURN(dlg->tsx_count==0, PJ_EINVALIDOP); - /* Unregister from user agent. */ - status = pjsip_ua_unregister_dlg(dlg->ua, dlg); - if (status != PJ_SUCCESS) { - pj_assert(!"Unexpected failed unregistration!"); - return status; + /* Unregister from user agent, if it has been registered (see #1924) */ + if (dlg->dlg_set) { + status = pjsip_ua_unregister_dlg(dlg->ua, dlg); + if (status != PJ_SUCCESS) { + pj_assert(!"Unexpected failed unregistration!"); + return status; + } } /* Log */ |