[svn-commits] file: branch group/pimp_my_sip r380163 - /team/group/pimp_my_sip/res/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Jan 27 08:26:32 CST 2013


Author: file
Date: Sun Jan 27 08:26:29 2013
New Revision: 380163

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=380163
Log:
Improve SIP logging. The size of the SIP message, the transport type used (UDP/TCP), and full address information is now printed.

Modified:
    team/group/pimp_my_sip/res/res_sip_logger.c

Modified: team/group/pimp_my_sip/res/res_sip_logger.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/res/res_sip_logger.c?view=diff&rev=380163&r1=380162&r2=380163
==============================================================================
--- team/group/pimp_my_sip/res/res_sip_logger.c (original)
+++ team/group/pimp_my_sip/res/res_sip_logger.c Sun Jan 27 08:26:29 2013
@@ -32,18 +32,25 @@
 
 static pj_status_t logging_on_tx_msg(pjsip_tx_data *tdata)
 {
-	ast_verbose("<--- Transmitting SIP %s to %.*s --->\n%.*s\n",
-			tdata->msg->type == PJSIP_REQUEST_MSG ? "request" : "response",
-			(int) pj_strlen(&tdata->dest_info.name), pj_strbuf(&tdata->dest_info.name),
-			(int) (tdata->buf.end - tdata->buf.start), tdata->buf.start);
+	ast_verbose("<--- Transmitting SIP %s (%ld bytes) to %s:%s:%d --->\n%.*s\n",
+		    tdata->msg->type == PJSIP_REQUEST_MSG ? "request" : "response",
+		    (tdata->buf.cur - tdata->buf.start),
+		    tdata->tp_info.transport->type_name,
+		    tdata->tp_info.dst_name,
+		    tdata->tp_info.dst_port,
+		    (int) (tdata->buf.end - tdata->buf.start), tdata->buf.start);
 	return PJ_SUCCESS;
 }
 
 static pj_bool_t logging_on_rx_msg(pjsip_rx_data *rdata)
 {
-	ast_verbose("<--- Received SIP %s from %s --->\n%s\n",
-			rdata->msg_info.msg->type == PJSIP_REQUEST_MSG ? "request" : "response",
-			rdata->pkt_info.src_name, rdata->pkt_info.packet);
+	ast_verbose("<--- Received SIP %s (%d bytes) from %s:%s:%d --->\n%s\n",
+		    rdata->msg_info.msg->type == PJSIP_REQUEST_MSG ? "request" : "response",
+		    rdata->msg_info.len,
+		    rdata->tp_info.transport->type_name,
+		    rdata->pkt_info.src_name,
+		    rdata->pkt_info.src_port,
+		    rdata->pkt_info.packet);
 	return PJ_FALSE;
 }
 




More information about the svn-commits mailing list