[sr-dev] git:master: siptrace: track outgoing CANCEL requests

Daniel-Constantin Mierla miconda at gmail.com
Fri Sep 23 11:48:08 CEST 2011


Module: sip-router
Branch: master
Commit: 7b2eca4939ccae16ec7af4fa42e4b8a6e1a92b2f
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7b2eca4939ccae16ec7af4fa42e4b8a6e1a92b2f

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Fri Sep 23 11:46:20 2011 +0200

siptrace: track outgoing CANCEL requests

- use associated INVITE transaction to check the siptrace flag state
- reported by Timo Klecker

---

 modules_k/siptrace/siptrace.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/modules_k/siptrace/siptrace.c b/modules_k/siptrace/siptrace.c
index c1ae15d..93c1db7 100644
--- a/modules_k/siptrace/siptrace.c
+++ b/modules_k/siptrace/siptrace.c
@@ -993,8 +993,21 @@ static void trace_onreq_out(struct cell* t, int type, struct tmcb_params *ps)
 	}
 	msg=ps->req;
 	if(msg==NULL) {
-		LM_DBG("no uas msg, local transaction\n");
-		return;
+		/* check if it is outgoing cancel, t is INVITE
+		 * and send_buf starts with CANCEL */
+		if(is_invite(t) && ps->send_buf.len>7
+				&& strncmp(ps->send_buf.s, "CANCEL ", 7)==0) {
+			msg = t->uas.request;
+			if(msg==NULL) {
+				LM_DBG("no uas msg for INVITE transaction\n");
+				return;
+			} else {
+				LM_DBG("recording CANCEL based on INVITE transaction\n");
+			}
+		} else {
+			LM_DBG("no uas msg, local transaction\n");
+			return;
+		}
 	}
 	memset(&sto, 0, sizeof(struct _siptrace_data));
 




More information about the sr-dev mailing list