Newer
Older
import from LibSip_SIPTypesAndValues all;
import from LibSip_SDPTypes all;
import from LibSip_Steps all;
import from LibSip_Templates all;
import from LibSip_Interface all;
import from LibSip_PIXITS all;
// LibIms
import from LibIms_SIPTypesAndValues all;
import from LibIms_Steps all;
import from LibIms_Templates all;
import from LibIms_Interface all;
// AtsSccas
import from AtsSccas_PIXITS all;
group Constants {
group SdpUserProfileConstants {
const integer c_userProfile_Vendor1 := 1;
} // End of group SdpUserProfileConstants
group UserProfileConstants {
// number of user profile (RESERVED: from 1-10 for SIP profile)
const integer c_userProfile_UE1atSUThome := 11; // location is SUT domain
const integer c_userProfile_UE2atSUThome := 12; // location is SUT domain
const integer c_userProfile_UE3atSUThome := 13; // location is SUT domain
const integer c_userProfile_UE4atSUThome := 14; // location is SUT domain
const integer c_userProfile_UE1atSUTvisiting := 21; // location is SUT domain
//const integer c_userProfile_UE2atSUTvisiting := 22; // location is SUT domain
const integer c_userProfile_IBCFwithUnknownUE := 28; // location is IMS1 domain
const integer c_userProfile_IBCFwithHomeUE := 29; // location is IMS1 domain
const integer c_userProfile_IBCFwithVisitingUE := 31; // location is IMS1 domain
const integer c_userProfile_PCSCFwithHomeUE := 41; // location is IMS1 domain
const integer c_userProfile_PCSCFwithVisitingUE := 42; // location is IMS1 domain
const integer c_userProfile_PCSCFwithVisitingUE2 := 43; // location is IMS1 domain
const integer c_userProfile_PCSCFwithUnknownVisitingUE := 44; // location is IMS1 domain
const integer c_userProfile_ICSCFwithHomeUE := 45; // location is IMS1 domain
const integer c_userProfile_SCSCFwithHomeUE := 46; // location is IMS1 domain
const integer c_userProfile_SCSCFwithHomeUE_domain :=55;
const integer c_userProfile_ECSCFwithHomeUE := 47; // location is IMS1 domain
const integer c_userProfile_ISUP := 49; //
const integer c_userProfile_AS1 := 51; // Isc userProfile at AS1
const integer c_userProfile_AS2 := 52; // Isc userProfile at AS2
const integer c_userProfile_ESINetSubscriber := 53;
const integer c_userProfile_ESINetPSAP := 54;
const integer c_userProfile_ESINetUpstreamElement := 55;
// number of interface profile
const integer c_interfaceProfile_IMS_SUT_IBCF1 := 100; // Ic interface at IBCF1 located in SUT
const integer c_interfaceProfile_IMS_SUT_IBCF2 := 101; // Ic interface at IBCF2 located in SUT
const integer c_interfaceProfile_IMS_SUT_PCSCF1 := 110; // Gm interface towards UE1 located in SUT
const integer c_interfaceProfile_IMS_SUT_PCSCF2 := 111; // Gm interface towards UE2 located in SUT
const integer c_interfaceProfile_IMS_SUT_PCSCF := 112; // Mw interface at P-CSCF located in SUT
const integer c_interfaceProfile_IMS_SUT_SCSCF := 113; // Mw interface at S-CSCF located in SUT
const integer c_interfaceProfile_IMS_SUT_ICSCF := 114; // Mw interface at I-CSCF located in SUT
const integer c_interfaceProfile_IMS_SUT_MGCF := 115; // Mw interface at MGCF located in SUT
const integer c_interfaceProfile_IMS_SUT_AS := 116; // Isc interface at AS located in SUT
const integer c_interfaceProfile_IMS_SUT_ECSCF := 117; // Mw interface at E-CSCF located in SUT
const integer c_interfaceProfile_IMS_SUT_BCF := 118; // SIP interface at BCF located in SUT
const integer c_interfaceProfile_SUT_LIS := 119;
const integer c_interfaceProfile_SUT_ECRF := 120;
const integer c_interfaceProfile_SUT_ESRP := 121;
// number of conference profile
const integer c_conferenceProfile_factoryURI := 800; // conference factory URI
// number of service profile
const integer c_serviceProfile_EMERGENCY := 112;
const integer c_serviceProfile_EMERGENCY_INVALID := 666;
const integer c_serviceProfile_SUBSCRIBER := 115;
const integer c_serviceProfile_SUBSCRIPTION_SERVICE := 116;
// number of SIPURL identifiers
const integer c_interfaceSIPURL_IMS_SUT_PCSCF1_domain := 1101; // c_interfaceProfile_IMS_SUT_PCSCF1
const integer c_interfaceSIPURL_IMS_SUT_PCSCF1_ip := 1102; // c_interfaceProfile_IMS_SUT_PCSCF1
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
} // End of group UserProfileConstants
} // End of group Constants
group globalSteps {
/*
*
* @desc sets user parameters with PIXIT values
* @param p_user identifies the selected user configuration and location
* @verdict
*/
function f_init_sdp_userprofile(
inout SDP_Message p_loc_SDP,
in integer p_user, // TODO To be removed
in integer p_sdp_user
) runs on ImsComponent {
select(p_sdp_user){
case (c_userProfile_UE1atSUThome) { // variant c_userProfile_UE1atSUThome
p_loc_SDP := valueof(
m_SDP_mediaList(
{
{ { c_audio, { 20000, omit}, "RTP/AVP", {"0"} }, omit, omit, omit, omit, omit },
{ { c_video, { 20002, omit}, "RTP/AVP", {"31"} }, omit, omit, omit, omit, omit }
},
vc_userprofile
)
);
vc_sdp_local.origin.user_name := PX_IMS_SUT_UE1_PUBLIC_USER;
vc_sdp_local.origin.session_id := "2890844526";
vc_sdp_local.origin.session_version := "2890842807";
vc_sdp_local.origin.addr := "atlanta.example.com";
vc_sdp_local.session_name := "c_userProfile_UE1atSUThome";
f_append_media_attribute(vc_sdp_local, { rtpmap := {"0", {"PCMU", "8000", omit} } } );
f_append_media_attribute(vc_sdp_local, { rtpmap := {"31", {"H261", "90000", omit} } } );
f_append_media_attribute(vc_sdp_local, { sendrecv := { } } );
} // c_userProfile_UE1atSUThome
case (c_userProfile_Vendor1) { //variant c_userProfile_Vendor1
p_loc_SDP := valueof(
m_SDP_mediaList(
{
{ { c_audio, { 10500, omit}, "RTP/AVP", {"8", "0", "18", "4", "96", "97"} }, omit, omit, omit, omit, omit }
},
vc_userprofile
)
);
vc_sdp_local.origin.user_name := "FAST_V2R1";
vc_sdp_local.origin.session_id := "2006";
vc_sdp_local.origin.session_version := "2007";
vc_sdp_local.origin.addr := "155.11.49.64";
vc_sdp_local.session_name := "-";
f_append_media_attribute(vc_sdp_local, { rtpmap := {"0", {"PCMU", "8000", omit} } } );
f_append_media_attribute(vc_sdp_local, { rtpmap := {"18", {"G729", "8000", omit} } } );
f_append_media_attribute(vc_sdp_local, { rtpmap := {"4", {"G723", "8000", omit} } } );
f_append_media_attribute(vc_sdp_local, { rtpmap := {"96", {"AMR", "8000", omit} } } );
f_append_media_attribute(vc_sdp_local, { rtpmap := {"97", {"telephone-event", "8000", omit} } } );
f_append_media_attribute(vc_sdp_local, { fmtp := { "97", { unstructured := "0-15" } } } );
f_append_media_attribute(vc_sdp_local, { sendrecv := { } } );
} // c_userProfile_Huawei
} // End of 'select' statement
log("<<< f_init_sdp_userprofile: p_loc_SDP= ", p_loc_SDP);
} // End of function f_init_sdp_userprofile
/*
*
* @desc sets user parameters with PIXIT values
* @param p_user identifies the selected user configuration and location
* @verdict
*/
function f_init_userprofile(
in integer p_user
) runs on ImsComponent {
select(p_user){
case (c_userProfile_UE1atSUThome) { //variant c_userProfile_UE1atSUThome
vc_userprofile.id := p_user;
vc_userprofile.currPort := PX_IMS_TS_UE1_PORT;
vc_userprofile.currIpaddr := PX_IMS_TS_UE1_IPADDR;
vc_userprofile.contactPort := PX_IMS_TS_UE1_PORT;
vc_userprofile.contactIpaddr := PX_IMS_TS_UE1_IPADDR;
vc_userprofile.bearerIpaddr := PX_IMS_SUT_UE1_BEARER_IPADDR;
vc_userprofile.homeDomain := PX_IMS_SUT_UE1_HOME_DOMAIN;
vc_userprofile.publUsername := PX_IMS_SUT_UE1_PUBLIC_USER;
vc_userprofile.qop := PX_IMS_SUT_UE1_QOP;
vc_userprofile.privUsername := PX_IMS_SUT_UE1_PRIVAT_USERNAME;
vc_userprofile.passwd := PX_IMS_SUT_UE1_PRIVAT_PASSWD;
vc_userprofile.registrarDomain := PX_IMS_SUT_UE1_REGISTRAR;
}
} // End of 'select' statement
} // End of function f_init_userprofile
function f_initSipUrlFromCharstring(charstring p_uri) return SipUrl {
var charstring v_scheme := regexp(p_uri, charstring:"(sip[s]#(0,1)):([^@\\s]+)@?+", 0);
var charstring v_user := regexp(p_uri, charstring:"(sip[s]#(0,1)):([^@\\s]+)@?+", 1);
var charstring v_host_port := regexp(p_uri, charstring:"(sip[s]#(0,1)):([^@\\s]+)@(?+)", 2);
var charstring v_host := "";
var charstring v_port := "";
template charstring t_has_port := pattern "?+:?+";
if (match(v_host_port,t_has_port)) {
v_host := regexp(v_host_port, charstring:"(?+):(?+)",0);
v_port := regexp(v_host_port, charstring:"(?+):(?+)",1);
} else {
v_host := v_host_port;
v_port := "5060";
}
var SipUrl p_sipUrl := {
scheme := v_scheme, // contains "sip"
components := {
sip := {
userInfo := {userOrTelephoneSubscriber:=v_user, password:=omit},
hostPort := {
host := v_host, // hostname, IPv4 or IPv6
portField := str2int(v_port) // represented as an integer
}
}
},
urlParameters := omit,
headers := omit
};
return(p_sipUrl)
}
function f_initSipUrl(
in integer p_user
) return SipUrl {
var SipUrl p_sipUrl := {
scheme := c_sipScheme, // contains "sip"
components := {
sip := {
userInfo := omit,
hostPort := {
host := omit, // hostname, IPv4 or IPv6
portField := omit // represented as an integer
}
}
},
urlParameters := omit,
headers := omit
};
select(p_user) {
case (c_userProfile_UE1atSUThome) {
p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_SUT_UE1_PUBLIC_USER, password:=omit};
p_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_UE1_HOME_DOMAIN, portField :=omit}
}
case (c_userProfile_UE2atSUThome) {
p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_SUT_UE2_PUBLIC_USER, password:=omit};
p_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_UE2_HOME_DOMAIN, portField :=omit}
}
case (c_serviceProfile_EMERGENCY) {
p_sipUrl.components.sip.userInfo := {userOrTelephoneSubscriber:=PX_IMS_SUT_EMERGENCY_SERVICE, password:=omit};
p_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_EMERGENCY_HOME_DOMAIN, portField :=omit}
}
case (c_serviceProfile_SUBSCRIBER) {
p_sipUrl.components.sip.userInfo := { userOrTelephoneSubscriber := PX_IMS_SUT_UE1_PUBLIC_USER, password := omit};
p_sipUrl.components.sip.hostPort := {host := PX_IMS_SUT_UE1_HOME_DOMAIN, portField :=omit}
}
}; // End of 'select' statement
return(p_sipUrl)
} // End of function f_initSipUrl
function f_initTelUrl(
in charstring p_subscriber
) return SipUrl {
var SipUrl p_sipUrl := {
scheme := c_telScheme, // contains "tel"
components := {
tel := {
subscriber := p_subscriber
}
},
urlParameters := omit,
headers := omit
};
return(p_sipUrl)
} // End of function f_initTelUrl
function f_initUrnUrl(
in charstring p_namespaceId,
in charstring p_namespaceSpecificString
) return SipUrl {
var SipUrl p_sipUrl := {
scheme := c_urnScheme, // contains "urn"
components := {
urn := {
namespaceId := p_namespaceId,
namespaceSpecificString := p_namespaceSpecificString
}
},
urlParameters := omit,
headers := omit
};
return(p_sipUrl)
} // End of function f_initUrnUrl
/*
* @desc sets user parameters with PIXIT values
* @param p_user identifies the selected user configuration and location
* @verdict
*/
function f_init_interfaceprofile(
in integer p_interface
) runs on ImsComponent {
vc_sent_label := { host := PX_IMS_SUT_UE_IPADDR, portField := PX_IMS_SUT_UE_PORT };
select(p_interface){
case (c_interfaceProfile_IMS_SUT_IBCF1) { //variant c_interfaceProfile_IMS_SUT_IBCF1
vc_interfaceprofile.SUTPort := PX_IMS_SUT_IBCF1_PORT;
vc_interfaceprofile.SUTIpaddr := PX_IMS_SUT_IBCF1_IPADDR;
vc_interfaceprofile.SUTHomeDomain := PX_IMS_SUT_IBCF1_HOME_DOMAIN;
}
case (c_interfaceProfile_IMS_SUT_IBCF2) { //variant c_interfaceProfile_IMS_SUT_IBCF2
vc_interfaceprofile.SUTPort := PX_IMS_SUT_IBCF2_PORT;
vc_interfaceprofile.SUTIpaddr := PX_IMS_SUT_IBCF2_IPADDR;
vc_interfaceprofile.SUTHomeDomain := PX_IMS_SUT_IBCF2_HOME_DOMAIN;
}
case (c_interfaceProfile_IMS_SUT_PCSCF1) { //variant c_interfaceProfile_IMS_SUT_PCSCF1
vc_interfaceprofile.SUTPort := PX_IMS_SUT_PCSCF1_PORT;
vc_interfaceprofile.SUTIpaddr := PX_IMS_SUT_PCSCF1_IPADDR;
vc_interfaceprofile.SUTHomeDomain := PX_IMS_SUT_PCSCF1_HOME_DOMAIN;
}
case (c_interfaceProfile_IMS_SUT_PCSCF2) { //variant c_interfaceProfile_IMS_SUT_PCSCF2
vc_interfaceprofile.SUTPort := PX_IMS_SUT_PCSCF2_PORT;
vc_interfaceprofile.SUTIpaddr := PX_IMS_SUT_PCSCF2_IPADDR;
vc_interfaceprofile.SUTHomeDomain := PX_IMS_SUT_PCSCF2_HOME_DOMAIN;
}
case (c_interfaceProfile_IMS_SUT_PCSCF) { //variant c_interfaceProfile_IMS_SUT_PCSCF
vc_interfaceprofile.SUTPort := PX_IMS_SUT_PCSCF_PORT;
vc_interfaceprofile.SUTIpaddr := PX_IMS_SUT_PCSCF_IPADDR;
vc_interfaceprofile.SUTHomeDomain := PX_IMS_SUT_PCSCF_HOME_DOMAIN;
}
case (c_interfaceProfile_IMS_SUT_SCSCF) { //variant c_interfaceProfile_IMS_SUT_SCSCF
vc_interfaceprofile.SUTPort := PX_IMS_SUT_SCSCF_PORT;
vc_interfaceprofile.SUTIpaddr := PX_IMS_SUT_SCSCF_IPADDR;
vc_interfaceprofile.SUTHomeDomain := PX_IMS_SUT_SCSCF_HOME_DOMAIN;
}
case (c_interfaceProfile_IMS_SUT_ICSCF) { //variant c_interfaceProfile_IMS_SUT_ICSCF
vc_interfaceprofile.SUTPort := PX_IMS_SUT_ICSCF_PORT;
vc_interfaceprofile.SUTIpaddr := PX_IMS_SUT_ICSCF_IPADDR;
vc_interfaceprofile.SUTHomeDomain := PX_IMS_SUT_ICSCF_HOME_DOMAIN;
}
case (c_interfaceProfile_IMS_SUT_MGCF) { //variant c_interfaceProfile_IMS_SUT_MGCF
vc_interfaceprofile.SUTPort := PX_IMS_SUT_IMGCF_PORT;
vc_interfaceprofile.SUTIpaddr := PX_IMS_SUT_IMGCF_IPADDR;
vc_interfaceprofile.SUTHomeDomain := PX_IMS_SUT_IMGCF_HOME_DOMAIN;
}
case (c_interfaceProfile_IMS_SUT_AS) { //variant c_interfaceProfile_IMS_SUT_AS
vc_interfaceprofile.SUTPort := PX_IMS_SUT_AS_PORT;
vc_interfaceprofile.SUTIpaddr := PX_IMS_SUT_AS_IPADDR;
vc_interfaceprofile.SUTHomeDomain := PX_IMS_SUT_AS_HOME_DOMAIN;
}
}
} // End of function f_init_interfaceprofile
} // End of group globalSteps
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
group SetHeaders{
/**
* @desc function sets header field for the next outgoing REGISTER message
* @param p_cSeq_s CSeq parameter to be applied
* @param p_emergency Set to true in case of emergency
*/
function f_setHeaders_REGISTER_AS( //TODO review and repair params due to isc interface
inout CSeq p_cSeq_s,
boolean p_emergency := false
) runs on SipComponent {
var SemicolonParam_List v_params := {};
f_setHeadersGeneral(p_cSeq_s, "REGISTER"); // cseq, contact, branch, via
vc_requestUri := {
scheme := c_sipScheme,
components := {
sip := {
userInfo := omit,
hostPort := {
host := vc_userprofile.registrarDomain,
portField := omit
}
}
},
urlParameters := omit,
headers := omit
};
vc_reqHostPort := vc_requestUri.components.sip.hostPort;
vc_callId := {
fieldName := CALL_ID_E,
callid := f_getRndCallId() & c_AT & vc_userprofile.currIpaddr
};
vc_callIdReg := vc_callId; // remember callId for de-registration
vc_to := valueof(m_To(m_SipUrl_currDomain(vc_userprofile)));
vc_cancel_To := vc_to;
v_params := f_addParameter(v_params,
{
id := c_tagId,
paramValue := {
tokenOrHost := f_getRndTag()
}
});
vc_from := {
fieldName := FROM_E,
addressField := vc_to.addressField,
fromParams := v_params
};
if (not vc_firstREGISTER_sent) {
if (p_emergency) {
v_params := {
{
"sos",
omit
}
};
vc_contact.contactBody.contactAddresses[0].addressField.addrSpecUnion.urlParameters := v_params;
}
else {
v_params := {
{
id := c_expiresId,
paramValue := {
tokenOrHost := c_shortRegistration
}
}
};
vc_contact.contactBody.contactAddresses[0].contactParams := v_params;
}
}
vc_firstREGISTER_sent := true; // f_setHeaders_Register is called in deREGISTER function
vc_authorization := {
fieldName := AUTHORIZATION_E,
body := {f_calculatecCredentials_empty(vc_userprofile)}
};
vc_via_REG := vc_via;
} // end function setHeaders_REGISTER_AS
} // End of group SetHeaders
} // End of module AtsSccas_Steps