Rev

Rev 469 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | SVN | Bug Tracker

Rev Author Line No. Line
61 berge 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
 
63 berge 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
 
61 berge 112
        group contactTemplates {
113
 
114
                template Contact m_contact(template SipUrl p_contactUri) := {
115
                        fieldName               := CONTACT_E,
63 berge 116
                        contactBody             := m_contactBody(p_contactUri)
61 berge 117
                }
118
 
119
        } // end group contactTemplates
120
 
121
        group viaTemplates {
122
 
63 berge 123
                template Via m_via(template ViaBody_List p_viaBodyList) := {
61 berge 124
                  fieldName := VIA_E,
125
                  viaBody       := p_viaBodyList
126
                }
127
 
63 berge 128
                template ViaBody m_viaBody(template HostPort p_sentBy, template SemicolonParam_List p_viaParams) := {
61 berge 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,
63 berge 152
                        template ViaBody_List p_viaBodyList
61 berge 153
                ) := {
63 berge 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
61 berge 163
                        callId          := m_callId(p_callId),
63 berge 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,
61 berge 176
                        fromField       := m_fromField(p_fromUri),
63 berge 177
                        historyInfo  := omit, // 4244
178
                        inReplyTo  := omit, // only in requests
61 berge 179
                        maxForwards     := c_maxForwards70,
63 berge 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
515 garciay 207
                        referSub  := omit, // 4488 - REFER method
63 berge 208
                        replyTo  := omit, // optional in responses and INVITE requests
209
                        require  := omit,
210
                        retryAfter  := omit, // only in responses
211
                        route  := omit, // only in requests
212
                        securityClient  := omit, // 3329
213
                        securityServer  := omit, // 3329
214
                        securityVerify  := omit, // 3329
215
                        server  := omit, // only in responses
216
                        serviceRoute  := omit, // 3608
217
                        sessionExpires := omit, // 4028
218
                        subject  := omit, // only in requests
219
                        subscriptionState  := omit, // 3265/7.2
220
                        supported  := omit,
221
                        timestamp  := omit,
222
                        toField := m_toField(p_toUri),
223
                        unsupported  := omit, // only in responses
224
                        userAgent  := omit,
225
                        via             := m_via(p_viaBodyList),
226
                        warning  := omit, // only in responses
227
                        wwwAuthenticate  := omit, // only in responses
228
                        undefinedHeader_List  := omit                  
229
 
230
 
231
 
232
 
233
 
234
 
235
 
236
 
237
 
61 berge 238
                }
239
 
240
        } // end group msgHeaderTemplates
241
        group requests {
242
 
243
                template INVITE_Request m_standardInviteRequest := {
244
                        requestLine := m_requestLine(INVITE_E, m_receiverSipUri(omit)),
245
                        msgHeader       := m_minimalMsgHeader(  "inviteCall",
246
                                                                                                "INVITE",
247
                                                                                                m_senderSipUri(omit),
248
                                                                                                m_senderSipUri({m_tag("a-tag")}),
249
                                                                                                m_receiverSipUri(omit),
250
                                                                                                {m_viaBody(     m_hostPort("etsi.org", c_defaultSipPort),
251
                                                                                                                        {m_branch(c_brenchCookie)}
252
                                                                                                                        )}
253
                                                                                                ),
254
                        messageBody := omit,   
255
                        payload         := omit
256
                }
257
 
258
                template REGISTER_Request m_standardRegisterRequest := {
259
                        requestLine := m_requestLine(REGISTER_E, m_senderSipUri(omit)),
260
                        msgHeader       := m_minimalMsgHeader(  "registerCall",
261
                                                                                                "REGISTER",
262
                                                                                                m_senderSipUri(omit),
263
                                                                                                m_senderSipUri({m_tag("a-tag")}),
264
                                                                                                m_senderSipUri(omit),
265
                                                                                                {m_viaBody(     m_hostPort("etsi.org", c_defaultSipPort),
266
                                                                                                                        {m_branch(c_brenchCookie)}
267
                                                                                                                        )}
268
                                                                                                ),
269
                        messageBody := omit,   
270
                        payload         := omit
271
                }
272
 
273
        } // end group requests
274
 
275
} // end module Sanity_Templates
276