From e8c6e9ae5ded4f87302970a87f916ed8a3a6462f Mon Sep 17 00:00:00 2001
From: Pirmin Walthert <infos@nappsoft.ch>
Date: Thu, 4 Jun 2020 08:50:35 +0200
Subject: [PATCH] res_pjsip_logger: use the correct pointer when logging
 tx_messages to pcap

When writing tx messages to pcap files, Asterisk is using the wrong
pointer resulting in lots of wasted space. This patch fixes it to use
the correct pointer.

ASTERISK-28932 #close

Change-Id: I5b8253dd59a083a2ca2c81f232f1d14d33c6fd23
---
 res/res_pjsip_logger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/res/res_pjsip_logger.c b/res/res_pjsip_logger.c
index 8380bd6fb1..957020f8a0 100644
--- a/res/res_pjsip_logger.c
+++ b/res/res_pjsip_logger.c
@@ -286,7 +286,7 @@ static pj_status_t logging_on_tx_msg(pjsip_tx_data *tdata)
 	}
 
 	if (default_logger->log_to_pcap) {
-		pjsip_logger_write_to_pcap(default_logger, tdata->buf.start, (int) (tdata->buf.end - tdata->buf.start),
+		pjsip_logger_write_to_pcap(default_logger, tdata->buf.start, (int) (tdata->buf.cur - tdata->buf.start),
 			NULL, &tdata->tp_info.dst_addr);
 	}
 
-- 
GitLab