1 | module Sanity_Templates {
|
---|
2 |
|
---|
3 | import from LibSip_SIPTypesAndValues all;
|
---|
4 |
|
---|
5 | group userInfoTemplates {
|
---|
6 |
|
---|
7 | template UserInfo m_userInfo(charstring p_userOrTelephoneSuscriber, template charstring p_password) := {
|
---|
8 | userOrTelephoneSubscriber := p_userOrTelephoneSuscriber,
|
---|
9 | password := p_password
|
---|
10 | }
|
---|
11 | } // end group userInfoTemplates
|
---|
12 |
|
---|
13 | group hostPortTemplates {
|
---|
14 |
|
---|
15 | template HostPort m_hostPort(charstring p_host, template integer p_port) := {
|
---|
16 | host := p_host,
|
---|
17 | portField := p_port
|
---|
18 | }
|
---|
19 | } // end group hostPortTemplates
|
---|
20 |
|
---|
21 | group sipUri {
|
---|
22 |
|
---|
23 | template SipUrl m_receiverSipUri(template SemicolonParam_List p_urlPareters) := {
|
---|
24 | scheme := c_sipScheme & ":",
|
---|
25 | userInfo := m_userInfo("receiver", omit),
|
---|
26 | hostPort := m_hostPort("etsi.org", omit),
|
---|
27 | urlParameters := p_urlPareters,
|
---|
28 | headers := omit
|
---|
29 | }
|
---|
30 |
|
---|
31 | template SipUrl m_senderSipUri(template SemicolonParam_List p_urlPareters) := {
|
---|
32 | scheme := c_sipScheme & ":",
|
---|
33 | userInfo := m_userInfo("sender", omit),
|
---|
34 | hostPort := m_hostPort("etsi.org", omit),
|
---|
35 | urlParameters := p_urlPareters,
|
---|
36 | headers := omit
|
---|
37 | }
|
---|
38 | } // end group sipUri
|
---|
39 |
|
---|
40 | group startLineTemplates {
|
---|
41 |
|
---|
42 | template RequestLine m_requestLine(Method p_method, template SipUrl p_requestUri) := {
|
---|
43 | method := p_method,
|
---|
44 | requestUri := p_requestUri,
|
---|
45 | sipVersion := c_sipNameVersion
|
---|
46 | }
|
---|
47 |
|
---|
48 | } // end group startLineTemplates
|
---|
49 |
|
---|
50 | group callIdTemplates {
|
---|
51 |
|
---|
52 | template CallId m_callId(charstring p_callId) := {
|
---|
53 | fieldName := CALL_ID_E,
|
---|
54 | callid := p_callId
|
---|
55 | }
|
---|
56 | } // end group callIdTemplates
|
---|
57 |
|
---|
58 | group cSeqTemplates {
|
---|
59 |
|
---|
60 | template CSeq m_cSeq(charstring p_method) := {
|
---|
61 | fieldName := CSEQ_E,
|
---|
62 | seqNumber := 1,
|
---|
63 | method := p_method
|
---|
64 | }
|
---|
65 | } // end group cSeqTemplates
|
---|
66 |
|
---|
67 | group genericParamTemplate {
|
---|
68 |
|
---|
69 | template GenericParam m_tag(charstring p_tagValue) := {
|
---|
70 | id := c_tagId,
|
---|
71 | paramValue := p_tagValue
|
---|
72 | }
|
---|
73 |
|
---|
74 | template GenericParam m_branch(charstring p_branchValue) := {
|
---|
75 | id := c_branchId,
|
---|
76 | paramValue := p_branchValue
|
---|
77 | }
|
---|
78 | } // end group genericParamTemplates
|
---|
79 |
|
---|
80 | group fromTemplates {
|
---|
81 |
|
---|
82 | template From m_fromField(template SipUrl p_fromUri) := {
|
---|
83 | fieldName := FROM_E,
|
---|
84 | addressField := {addrSpecUnion := p_fromUri},
|
---|
85 | fromParams := omit
|
---|
86 | }
|
---|
87 | } // end group fromTemplates
|
---|
88 |
|
---|
89 | group toTemplates {
|
---|
90 |
|
---|
91 | template To m_toField(template SipUrl p_toUri) := {
|
---|
92 | fieldName := TO_E,
|
---|
93 | addressField := {addrSpecUnion := p_toUri},
|
---|
94 | toParams := omit
|
---|
95 | }
|
---|
96 |
|
---|
97 | } // end group toTemplates
|
---|
98 |
|
---|
99 | group contactBodyTemplates {
|
---|
100 | template ContactBody m_contactBody(template SipUrl p_contactUri) := {
|
---|
101 | contactAddresses := {
|
---|
102 | {
|
---|
103 | addressField := { addrSpecUnion := p_contactUri},
|
---|
104 | contactParams := omit
|
---|
105 | }
|
---|
106 | }
|
---|
107 | }
|
---|
108 |
|
---|
109 | } // end group contactBodyTemplates
|
---|
110 |
|
---|
111 |
|
---|
112 | group contactTemplates {
|
---|
113 |
|
---|
114 | template Contact m_contact(template SipUrl p_contactUri) := {
|
---|
115 | fieldName := CONTACT_E,
|
---|
116 | contactBody := m_contactBody(p_contactUri)
|
---|
117 | }
|
---|
118 |
|
---|
119 | } // end group contactTemplates
|
---|
120 |
|
---|
121 | group viaTemplates {
|
---|
122 |
|
---|
123 | template Via m_via(template ViaBody_List p_viaBodyList) := {
|
---|
124 | fieldName := VIA_E,
|
---|
125 | viaBody := p_viaBodyList
|
---|
126 | }
|
---|
127 |
|
---|
128 | template ViaBody m_viaBody(template HostPort p_sentBy, template SemicolonParam_List p_viaParams) := {
|
---|
129 | sentProtocol := m_sentProtocol,
|
---|
130 | sentBy := p_sentBy,
|
---|
131 | viaParams := p_viaParams
|
---|
132 | }
|
---|
133 | } // end group viaTemplates
|
---|
134 |
|
---|
135 | group sentProtocolTemplates {
|
---|
136 |
|
---|
137 | template SentProtocol m_sentProtocol := {
|
---|
138 | protocolName := c_sipName,
|
---|
139 | protocolVersion := c_sipVersion,
|
---|
140 | transport := c_defaultSipProt
|
---|
141 | }
|
---|
142 | } // end group sentProtocolTemplates
|
---|
143 |
|
---|
144 | group msgHeaderTemplates {
|
---|
145 |
|
---|
146 | template MessageHeader m_minimalMsgHeader(
|
---|
147 | charstring p_callId,
|
---|
148 | charstring p_method,
|
---|
149 | template SipUrl p_contactUri,
|
---|
150 | template SipUrl p_fromUri,
|
---|
151 | template SipUrl p_toUri,
|
---|
152 | template ViaBody_List p_viaBodyList
|
---|
153 | ) := {
|
---|
154 | accept := omit,
|
---|
155 | acceptContact := omit,
|
---|
156 | acceptEncoding := omit,
|
---|
157 | acceptLanguage := omit,
|
---|
158 | alertInfo := omit,
|
---|
159 | allow := omit,
|
---|
160 | allowEvents := omit, // 3265/7.2
|
---|
161 | authenticationInfo := omit, // only in responses
|
---|
162 | authorization := omit, // only in requests
|
---|
163 | callId := m_callId(p_callId),
|
---|
164 | callInfo := omit,
|
---|
165 | contact := m_contact(p_contactUri),
|
---|
166 | contentDisposition := omit,
|
---|
167 | contentEncoding := omit,
|
---|
168 | contentLanguage := omit,
|
---|
169 | contentLength := omit, // optional in responses and all requests except ACK where mandatory
|
---|
170 | contentType := omit,
|
---|
171 | cSeq := m_cSeq(p_method),
|
---|
172 | date := omit,
|
---|
173 | errorInfo := omit, // only in responses
|
---|
174 | event := omit, // 3265/7.2
|
---|
175 | expires := omit,
|
---|
176 | fromField := m_fromField(p_fromUri),
|
---|
177 | historyInfo := omit, // 4244
|
---|
178 | inReplyTo := omit, // only in requests
|
---|
179 | maxForwards := c_maxForwards70,
|
---|
180 | mimeVersion := omit,
|
---|
181 | minExpires := omit, // only in responses
|
---|
182 | minSE := omit, // 4028
|
---|
183 | organization := omit,
|
---|
184 | pAccessNetworkInfo := omit, // 3455
|
---|
185 | pAssertedID := omit, // 3325
|
---|
186 | pAssertedService := omit,
|
---|
187 | pAssociatedURI := omit, // 3455
|
---|
188 | path := omit, // 3327
|
---|
189 | pCalledPartyID := omit, // 3455
|
---|
190 | pChargingFunctionAddresses := omit, // 3455
|
---|
191 | pChargingVector := omit, // 3455
|
---|
192 | pEarlyMedia := omit, // 5009
|
---|
193 | pMediaAuthorization := omit, // 3313
|
---|
194 | pPreferredID := omit, // 3325
|
---|
195 | priority := omit, // only in requests
|
---|
196 | privacy := omit, // 3323
|
---|
197 | proxyAuthenticate := omit, // only in responses
|
---|
198 | proxyAuthorization := omit, // only in requests
|
---|
199 | proxyRequire := omit, // only in requests
|
---|
200 | pVisitedNetworkID := omit, // 3455
|
---|
201 | rAck := omit, // 3262/7.1
|
---|
202 | rSeq := omit, // 3262/7.1
|
---|
203 | reason := omit, // 3326
|
---|
204 | recordRoute := omit,
|
---|
205 | referredBy := omit, // 3892 - REFER method
|
---|
206 | referTo := omit, // 3515 - REFER method
|
---|
207 | replyTo := omit, // optional in responses and INVITE requests
|
---|
208 | require := omit,
|
---|
209 | retryAfter := omit, // only in responses
|
---|
210 | route := omit, // only in requests
|
---|
211 | securityClient := omit, // 3329
|
---|
212 | securityServer := omit, // 3329
|
---|
213 | securityVerify := omit, // 3329
|
---|
214 | server := omit, // only in responses
|
---|
215 | serviceRoute := omit, // 3608
|
---|
216 | sessionExpires := omit, // 4028
|
---|
217 | subject := omit, // only in requests
|
---|
218 | subscriptionState := omit, // 3265/7.2
|
---|
219 | supported := omit,
|
---|
220 | timestamp := omit,
|
---|
221 | toField := m_toField(p_toUri),
|
---|
222 | unsupported := omit, // only in responses
|
---|
223 | userAgent := omit,
|
---|
224 | via := m_via(p_viaBodyList),
|
---|
225 | warning := omit, // only in responses
|
---|
226 | wwwAuthenticate := omit, // only in responses
|
---|
227 | undefinedHeader_List := omit
|
---|
228 |
|
---|
229 |
|
---|
230 |
|
---|
231 |
|
---|
232 |
|
---|
233 |
|
---|
234 |
|
---|
235 |
|
---|
236 |
|
---|
237 | }
|
---|
238 |
|
---|
239 | } // end group msgHeaderTemplates
|
---|
240 | group requests {
|
---|
241 |
|
---|
242 | template INVITE_Request m_standardInviteRequest := {
|
---|
243 | requestLine := m_requestLine(INVITE_E, m_receiverSipUri(omit)),
|
---|
244 | msgHeader := m_minimalMsgHeader( "inviteCall",
|
---|
245 | "INVITE",
|
---|
246 | m_senderSipUri(omit),
|
---|
247 | m_senderSipUri({m_tag("a-tag")}),
|
---|
248 | m_receiverSipUri(omit),
|
---|
249 | {m_viaBody( m_hostPort("etsi.org", c_defaultSipPort),
|
---|
250 | {m_branch(c_brenchCookie)}
|
---|
251 | )}
|
---|
252 | ),
|
---|
253 | messageBody := omit,
|
---|
254 | payload := omit
|
---|
255 | }
|
---|
256 |
|
---|
257 | template REGISTER_Request m_standardRegisterRequest := {
|
---|
258 | requestLine := m_requestLine(REGISTER_E, m_senderSipUri(omit)),
|
---|
259 | msgHeader := m_minimalMsgHeader( "registerCall",
|
---|
260 | "REGISTER",
|
---|
261 | m_senderSipUri(omit),
|
---|
262 | m_senderSipUri({m_tag("a-tag")}),
|
---|
263 | m_senderSipUri(omit),
|
---|
264 | {m_viaBody( m_hostPort("etsi.org", c_defaultSipPort),
|
---|
265 | {m_branch(c_brenchCookie)}
|
---|
266 | )}
|
---|
267 | ),
|
---|
268 | messageBody := omit,
|
---|
269 | payload := omit
|
---|
270 | }
|
---|
271 |
|
---|
272 | } // end group requests
|
---|
273 |
|
---|
274 | } // end module Sanity_Templates
|
---|
275 |
|
---|