diff --git a/Makefile.defs b/Makefile.defs index 88a23b8f..efa2e808 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -86,6 +86,9 @@ USE_MONITORING=yes # #LONG_DEBUG_MESSAGE=yes +# Is this a debug build or not? +debug=no + ################### end of configuration section ####################### @@ -157,11 +160,14 @@ CXX = g++ CC = gcc LD = $(CC) +CXXFLAGS += -Wall -Wno-reorder -fPIC -g $(EXTRA_CXXFLAGS) +CFLAGS += -Wall -fPIC -g $(EXTRA_CFLAGS) -CXXFLAGS += -Wall -Wno-reorder -fPIC -g \ - -O2 $(EXTRA_CXXFLAGS) - -CFLAGS += -Wall -fPIC -g -O2 $(EXTRA_CFLAGS) +# only optimize if releasing, as it slows down the build process +ifneq ($(debug),yes) + CXXFLAGS += -O2 + CFLAGS += -O2 +endif ifeq ($(DEBUG_PLAYOUT), yes) CPPFLAGS += -DDEBUG_PLAYOUTBUF diff --git a/apps/registrar_client/SIPRegistrarClient.cpp b/apps/registrar_client/SIPRegistrarClient.cpp index 1a298859..4c57434a 100644 --- a/apps/registrar_client/SIPRegistrarClient.cpp +++ b/apps/registrar_client/SIPRegistrarClient.cpp @@ -109,7 +109,8 @@ void SIPRegistration::doRegistration() //else // dlg.outbound_proxy = ""; - dlg.sendRequest(req.method, "", "", "Expires: 1000\n"); + if (dlg.sendRequest(req.method, "", "", "Expires: 1000\n") < 0) + ERROR("failed to send registration.\n"); // save TS struct timeval now; @@ -133,7 +134,8 @@ void SIPRegistration::doUnregister() //else // dlg.outbound_proxy = ""; - dlg.sendRequest(req.method, "", "", "Expires: 0\n"); + if (dlg.sendRequest(req.method, "", "", "Expires: 0\n") < 0) + ERROR("failed to send deregistration.\n"); // save TS struct timeval now; diff --git a/apps/registrar_client/SIPRegistrarClient.h b/apps/registrar_client/SIPRegistrarClient.h index 66097957..1c11f9ea 100644 --- a/apps/registrar_client/SIPRegistrarClient.h +++ b/apps/registrar_client/SIPRegistrarClient.h @@ -132,7 +132,7 @@ class SIPRegistration : public AmSipDialogEventHandler, void onNoErrorACK(unsigned int) {} #else void onNoAck(unsigned int) {} - void onNoPrack(unsigned int) {} + void onNoPrack(const AmSipRequest &, const AmSipReply &) {} #endif /** is this registration registered? */ diff --git a/core/AmB2ABSession.cpp b/core/AmB2ABSession.cpp index 658be2cd..89e7d7c5 100644 --- a/core/AmB2ABSession.cpp +++ b/core/AmB2ABSession.cpp @@ -186,7 +186,7 @@ void AmB2ABCallerSession::onB2ABEvent(B2ABEvent* ev) case B2ABConnectOtherLegException: case B2ABConnectOtherLegFailed: { - DBG("looks like callee leg could not be created. terminating our leg.\n"); + WARN("looks like callee leg could not be created. terminating our leg.\n"); terminateLeg(); callee_status = None; return; @@ -362,7 +362,8 @@ void AmB2ABCalleeSession::onSipReply(const AmSipReply& rep, int old_dlg_status) if ((status_before == AmSipDialog::Pending)&& (status == AmSipDialog::Disconnected)) { - DBG("callee session creation failed. notifying callersession.\n"); + DBG("callee session creation failed. notifying caller session.\n"); + DBG("this happened with reply: %d.\n", rep.code); relayEvent(new B2ABConnectOtherLegFailedEvent(rep.code, rep.reason)); } else if ((status == AmSipDialog::Pending) && (rep.code == 180)) { diff --git a/core/plug-in/uac_auth/UACAuth.cpp b/core/plug-in/uac_auth/UACAuth.cpp index 9870bcf0..4a8d2c59 100644 --- a/core/plug-in/uac_auth/UACAuth.cpp +++ b/core/plug-in/uac_auth/UACAuth.cpp @@ -164,15 +164,18 @@ bool UACAuth::onSipReply(const AmSipReply& reply) if (dlg->sendRequest(ri->second.method, ri->second.content_type, ri->second.body, - hdrs) == 0) + hdrs) == 0) { processed = true; + DBG("authenticated request successfully sent.\n"); + } else { + ERROR("failed to send authenticated request.\n"); + } } } } - } - - if (reply.code >= 200) + } else if (reply.code >= 200) { sent_requests.erase(reply.cseq); // now we dont need it any more + } return processed; }