SIP: generate seq_nr within allowed range
Change-Id: Iea5f4568af1bd795db57d2b77e82d976edc9e337
diff --git a/library/SIP_Templates.ttcn b/library/SIP_Templates.ttcn
index 75681a9..f57b524 100644
--- a/library/SIP_Templates.ttcn
+++ b/library/SIP_Templates.ttcn
@@ -1,6 +1,7 @@
module SIP_Templates {
import from SIPmsg_Types all;
+import from Osmocom_Types all;
/* wrapper type to encapsulate the Addr_Union + parameter list used in From, To. ... */
type record SipAddr {
@@ -409,5 +410,13 @@
}
+/* RFC 3261 8.1.1.5:
+ * "The sequence number value MUST be expressible as a 32-bit unsigned integer
+ * and MUST be less than 2**31."
+ */
+function f_sip_rand_seq_nr() return integer {
+ /* 2**31 = 2147483648 */
+ return f_rnd_int(2147483648)
+}
}