diff --git a/src/audio/audiostream.cpp b/src/audio/audiostream.cpp index 89c6b29b0203416e6870bc072bf14d10fca7d7d7..520443d15741cb267021788087fc17d9f2e99305 100644 --- a/src/audio/audiostream.cpp +++ b/src/audio/audiostream.cpp @@ -96,7 +96,14 @@ AudioStream::createStream( pa_context* c ) //pa_cvolume_set(&cv, sample_spec.channels , PA_VOLUME_NORM) , NULL ); } else if( _streamType == CAPTURE_STREAM ){ - pa_stream_connect_record( s , NULL , NULL , PA_STREAM_START_CORKED ); +/* + attributes->maxlength = 66500;//-1; + attributes->tlength = -1; //44100; + attributes->minreq = 2000; + attributes->prebuf = 10000; + attributes->fragsize = -1; +*/ + pa_stream_connect_record( s , NULL , /*attributes*/ NULL , PA_STREAM_START_CORKED ); } else if( _streamType == UPLOAD_STREAM ){ pa_stream_connect_upload( s , 1024 ); diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp index c5eaec634426ff0271ebfd43c1962f68fd96b23d..f82762b947481bb932d0abaa52f6532119558669 100644 --- a/src/managerimpl.cpp +++ b/src/managerimpl.cpp @@ -449,6 +449,7 @@ ManagerImpl::initRegisterAccounts() { int status; + bool flag = true; AccountMap::iterator iter; _debugInit("Initiate VoIP Links Registration"); @@ -459,7 +460,8 @@ ManagerImpl::initRegisterAccounts() iter->second->loadConfig(); if ( iter->second->isEnabled() ) { status = iter->second->registerVoIPLink(); - ASSERT( status, SUCCESS ); + if (status != SUCCESS) + flag = false; } } iter++; @@ -468,6 +470,7 @@ ManagerImpl::initRegisterAccounts() if( _audiodriver -> getErrorMessage() != -1 ) notifyErrClient( _audiodriver -> getErrorMessage() ); + ASSERT( flag, true ); return SUCCESS; } diff --git a/src/useragent.cpp b/src/useragent.cpp index 6056be7259ee22d27ac0c2a4502b238df10526a1..cc9d8c1e5adf351cb2e26c8cecbe7ac1cc02b87b 100644 --- a/src/useragent.cpp +++ b/src/useragent.cpp @@ -358,7 +358,7 @@ void UserAgent::busy_sleep(unsigned msec) #endif } -int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& server, const std::string& user, const std::string& passwd, +bool UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& server, const std::string& user, const std::string& passwd, const int& timeout UNUSED) { pj_status_t status; AccountID *currentId = new AccountID(id); @@ -376,7 +376,7 @@ int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& s status = pjsip_regc_create(_endpt, (void *) currentId, ®c_cb, ®c); if (status != PJ_SUCCESS) { _debug("UserAgent: Unable to create regc.\n"); - return status; + return false; } tmp = "sip:" + server; @@ -394,7 +394,7 @@ int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& s status = pjsip_regc_init(regc, &svr, &aor, &aor, 1, &contact, 600); //timeout); if (status != PJ_SUCCESS) { _debug("UserAgent: Unable to initialize regc. %d\n", status); //, regc->str_srv_url.ptr); - return status; + return false; } @@ -418,13 +418,13 @@ int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& s status = pjsip_regc_register(regc, PJ_TRUE, &tdata); if (status != PJ_SUCCESS) { _debug("UserAgent: Unable to register regc.\n"); - return status; + return false; } status = pjsip_regc_send(regc, tdata); if (status != PJ_SUCCESS) { _debug("UserAgent: Unable to send regc request.\n"); - return status; + return false; } account->setUserName(user); @@ -436,7 +436,7 @@ int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& s pj_mutex_unlock(_mutex); - return PJ_SUCCESS; + return true; } bool UserAgent::removeAccount(pjsip_regc *regc) @@ -893,7 +893,7 @@ bool UserAgent::makeOutgoingCall(const std::string& strTo, SIPCall* call, const &to, NULL, &dialog); - PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); + PJ_ASSERT_RETURN(status == PJ_SUCCESS, false); setCallAudioLocal(call); call->setIp(getInstance()->getLocalIP()); @@ -904,7 +904,7 @@ bool UserAgent::makeOutgoingCall(const std::string& strTo, SIPCall* call, const // Create the invite session for this call pjsip_inv_session *inv; status = pjsip_inv_create_uac(dialog, call->getLocalSDPSession(), 0, &inv); - PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); + PJ_ASSERT_RETURN(status == PJ_SUCCESS, false); // Set auth information pjsip_auth_clt_set_credentials(&dialog->auth_sess, 1, account->getCredInfo()); @@ -913,7 +913,7 @@ bool UserAgent::makeOutgoingCall(const std::string& strTo, SIPCall* call, const inv->mod_data[_mod.id] = call; status = pjsip_inv_invite(inv, &tdata); - PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); + PJ_ASSERT_RETURN(status == PJ_SUCCESS, false); // Associate current invite session in the call call->setInvSession(inv); @@ -941,7 +941,12 @@ void UserAgent::call_on_tsx_changed(pjsip_inv_session *inv, pjsip_transaction *t pjsip_msg *msg; _debug("UserAgent: TSX Changed! The tsx->state is %d; tsx->role is %d; code is %d; method id is %.*s.\n", - tsx->state, tsx->role, tsx->status_code, tsx->method.name.slen, tsx->method.name.ptr); + tsx->state, tsx->role, tsx->status_code, (int)tsx->method.name.slen, tsx->method.name.ptr); + + if(pj_strcmp2(&tsx->method.name, "INFO") == 0) { + // Receive a INFO message, ingore it! + return; + } //Retrieve the body message rdata = e->body.tsx_state.src.rdata; diff --git a/src/useragent.h b/src/useragent.h index 32f579dcdd9d1f48669201153872daf4342834c7..6e99397ffa5baa430e6ea56c71c0f6a12905f9c1 100644 --- a/src/useragent.h +++ b/src/useragent.h @@ -102,7 +102,7 @@ public: pj_str_t getStunServer() { return _stunHost; } - int addAccount(AccountID id, pjsip_regc **regc, const std::string& server, const std::string& user, const std::string& passwd + bool addAccount(AccountID id, pjsip_regc **regc, const std::string& server, const std::string& user, const std::string& passwd , const int& timeout); bool removeAccount(pjsip_regc *regc);