Skip to content

Commit 7d7527b

Browse files
committedMay 28, 2019
Various fixes to compile in Ubuntu 19.04
1 parent 17179e3 commit 7d7527b

19 files changed

+76
-68
lines changed
 

‎README

+4-9
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,12 @@ To install build dependencies
3939

4040
## Prerequisites for Ubuntu
4141
apt-get -qq update
42-
apt-get install -y libpoco-dev
43-
apt-get install -y libboost-all-dev
44-
apt-get install -y libzmq3-dev
45-
apt-get install -y libv8-dev
46-
apt-get install -y libhiredis-dev
47-
apt-get install -y libconfig++-dev
48-
apt-get install -y libpcap-dev
42+
apt-get install -y build-essential autoconf libtool
43+
apt-get install -y libpoco-dev libboost-all-dev libzmq3-dev libv8-dev libhiredis-dev libconfig++-dev libpcap-dev
4944

5045
## Optional dependencies for Ubuntu
51-
libleveldb-dev
52-
libmcrypt-dev
46+
apt-get install -y libleveldb-dev libmcrypt-dev libdb++-dev
47+
5348

5449
## Building From Source (Mac and Linux)
5550
------------------------------------------

‎include/OSS/Net/TlsContext.h

+5
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,13 @@ inline bool TlsContext::initialize(
122122
OSS_LOG_DEBUG("TlsContext::initialize - Certificate: " << certFile << " Private Key: " << privateKey << " Verify Peer: " << verifyPeer );
123123

124124
_pIoService = pIoService;
125+
#if 0
125126
_pServerContext = Context(new boost::asio::ssl::context(*pIoService, boost::asio::ssl::context::sslv23_server));
126127
_pClientContext = Context(new boost::asio::ssl::context(*pIoService, boost::asio::ssl::context::sslv23_client));
128+
#else
129+
_pServerContext = Context(new boost::asio::ssl::context(boost::asio::ssl::context::sslv23_server));
130+
_pClientContext = Context(new boost::asio::ssl::context(boost::asio::ssl::context::sslv23_client));
131+
#endif
127132

128133
if (verifyPeer)
129134
{

‎src/b2bua/SIPB2BClientTransaction.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void SIPB2BClientTransaction::runTask()
144144
// assure that this transaction is garbage collected
145145
//
146146
}
147-
catch(OSS::Exception e)
147+
catch(const OSS::Exception& e)
148148
{
149149
std::ostringstream errorMsg;
150150
errorMsg << _logId << "Fatal Exception while calling SIPB2BTransaction::runTask() - "
@@ -190,7 +190,7 @@ void SIPB2BClientTransaction::runResponseTask()
190190
releaseInternalRef();
191191
return;
192192
}
193-
catch(OSS::Exception e)
193+
catch(const OSS::Exception& e)
194194
{
195195
std::ostringstream errorMsg;
196196
errorMsg << _logId << "Fatal Exception while calling SIPB2BTransaction::runResponseTask() - "

‎src/b2bua/SIPB2BDialogStateManager.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ bool SIPB2BDialogStateManager::findDialog(
669669
return false;
670670
}
671671
}
672-
}catch(OSS::Exception e)
672+
}catch(const OSS::Exception& e)
673673
{
674674
OSS_LOG_WARNING(logId << "No existing dialog state for " << method << " - " << e.message());
675675
return false;
@@ -809,7 +809,7 @@ void SIPB2BDialogStateManager::onUpdateInitialUASState(
809809
//if (pResponse->is2xx())
810810
updateDialog(sessionId, leg1, 1);
811811
}
812-
catch(OSS::Exception e)
812+
catch(const OSS::Exception& e)
813813
{
814814
std::ostringstream logMsg;
815815
logMsg << pTransaction->getLogId() << "Unable to save dialog state for leg 1 - " << e.message();
@@ -919,7 +919,7 @@ void SIPB2BDialogStateManager::onUpdateInitialUACState(
919919
addDialog(leg2.callId, dialogData);
920920
_dataStore.dbPersist(dialogData);
921921
}
922-
catch(OSS::Exception e)
922+
catch(const OSS::Exception& e)
923923
{
924924
std::ostringstream logMsg;
925925
logMsg << pTransaction->getLogId() << "Unable to save dialog state for leg 2 - " << e.message();
@@ -1000,7 +1000,7 @@ void SIPB2BDialogStateManager::onUpdateMidCallUASState(
10001000
updateDialog(dialogData.sessionId, *pLeg, boost::lexical_cast<int>(legIndexNumber));
10011001
_dataStore.dbPersist(dialogData);
10021002
}
1003-
catch(OSS::Exception e)
1003+
catch(const OSS::Exception& e)
10041004
{
10051005
std::ostringstream logMsg;
10061006
logMsg << pTransaction->getLogId() << "Unable to save dialog state for " << legIndex << " - " << e.message();
@@ -1076,7 +1076,7 @@ void SIPB2BDialogStateManager::onUpdateMidCallUACState(
10761076
updateDialog(dialogData);
10771077
_dataStore.dbPersist(dialogData);
10781078
}
1079-
catch(OSS::Exception e)
1079+
catch(const OSS::Exception& e)
10801080
{
10811081
std::ostringstream logMsg;
10821082
logMsg << pTransaction->getLogId() << "Unable to save dialog state for reinvite " << e.message();
@@ -1674,7 +1674,7 @@ void SIPB2BDialogStateManager::onRouteAckRequest(
16741674
OSS::log_debug(pMsg->createLoggerData());
16751675

16761676
}
1677-
catch(OSS::Exception e)
1677+
catch(const OSS::Exception& e)
16781678
{
16791679
std::ostringstream logMsg;
16801680
logMsg << logId << "Exception: " << e.message();

‎src/b2bua/SIPB2BTransaction.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ void SIPB2BTransaction::runTask()
200200
{
201201
pRouteResponse = _pManager->onRouteTransaction(_pClientRequest, shared_from_this(), _localInterface, outboundTarget);
202202
}
203-
catch(OSS::Exception e)
203+
catch(const OSS::Exception& e)
204204
{
205205
OSS::log_warning(_logId + e.message());
206206
releaseInternalRef();
@@ -403,7 +403,7 @@ void SIPB2BTransaction::runTask()
403403
// assure that this transaction is garbage collected
404404
//
405405
}
406-
catch(OSS::Exception e)
406+
catch(const OSS::Exception& e)
407407
{
408408

409409
SIPMessage::Ptr serverError = _pServerRequest->createResponse(500, e.message());
@@ -597,7 +597,7 @@ void SIPB2BTransaction::runResponseTask()
597597
}
598598
}
599599
}
600-
catch(OSS::Exception e)
600+
catch(const OSS::Exception& e)
601601
{
602602
std::ostringstream errorMsg;
603603
errorMsg << _logId << "Fatal Exception while calling SIPB2BTransaction::runResponseTask() - "

‎src/js/modules/sip-parser/sip_parser.cpp

+21-21
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static /*size_t*/ v8::Handle<v8::Value> msgGetMethod(const v8::Arguments& args/*
5858
OSS::SIP::SIPCSeq hCSeq(cseq.c_str());
5959
return v8::String::New(hCSeq.getMethod().c_str());
6060
}
61-
catch(OSS::Exception e)
61+
catch(const OSS::Exception& e)
6262
{
6363
std::ostringstream msg;
6464
msg << "JavaScript->C++ Exception: msgGetMethod - " << e.message();
@@ -85,7 +85,7 @@ static /*size_t*/ v8::Handle<v8::Value> msgHdrPresent(const v8::Arguments& args/
8585
{
8686
return v8::Boolean::New(pMsg->hdrPresent(headerName.c_str()));
8787
}
88-
catch(OSS::Exception e)
88+
catch(const OSS::Exception& e)
8989
{
9090
std::ostringstream msg;
9191
msg << "JavaScript->C++ Exception: msgHdrPresent - " << e.message();
@@ -112,7 +112,7 @@ static /*size_t*/ v8::Handle<v8::Value> msgHdrGetSize(const v8::Arguments& args
112112
{
113113
return v8::Integer::New(pMsg->hdrGetSize(headerName.c_str()));
114114
}
115-
catch(OSS::Exception e)
115+
catch(const OSS::Exception& e)
116116
{
117117
std::ostringstream msg;
118118
msg << "JavaScript->C++ Exception: msgHdrGetSize - " << e.message();
@@ -144,7 +144,7 @@ static /*const std::string&*/ v8::Handle<v8::Value> msgHdrGet(const v8::Argument
144144

145145
return v8::String::New(pMsg->hdrGet(headerName.c_str()).c_str());
146146
}
147-
catch(OSS::Exception e)
147+
catch(const OSS::Exception& e)
148148
{
149149
std::ostringstream msg;
150150
msg << "JavaScript->C++ Exception: msgHdrGet - " << e.message();
@@ -179,7 +179,7 @@ static /*bool*/ v8::Handle<v8::Value> msgHdrSet(const v8::Arguments& args/*const
179179
{
180180
return v8::Boolean::New(pMsg->hdrSet(headerName.c_str(), headerValue, index));
181181
}
182-
catch(OSS::Exception e)
182+
catch(const OSS::Exception& e)
183183
{
184184
std::ostringstream msg;
185185
msg << "JavaScript->C++ Exception: msgHdrSet - " << e.message();
@@ -206,7 +206,7 @@ static /*bool*/ v8::Handle<v8::Value> msgHdrRemove(const v8::Arguments& args/*co
206206
{
207207
return v8::Boolean::New(pMsg->hdrRemove(headerName.c_str()));
208208
}
209-
catch(OSS::Exception e)
209+
catch(const OSS::Exception& e)
210210
{
211211
std::ostringstream msg;
212212
msg << "JavaScript->C++ Exception: msgHdrRemove - " << e.message();
@@ -237,7 +237,7 @@ static /*bool*/ v8::Handle<v8::Value> msgHdrListAppend(const v8::Arguments& args
237237
{
238238
return v8::Boolean::New(pMsg->hdrListAppend(headerName.c_str(), headerValue));
239239
}
240-
catch(OSS::Exception e)
240+
catch(const OSS::Exception& e)
241241
{
242242
std::ostringstream msg;
243243
msg << "JavaScript->C++ Exception: msgHdrListAppend - " << e.message();
@@ -268,7 +268,7 @@ static /*bool*/ v8::Handle<v8::Value> msgHdrListPrepend(const v8::Arguments& arg
268268
{
269269
return v8::Boolean::New(pMsg->hdrListPrepend(headerName.c_str(), headerValue));
270270
}
271-
catch(OSS::Exception e)
271+
catch(const OSS::Exception& e)
272272
{
273273
std::ostringstream msg;
274274
msg << "JavaScript->C++ Exception: msgHdrListPrepend - " << e.message();
@@ -295,7 +295,7 @@ static /*std::string*/ v8::Handle<v8::Value> msgHdrListPopFront(const v8::Argume
295295
{
296296
return v8::String::New(pMsg->hdrListPopFront(headerName.c_str()).c_str());
297297
}
298-
catch(OSS::Exception e)
298+
catch(const OSS::Exception& e)
299299
{
300300
std::ostringstream msg;
301301
msg << "JavaScript->C++ Exception: msgHdrListPopFront - " << e.message();
@@ -322,7 +322,7 @@ static /*bool*/ v8::Handle<v8::Value> msgHdrListRemove(const v8::Arguments& args
322322
{
323323
return v8::Boolean::New(pMsg->hdrListRemove(headerName.c_str()));
324324
}
325-
catch(OSS::Exception e)
325+
catch(const OSS::Exception& e)
326326
{
327327
std::ostringstream msg;
328328
msg << "JavaScript->C++ Exception: msgHdrListRemove - " << e.message();
@@ -352,7 +352,7 @@ static /*boost::tribool*/ v8::Handle<v8::Value> msgIsRequest(const v8::Argument
352352
else
353353
return v8::Boolean::New(pMsg->isRequest(method.c_str()));
354354
}
355-
catch(OSS::Exception e)
355+
catch(const OSS::Exception& e)
356356
{
357357
std::ostringstream msg;
358358
msg << "JavaScript->C++ Exception: msgIsRequest - " << e.message();
@@ -376,7 +376,7 @@ static /*boost::tribool*/ v8::Handle<v8::Value> msgIsResponse(const v8::Argument
376376
{
377377
return v8::Boolean::New(pMsg->isResponse());
378378
}
379-
catch(OSS::Exception e)
379+
catch(const OSS::Exception& e)
380380
{
381381
std::ostringstream msg;
382382
msg << "JavaScript->C++ Exception: msgIsResponse - " << e.message();
@@ -399,7 +399,7 @@ static /*boost::tribool*/ v8::Handle<v8::Value> msgIs1xx(const v8::Arguments& ar
399399
{
400400
return v8::Boolean::New(pMsg->is1xx());
401401
}
402-
catch(OSS::Exception e)
402+
catch(const OSS::Exception& e)
403403
{
404404
std::ostringstream msg;
405405
msg << "JavaScript->C++ Exception: msgIs1xx - " << e.message();
@@ -422,7 +422,7 @@ static /*boost::tribool*/ v8::Handle<v8::Value> msgIs2xx(const v8::Arguments& ar
422422
{
423423
return v8::Boolean::New(pMsg->is2xx());
424424
}
425-
catch(OSS::Exception e)
425+
catch(const OSS::Exception& e)
426426
{
427427
std::ostringstream msg;
428428
msg << "JavaScript->C++ Exception: msgIs2xx - " << e.message();
@@ -445,7 +445,7 @@ static /*boost::tribool*/ v8::Handle<v8::Value> msgIs3xx(const v8::Arguments& ar
445445
{
446446
return v8::Boolean::New(pMsg->is3xx());
447447
}
448-
catch(OSS::Exception e)
448+
catch(const OSS::Exception& e)
449449
{
450450
std::ostringstream msg;
451451
msg << "JavaScript->C++ Exception: msgIs3xx - " << e.message();
@@ -468,7 +468,7 @@ static /*boost::tribool*/ v8::Handle<v8::Value> msgIs4xx(const v8::Arguments& ar
468468
{
469469
return v8::Boolean::New(pMsg->is4xx());
470470
}
471-
catch(OSS::Exception e)
471+
catch(const OSS::Exception& e)
472472
{
473473
std::ostringstream msg;
474474
msg << "JavaScript->C++ Exception: msgIs4xx - " << e.message();
@@ -491,7 +491,7 @@ static /*boost::tribool*/ v8::Handle<v8::Value> msgIs5xx(const v8::Arguments& ar
491491
{
492492
return v8::Boolean::New(pMsg->is5xx());
493493
}
494-
catch(OSS::Exception e)
494+
catch(const OSS::Exception& e)
495495
{
496496
std::ostringstream msg;
497497
msg << "JavaScript->C++ Exception: msgIs5xx - " << e.message();
@@ -514,7 +514,7 @@ static /*boost::tribool*/ v8::Handle<v8::Value> msgIs6xx(const v8::Arguments& ar
514514
{
515515
return v8::Boolean::New(pMsg->is6xx());
516516
}
517-
catch(OSS::Exception e)
517+
catch(const OSS::Exception& e)
518518
{
519519
std::ostringstream msg;
520520
msg << "JavaScript->C++ Exception: msgIs6xx - " << e.message();
@@ -539,7 +539,7 @@ static /*boost::tribool*/ v8::Handle<v8::Value> msgIsResponseFamily(const v8::Ar
539539
{
540540
return v8::Boolean::New(pMsg->isResponseFamily(responseCode));
541541
}
542-
catch(OSS::Exception e)
542+
catch(const OSS::Exception& e)
543543
{
544544
std::ostringstream msg;
545545
msg << "JavaScript->C++ Exception: msgIsResponseFamily - " << e.message();
@@ -563,7 +563,7 @@ static /*boost::tribool*/ v8::Handle<v8::Value> msgIsErrorResponse(const v8::Arg
563563
{
564564
return v8::Boolean::New(pMsg->isErrorResponse());
565565
}
566-
catch(OSS::Exception e)
566+
catch(const OSS::Exception& e)
567567
{
568568
std::ostringstream msg;
569569
msg << "JavaScript->C++ Exception: msgIsErrorResponse - " << e.message();
@@ -586,7 +586,7 @@ static /*boost::tribool*/ v8::Handle<v8::Value> msgIsMidDialog(const v8::Argumen
586586
{
587587
return v8::Boolean::New(pMsg->isMidDialog());
588588
}
589-
catch(OSS::Exception e)
589+
catch(const OSS::Exception& e)
590590
{
591591
std::ostringstream msg;
592592
msg << "JavaScript->C++ Exception: msgHdrGet - " << e.message();

‎src/net/ws/src/connection.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ class connection
753753
*
754754
* @return A reference to the connection's strand object
755755
*/
756-
boost::asio::strand& get_strand() {
756+
boost::asio::io_service::strand& get_strand() {
757757
boost::lock_guard<boost::recursive_mutex> lock(m_lock);
758758
return m_strand;
759759
}
@@ -1532,7 +1532,11 @@ class connection
15321532

15331533
// concurrency support
15341534
mutable boost::recursive_mutex m_lock;
1535+
#if 0
15351536
boost::asio::strand m_strand;
1537+
#else
1538+
boost::asio::io_service::strand m_strand;
1539+
#endif
15361540
bool m_detached; // TODO: this should be atomic
15371541

15381542
// OSS specific members

‎src/persistent/ClassType.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ bool ClassType::load(const boost::filesystem::path& file)
100100
{
101101
static_cast<libconfig::Config*>(_persistentClass->_config)->readFile(OSS::boost_path(file).c_str());
102102
}
103-
catch(libconfig::ParseException e)
103+
catch(const libconfig::ParseException& e)
104104
{
105105
std::ostringstream errorMsg;
106106
errorMsg << "Persistent::ClassType::load Error reading " << file << " at line " << e.getLine() << " with error " << e.getError();
107107
OSS_LOG_ERROR(errorMsg.str());
108108
return false;
109109
}
110-
catch(OSS::Exception e)
110+
catch(const OSS::Exception& e)
111111
{
112112
//_csFileMutex.unlock();
113113
std::ostringstream errorMsg;

‎src/rtp/RTPProxy.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ bool RTPProxy::open(
7878
_pLeg1Socket->open(boost::asio::ip::udp::v4());
7979
_pLeg2Socket->open(boost::asio::ip::udp::v4());
8080

81-
socket_ip_tos_set(_pLeg1Socket->native(), leg1Listener.address().is_v4() ? AF_INET : AF_INET6, 184 /*DSCP=46(EF) ECN=00*/);
82-
socket_ip_tos_set(_pLeg2Socket->native(), leg2Listener.address().is_v4() ? AF_INET : AF_INET6, 184 /*DSCP=46(EF) ECN=00*/);
81+
//socket_ip_tos_set(_pLeg1Socket->native(), leg1Listener.address().is_v4() ? AF_INET : AF_INET6, 184 /*DSCP=46(EF) ECN=00*/);
82+
//socket_ip_tos_set(_pLeg2Socket->native(), leg2Listener.address().is_v4() ? AF_INET : AF_INET6, 184 /*DSCP=46(EF) ECN=00*/);
8383

8484
boost::asio::ip::address addr1 = const_cast<OSS::Net::IPAddress&>(leg1Listener).address();
8585
_localEndPointLeg1 = boost::asio::ip::udp::endpoint(addr1, leg1Listener.getPort());

‎src/rtp/RTPProxyManager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void RTPProxyManager::recycleState()
137137
}
138138
}
139139
}
140-
catch(OSS::Exception e)
140+
catch(const OSS::Exception& e)
141141
{
142142
std::ostringstream logMsg;
143143
logMsg << "RTPProxyManager::recycleState) Failure - "

‎src/sbc/SBCConsole.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ bool SBCConsole::Client::requestConfiguration(int timeout)
283283
rstrm << response;
284284
json::Reader::Read(config, rstrm);
285285
}
286-
catch(std::exception e)
286+
catch(const std::exception& e)
287287
{
288288
OSS_LOG_ERROR("SBCConsole::Client - (Reader) JSON exception: " << e.what());
289289
return false;

‎src/sbc/SBCDialogStateManager.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ void SBCDialogStateManager::onUpdateInitialUASState(
568568
addDialog(pResponse->hdrGet("call-id"), stateFile);
569569
}
570570
}
571-
catch(OSS::Exception e)
571+
catch(const OSS::Exception& e)
572572
{
573573
std::ostringstream logMsg;
574574
logMsg << pTransaction->getLogId() << "Unable to save dialog state for leg 1 - " << e.message();
@@ -786,7 +786,7 @@ void SBCDialogStateManager::onUpdateInitialUACState(
786786

787787
leg2Persistent.persist(stateFile);
788788
}
789-
catch(OSS::Exception e)
789+
catch(const OSS::Exception& e)
790790
{
791791
std::ostringstream logMsg;
792792
logMsg << pTransaction->getLogId() << "Unable to save dialog state for leg 2 - " << e.message();
@@ -888,7 +888,7 @@ void SBCDialogStateManager::onUpdateReinviteUASState(
888888

889889
legPersistent.persist(stateFile);
890890
}
891-
catch(OSS::Exception e)
891+
catch(const OSS::Exception& e)
892892
{
893893
std::ostringstream logMsg;
894894
logMsg << pTransaction->getLogId() << "Unable to save dialog state for " << legIndex << " - " << e.message();
@@ -986,7 +986,7 @@ void SBCDialogStateManager::onUpdateReinviteUACState(
986986

987987
legPersistent.persist(stateFile);
988988
}
989-
catch(OSS::Exception e)
989+
catch(const OSS::Exception& e)
990990
{
991991
std::ostringstream logMsg;
992992
logMsg << pTransaction->getLogId() << "Unable to save dialog state for reinvite " << e.message();
@@ -1071,7 +1071,7 @@ void SBCDialogStateManager::flushStale()
10711071
ClassType::remove(*iter);
10721072
}
10731073
}
1074-
catch(OSS::Exception e)
1074+
catch(const OSS::Exception& e)
10751075
{
10761076
std::ostringstream logMsg;
10771077
logMsg << "purge_state_files() Failure - "
@@ -1157,7 +1157,7 @@ const SIPB2BTransaction::Ptr& pTransaction,
11571157
return false;
11581158
}
11591159
}
1160-
}catch(OSS::Exception e)
1160+
}catch(const OSS::Exception& e)
11611161
{
11621162
OSS_LOG_WARNING(logId << "No existing dialog state file for " << method << " - " << e.message());
11631163
return false;
@@ -1216,7 +1216,7 @@ const SIPB2BTransaction::Ptr& pTransaction,
12161216
throw SBCStateException("Unable to determine dialog");
12171217
}
12181218
}
1219-
}catch(OSS::Exception e)
1219+
}catch(const OSS::Exception& e)
12201220
{
12211221
OSS_LOG_WARNING(logId << "No existing dialog state file for " << method << " - " << e.message() );
12221222
return false;
@@ -1888,7 +1888,7 @@ void SBCDialogStateManager::onRouteAckRequest(
18881888
}
18891889

18901890
}
1891-
catch(OSS::Exception e)
1891+
catch(const OSS::Exception& e)
18921892
{
18931893
std::ostringstream logMsg;
18941894
logMsg << logId << "Unable to process ACK. Exception: " << e.message();

‎src/sbc/SBCInviteBehavior.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ void SBCInviteBehavior::onProcessAckOr2xxRequest(
939939
sessionId, peerXOR, localAddress, targetAddress);
940940
_pManager->transactionManager().stack().sendRequestDirect(pMsg, localAddress, targetAddress);
941941
}
942-
catch(OSS::Exception e)
942+
catch(const OSS::Exception& e)
943943
{
944944
std::ostringstream logMsg;
945945
logMsg << logId << "Unable to process ACK. Exception: " << e.message();

‎src/sbc/SBCRegisterBehavior.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ void SBCRegisterBehavior::sendOptionsKeepAlive(const std::string& regRecord)
280280

281281
_pManager->transactionManager().stack().sendRequest(msg, src, target, _keepAliveResponseCb, OSS::SIP::SIPTransaction::TerminateCallback());
282282
}
283-
catch(OSS::Exception e)
283+
catch(const OSS::Exception& e)
284284
{
285285
std::ostringstream logMsg;
286286
logMsg << "SBCRegisterBehavior::sendOptionsKeepAlive Failure - "
@@ -319,7 +319,7 @@ void SBCRegisterBehavior::runOptionsResponseThread()
319319

320320
registration.eraseWorkSpaceRecord(atIndex == std::string::npos ? *_workspace : *(_pManager->workspace().getLocalRegDb()));
321321
}
322-
catch(OSS::Exception e)
322+
catch(const OSS::Exception& e)
323323
{
324324
#if 0
325325
std::ostringstream logMsg;
@@ -885,7 +885,7 @@ SIPMessage::Ptr SBCRegisterBehavior::onRouteUpperReg(
885885
if (_pManager->requireRtpForRegistrations())
886886
pTransaction->setProperty("require-rtp-proxy", "1");
887887
}
888-
catch(OSS::Exception e)
888+
catch(const OSS::Exception& e)
889889
{
890890
OSS_LOG_ERROR("Unable to load " << regId << " Error=" << e.what());
891891
SIPMessage::Ptr serverError = pRequest->createResponse(SIPMessage::CODE_404_NotFound);
@@ -1199,7 +1199,7 @@ void SBCRegisterBehavior::sendGatewayKeepAlive(Gateway& gateway)
11991199
msg->setProperty("gateway-name", gateway.name);
12001200
_pManager->transactionManager().stack().sendRequest(msg, src, target, _keepAliveResponseCb, OSS::SIP::SIPTransaction::TerminateCallback());
12011201
}
1202-
catch(OSS::Exception e)
1202+
catch(const OSS::Exception& e)
12031203
{
12041204
std::ostringstream logMsg;
12051205
logMsg << "SBCRegisterBehavior::sendOptionsKeepAlive Failure - "

‎src/sbc/SBCSDPBehavior.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -440,12 +440,12 @@ SIPMessage::Ptr SBCSDPBehavior::onProcessRequestBody(
440440
}
441441

442442
}
443-
catch(RTPProxyTooManySession e)
443+
catch(const RTPProxyTooManySession& e)
444444
{
445445
SIPMessage::Ptr serverError = pServerRequest->createResponse(SIPMessage::CODE_503_ServiceUnavailable, e.message().c_str());
446446
return serverError;
447447
}
448-
catch(OSS::Exception e)
448+
catch(const OSS::Exception& e)
449449
{
450450
SIPMessage::Ptr serverError = pServerRequest->createResponse(SIPMessage::CODE_400_BadRequest, e.message().c_str());
451451
return serverError;
@@ -579,7 +579,7 @@ void SBCSDPBehavior::onProcessResponseBody(
579579
OSS_LOG_INFO(pTransaction->getLogId() << "SBCSDPBehavior::onProcessResponseBody - Processing SDP for sessionId " << sessionId << " returned empty response");
580580
}
581581
}
582-
catch(OSS::Exception e)
582+
catch(const OSS::Exception& e)
583583
{
584584
std::ostringstream logMsg;
585585
logMsg << pTransaction->getLogId() << "Unable to process SDP in response. Exception: " << e.message();

‎src/sipep/SIPEndpointRetransmitter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void SIPEndpointRetransmitter::handleTimer(const boost::system::error_code& e)
9797
_pTransport->writeMessage(_pRequest, target, port);
9898
}
9999
}
100-
catch(std::exception e)
100+
catch(const std::exception& e)
101101
{
102102
OSS_LOG_ERROR(_logId << "SIPEndpointRetransmitter::handleTimer - Exception: " << e.what());
103103
}

‎src/sipfsm/SIPFSMDispatch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void SIPFSMDispatch::onReceivedMessage(SIPMessage::Ptr pMsg, SIPTransportSession
6363
{
6464
pMsg->parse();
6565
}
66-
catch(OSS::Exception e)
66+
catch(const OSS::Exception& e)
6767
{
6868
std::ostringstream logMsg;
6969
logMsg << "Incoming message failed to be parsed - " << e.message()

‎src/siptransport/SIPUDPListener.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void SIPUDPListener::run()
5555
assert(!_socket);
5656
boost::asio::ip::address addr = boost::asio::ip::address::from_string(getAddress());
5757
_socket = new boost::asio::ip::udp::socket(_pTransportService->ioService(), boost::asio::ip::udp::endpoint(addr, atoi(_port.c_str())));
58-
socket_ip_tos_set(_socket->native(), addr.is_v4() ? AF_INET : AF_INET6, 96 /*DSCP=24(CS3) ECN=00*/);
58+
//socket_ip_tos_set(_socket->native(), addr.is_v4() ? AF_INET : AF_INET6, 96 /*DSCP=24(CS3) ECN=00*/);
5959
_pNewConnection.reset(new SIPUDPConnection(_pTransportService->ioService(), *_socket, this));
6060
_pNewConnection->setExternalAddress(_externalAddress);
6161
_pNewConnection->start(_dispatch);

‎src/stun/STUNClient.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ int STUNClient::getNatType(
185185
boost::asio::ip::udp::endpoint test_ep = boost::asio::ip::udp::endpoint(_test1MappedAddr.address(), _test1MappedAddr.getPort());
186186
boost::system::error_code ec;
187187
test_sock.bind(test_ep, ec);
188-
bool isNat = (ec);
188+
bool isNat = false;
189+
190+
if (ec) {
191+
isNat = true;
192+
}
189193

190194
if ( isNat )
191195
{

0 commit comments

Comments
 (0)
Please sign in to comment.