[PATCH] osmo-ttcn3-hacks[master]: WIP: SIP progress

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Mar 22 20:17:59 UTC 2018


Review at  https://gerrit.osmocom.org/7466

WIP: SIP progress

Change-Id: I34a5d7929264c7f5f21d3868a5f919874ffa106c
---
M sip/SIP_Tests.ttcn
1 file changed, 67 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/66/7466/1

diff --git a/sip/SIP_Tests.ttcn b/sip/SIP_Tests.ttcn
index de2f498..14d8280 100644
--- a/sip/SIP_Tests.ttcn
+++ b/sip/SIP_Tests.ttcn
@@ -126,7 +126,6 @@
 		log(sip_req);
 	}
 }
-
 testcase TC_mo_setup() runs on test_CT {
 	var ConnHdlrPars pars;
 	var ConnHdlr vc_conn;
@@ -136,6 +135,11 @@
 	pars := valueof(t_Pars);
 	vc_conn := f_start_handler(refers(f_TC_mo_setup), pars);
 	vc_conn.done;
+}
+
+
+private function f_TC_mt_setup(charstring id) runs on ConnHdlr {
+	
 }
 
 
@@ -163,6 +167,68 @@
 }
 
 
+template (value) SipUrl ts_SipUrl(charstring user_or_tel, charstring host, integer portnr) := {
+	scheme := "sip",
+	userInfo := {
+		userOrTelephoneSubscriber := user_or_tel,
+		password := omit
+	},
+	hostPort := {
+		host := host,
+		portField := portnr
+	},
+	urlParameters := omit,
+	headers := omit
+}
+
+template (value) RequestLine ts_SIP_ReqLine(Method method, template (value) SipUrl uri,
+					    charstring ver := "SIP/2.0") := {
+	method := method,
+	requestUri := uri,
+	sipVersion := ver
+}
+
+template (value) PDU_SIP_Request ts_SIP_req(template (value) RequestLine rl) := {
+	requestLine := rl,
+	messageHeader := c_SIP_msgHeader_empty,
+	messageBody := omit,
+	payload := omit
+}
+
+template (value) MessageHeader ts_SIP_msgh_std(allow_methods, call_id, contact_addrs)
+modifies c_SIP_msgHeader_empty := {
+	allow := {
+		fieldname := ALLOW_E,
+		methods := allow_methods
+	},
+	callId := {
+		fieldName := CALL_ID_E,
+		callid := call_id
+	},
+	contact := {
+		fieldName := CONTACT_E,
+		fieldBody := {
+			contactAdresses := contact_addrs
+		}
+	},
+	contentType := {
+		fieldName := CONTENT_TYPE_E,
+		mediaType := "application/sdp"
+	}//,
+	//fromField :=,
+	//toField :=,
+	//userAgent :=
+}
+
+template (value) PDU_SIP_Request ts_SIP_INVITE(charstring number, charstring host,
+					       integer sip_port := 5060,
+					       charstring body) := {
+	requestLine := ts_SIP_ReqLine(INVITE_E, ts_SipUrl(number, host, sip_port),
+	messageHeader := ts_SIP_msgh_std,
+	messageBody := body,
+	payload := omit
+}
+
 
 control {
 	execute( TC_mo_setup() );

-- 
To view, visit https://gerrit.osmocom.org/7466
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I34a5d7929264c7f5f21d3868a5f919874ffa106c
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list