Module: sems Branch: bpintea/prack Commit: be60e06c3a6a4250b2aa64e0b3117ad8bffc32ee URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=be60e06c3a6a4250b2aa64e0b3117ad8bffc32ee
Author: bpi <[email protected]> Committer: bpi <[email protected]> Date: Thu Jul 1 20:57:52 2010 +0200 small fixes - add a build debugging mode (to just exclude, for now, the -O2 - makes g++ much slower) - onNoPrack's signature updated in registrar client - log errors when unable to send a message (besides a bunch of debugs, some of which should be warnings, actually) --- Makefile.defs | 14 ++++++++++---- apps/registrar_client/SIPRegistrarClient.cpp | 6 ++++-- apps/registrar_client/SIPRegistrarClient.h | 2 +- core/AmB2ABSession.cpp | 5 +++-- core/plug-in/uac_auth/UACAuth.cpp | 11 +++++++---- 5 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Makefile.defs b/Makefile.defs index 88a23b8..efa2e80 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 1a29885..4c57434 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 6609795..1c11f9e 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 658be2c..89e7d7c 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 9870bcf..4a8d2c5 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; } _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
