//---------------------------------------------------------------------- void SipPhone::unregister() { LogInfo info(LogInfo::STATUS_MESSAGE, "pjsip", 0, "Unregister account"); signalLogData(info); if (pjsua_acc_is_valid(acc_id_)) { hangUpAll(); pjsua_acc_del(acc_id_); } }
SipAccount::~SipAccount() { Logger::debug("SipAccount::~SipAccount()..."); m_pPhone = NULL; if (m_accId == -1) { return; } (void)pjsua_acc_set_user_data(m_accId, NULL); pj_status_t status = pjsua_acc_del(m_accId); m_accId = -1; if (status != PJ_SUCCESS) { Logger::warn("pjsua_acc_del() failed (%s)", Helper::getPjStatusAsString(status).c_str()); } }
static void ui_delete_account() { char buf[128]; int i; if (!simple_input("Enter account ID to delete", buf, sizeof(buf))) return; i = my_atoi(buf); if (!pjsua_acc_is_valid(i)) { printf("Invalid account id %d\n", i); } else { pjsua_acc_del(i); printf("Account %d deleted\n", i); } }