diff --git a/Makefile.defs b/Makefile.defs index dcc0ce1d..cc9defe3 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -68,6 +68,13 @@ exclude_core_modules = sipctrl # USE_MONITORING=yes +# Support for long debug messages? (useful for debugging SIP messages' contents) +# +LONG_DEBUG_MESSAGE=yes + + +################### end of configuration section ####################### + LDFLAGS += -lm GETOS=$(COREPATH)/compat/getos @@ -99,9 +106,16 @@ endif endif ifdef USE_MONITORING -CPPFLAGS += -DUSE_MONITORING +CPPFLAGS += -DUSE_MONITORING endif +ifdef LONG_DEBUG_MESSAGE +CPPFLAGS += -DLOG_BUFFER_LEN=2048 +else +CPPFLAGS += -DLOG_BUFFER_LEN=512 +endif + + # Additions for Solaris support. ifeq ($(OS),solaris) CPPFLAGS += -DHAVE_SYS_SOCKIO_H -DBSD_COMP -fPIC -include compat/solaris.h diff --git a/core/log.h b/core/log.h index 4a24407f..1356581b 100644 --- a/core/log.h +++ b/core/log.h @@ -104,7 +104,7 @@ enum Log_Level { if ((level_) <= log_level) { \ pid_t pid_ = GET_PID(); \ pthread_t tid_ = GET_TID(); \ - char msg_[512]; \ + char msg_[LOG_BUFFER_LEN]; \ int n_ = snprintf(msg_, sizeof(msg_), fmt, ##args); \ if (msg_[n_ - 1] == '\n') msg_[n_ - 1] = '\0'; \ \ diff --git a/core/sip/trans_layer.cpp b/core/sip/trans_layer.cpp index bdce0e2c..ba0550e6 100644 --- a/core/sip/trans_layer.cpp +++ b/core/sip/trans_layer.cpp @@ -818,10 +818,10 @@ int trans_layer::send_request(sip_msg* msg, trans_ticket* tt) memcpy(&p_msg->remote_ip,&msg->remote_ip,sizeof(sockaddr_storage)); - DBG("Sending to %s:%i <%.*s>\n", + DBG("Sending to %s:%i <%.*s...>\n", get_addr_str(((sockaddr_in*)&p_msg->remote_ip)->sin_addr).c_str(), ntohs(((sockaddr_in*)&p_msg->remote_ip)->sin_port), - p_msg->len,p_msg->buf); + 50 /* preview - instead of p_msg->len */,p_msg->buf); tt->_bucket = get_trans_bucket(p_msg->callid->value, get_cseq(p_msg)->num_str);