Skip to content
Snippets Groups Projects
Commit db2fc6e2 authored by Yun Liu's avatar Yun Liu
Browse files

Fix bug when user make an outgoing calll with invalid sip server name

parent b529ed68
No related branches found
No related tags found
No related merge requests found
...@@ -925,12 +925,15 @@ bool SIPManager::makeOutgoingCall(const std::string& strTo, SIPCall* call, const ...@@ -925,12 +925,15 @@ bool SIPManager::makeOutgoingCall(const std::string& strTo, SIPCall* call, const
status = pjsip_inv_invite(inv, &tdata); status = pjsip_inv_invite(inv, &tdata);
PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);
status = pjsip_inv_send_msg(inv, tdata);
PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);
// Associate current invite session in the call // Associate current invite session in the call
call->setInvSession(inv); call->setInvSession(inv);
status = pjsip_inv_send_msg(inv, tdata);
//PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);
if(status != PJ_SUCCESS) {
return false;
}
return true; return true;
} }
...@@ -972,16 +975,6 @@ void SIPManager::call_on_tsx_changed(pjsip_inv_session *inv, pjsip_transaction * ...@@ -972,16 +975,6 @@ void SIPManager::call_on_tsx_changed(pjsip_inv_session *inv, pjsip_transaction *
link->SIPCallAnswered(call, rdata); link->SIPCallAnswered(call, rdata);
} else if (tsx->status_code / 100 == 5) { } else if (tsx->status_code / 100 == 5) {
_debug("SIPManager: 5xx error message received\n"); _debug("SIPManager: 5xx error message received\n");
call = reinterpret_cast<SIPCall *> (inv->mod_data[getInstance()->getModId()]);
if (call == NULL) {
_debug("SIPManager: Call has been removed!\n");
return;
}
accId = Manager::instance().getAccountFromCall(call->getCallId());
link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink(accId));
if (link) {
link->SIPCallServerFailure(call);
}
} }
break; break;
case PJSIP_TSX_STATE_PROCEEDING: case PJSIP_TSX_STATE_PROCEEDING:
......
...@@ -418,9 +418,7 @@ SIPVoIPLink::SIPStartCall(SIPCall* call, const std::string& subject) ...@@ -418,9 +418,7 @@ SIPVoIPLink::SIPStartCall(SIPCall* call, const std::string& subject)
//setCallAudioLocal(call); //setCallAudioLocal(call);
AccountID accId = getAccountID(); AccountID accId = getAccountID();
Manager::instance().getSipManager()->makeOutgoingCall(to, call, accId); return Manager::instance().getSipManager()->makeOutgoingCall(to, call, accId);
return true;
} }
std::string std::string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment