Newer
Older
// 200OK to complete the request
vc_contact := vc_request.msgHeader.contact;
vc_contact.contactBody.contactAddresses[0].contactParams := {{"expires",int2str(3600)}};
v_passociated_url := vc_caller_From.addressField.nameAddr.addrSpec;
f_sendResponse(m_Response_2xxonREGISTER_IMS(c_statusLine200,vc_callId, vc_cSeq,vc_callee_From, vc_callee_To, vc_via,vc_contact,f_initSipUrl(c_userProfile_SCSCFwithHomeUE),v_passociated_url));
}//end function f_awaitingRegistration_IMS
/**
*
* @desc awaiting UE1 registration (with authentication)
* @param p_cSeq_s cseq parameter
*/
function f_awaitingRegistration_IMS_gm(inout CSeq p_cSeq_s) runs on ImsComponent
{
var SipUrl v_passociated_url;
var Authorization p_authorization;
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
vc_ignore_subscribe := true;//handle SUBSCRIBE during the call
//Awaiting 1st REGISTER
f_awaitingREGISTER(mw_REGISTER_unauthorizedRequest_IMS);
// 401 response
f_sendResponse(m_Response_WWWauthenticate_IMS(c_statusLine401,
vc_callId, vc_cSeq,vc_caller_From, vc_caller_To, vc_via,
m_wwwAuthenticate(f_calculatecChallenge_forWWWAuthorization
(PX_IMS_SUT_UE1_QOP,vc_authorization.body[0].digestResponse)))
);
//Awaiting 2nd REGISTER with authorization header
f_awaitingREGISTER(mw_REGISTER_authorizedRequest_wo_securityheaders_IMS);
//f_awaitingREGISTER(mw_REGISTER_authorizedRequest_IMS(m_Authorization_digest(mw_digestResponse((c_Integrity_protected_yes,c_Integrity_protected_ip_assoc_pending)))));
// 200OK to complete the request
vc_contact := vc_request.msgHeader.contact;
vc_contact.contactBody.contactAddresses[0].contactParams := {{"expires",int2str(3600)}};
v_passociated_url := vc_caller_From.addressField.nameAddr.addrSpec;
f_sendResponse(m_Response_2xxonREGISTER_IMS(c_statusLine200,vc_callId, vc_cSeq,vc_callee_From, vc_callee_To, vc_via,vc_contact,f_initSipUrl(c_userProfile_SCSCFwithHomeUE),v_passociated_url));
}//end function f_awaitingRegistration_IMS_gm
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
/**
*
* @desc remove registration
* @param p_cSeq_s cseq parameter
*/
function f_RemoveRegistration_IMS(inout CSeq p_cSeq) runs on SipComponent
{
var CommaParam_List v_challenge;
var Credentials v_credentials;
var template REGISTER_Request v_request;
if (PX_SIP_REGISTRATION)
{
f_setHeaders_deREGISTER(p_cSeq);
v_request := m_REGISTER_Request_expires_IMS(vc_requestUri, vc_callIdReg,
p_cSeq, vc_from, vc_to, vc_via, vc_contact, vc_authorization, "0");
v_request.msgHeader.route := f_route();
f_SendREGISTER(v_request);
if (PX_SIP_REGISTER_AUTHENTICATION_ENABLED)
{
// receiving 401 Unauthorized response.
// and Re-send REGISTER request with Authorization header
tc_ack.start(PX_SIP_TACK);
alt
{
[] SIPP.receive (mw_Response_Base(c_statusLine401, vc_callIdReg, p_cSeq)) -> value vc_response
{
tc_ack.stop;
// set headers via, cseq and authorization
f_setHeaders_2ndREGISTER(p_cSeq);
v_request := m_REGISTER_Request_expires_IMS(vc_requestUri, vc_callIdReg,
p_cSeq, vc_from, vc_to, vc_via, vc_contact, vc_authorization, "0");
v_request.msgHeader.route := f_route();
// Re-send protected REGISTER
f_SendREGISTER(v_request);//LibSip
// awaiting 200 OK REGISTER
f_awaitingResponse(mw_Response_Base(c_statusLine200, vc_callIdReg, p_cSeq));
}
[] SIPP.receive (mw_Response_Base(c_statusLine200, vc_callIdReg, p_cSeq))-> value vc_response
{
tc_ack.stop;
f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response);
log ("Authorization was not requested as expected");
}
}
}
else
{
f_awaitingResponse(mw_Response_Base(c_statusLine200, vc_callIdReg, p_cSeq));
}
}
} // end f_RemoveRegistration_IMS
} // end group registration
group preambles {
/*
*
* @desc Sets variables and default initialization for user profile where proxy role is present
* @param p_userprofile user profile of call
* @param p_cSeq_s cseq parameter
*/
function f_IMS_preamble_MGCF(in integer p_userprofile, inout CSeq p_cSeq_s) runs on ImsComponent
{
vc_boo_recordRoute := true;
vc_boo_route := true;
f_init_interfaceprofile(c_interfaceProfile_IMS_SUT_MGCF);
f_IMS_preamble_woRegistration(p_userprofile, p_cSeq_s);
}
/*
*
* @desc Sets variables and default initialization for user profile
* @param p_userprofile user profile of call
* @param p_cSeq_s cseq parameter
*/
function f_IMS_preamble_woRegistration(in integer p_userprofile, inout CSeq p_cSeq_s) runs on ImsComponent
{
// avoid deregistration in default behavior
vc_DeregDone := true;
vc_boo_route := true;
vc_boo_recordRoute := true;
//Variables & defaults initialization
LibSip_Steps.f_init_component(p_cSeq_s);
//Preamble
f_init_userprofile(p_userprofile); // assignment of PIXIT values to component variable
vc_sdp_local := valueof(m_SDP_bandwidth(valueof(m_media_dynPT(PX_SIP_SDP_dyn, PX_SIP_SDP_encoding)), vc_userprofile));
vc_contact := valueof(m_Contact(m_SipUrl_contactIpaddr(vc_userprofile)));
*
* @desc Sets variables and default initialization for user profile and handle registration and authentication with MD5
* @param p_userprofile user profile of call
* @param p_cSeq_s cseq parameter
* @param p_register register template
*/
function f_IMS_preamble_withRegistration (in integer p_userprofile, inout CSeq p_cSeq_s, out template REGISTER_Request p_register) runs on ImsComponent
{
//Variables & defaults initialization
f_IMS_preamble_woRegistration(p_userprofile, p_cSeq_s);
//Preamble
f_Registration(p_cSeq_s, p_register, PX_SIP_REGISTER_AUTHENTICATION_ENABLED);
// deregistration in case of successful registration
vc_DeregDone := false;
f_setHeaders_SUBSCRIBE(p_cSeq_s);
f_Subscription(p_cSeq_s, m_SUBSCRIBE_Request_UE(vc_requestUri, vc_callId, p_cSeq_s, vc_from, vc_to, vc_via, vc_contact, vc_route_REG));
*
* @desc Sets variables and default initialization for user profile and handle registration and authentication with MD5
* @param p_userprofile user profile of call
function f_IMS_preamble_withRegistrationBasic (in integer p_userprofile, inout CSeq p_cSeq_s) runs on ImsComponent
{
//Variables & defaults initialization
f_IMS_preamble_woRegistration(p_userprofile, p_cSeq_s);
//Preamble
f_Registration_IMS(p_cSeq_s, PX_SIP_REGISTER_AUTHENTICATION_ENABLED);
f_setHeaders_SUBSCRIBE(p_cSeq_s);
f_Subscription(p_cSeq_s, m_SUBSCRIBE_Request_UE(vc_requestUri, vc_callId, p_cSeq_s, vc_from, vc_to, vc_via, vc_contact, vc_route_REG));
}
} // end group preambles
group postambles {
/*
*
* @desc Sets variables and default initialization for user profile and handle deregistration
* @param p_cSeq_s cseq parameter
*/
function f_IMS_postamble_withDeRegistration (CSeq p_CSeq) runs on ImsComponent {
f_RemoveRegistration(p_CSeq); // TODO check if applicable for IMS
f_terminate_component();
}
function f_SIP_postamble_IMS1_withoutRegistration () runs on ImsComponent
{f_terminate_component()};
function f_IMS_postamble_withoutDeRegistration () runs on ImsComponent
{f_terminate_component()};
function f_SIP_postamble_IMS1_awaitDeRegistration () runs on ImsComponent
{
var SipUrl v_passociated_url;
//Awaiting 1st REGISTER
f_awaitingREGISTER(mw_REGISTER_unauthorizedRequest_IMS);
// 401 response
f_sendResponse(m_Response_WWWauthenticate_IMS(c_statusLine401,
vc_callId, vc_cSeq,vc_caller_From, vc_caller_To, vc_via,
m_wwwAuthenticate(f_calculatecChallenge_forWWWAuthorization
(PX_IMS_SUT_UE1_QOP,vc_authorization.body[0].digestResponse)))
);
//Awaiting 2nd REGISTER with authorization header
f_awaitingREGISTER(mw_REGISTER_unauthorizedRequest_IMS);//mw_REGISTER_authorizedRequest_IMS(m_Authorization_digest(mw_digestResponse(c_Integrity_protected_yes))));
// f_awaitingREGISTER(mw_REGISTER_authorizedRequest_IMS(m_Authorization_digest(mw_digestResponse(c_Integrity_protected_yes))));
// 200OK to complete the request
// vc_contact := vc_request.msgHeader.contact;
// vc_contact.contactBody.contactAddresses[0].contactParams := {{"expires",int2str(0)}};
v_passociated_url := vc_caller_From.addressField.nameAddr.addrSpec;
f_sendResponse(m_Response_2xxonREGISTER_IMS(c_statusLine200,vc_callId, vc_cSeq,vc_callee_From, vc_callee_To, vc_via,vc_contact,f_initSipUrl(c_userProfile_SCSCFwithHomeUE),v_passociated_url));
f_terminate_component()
};
function f_IMS_postamble_awaitDeRegistration () runs on ImsComponent
{
var SipUrl v_passociated_url;
//Awaiting 1st REGISTER
f_awaitingREGISTER(mw_REGISTER_unauthorizedRequest_IMS);
// 401 response
f_sendResponse(m_Response_WWWauthenticate_IMS(c_statusLine401,
vc_callId, vc_cSeq,vc_caller_From, vc_caller_To, vc_via,
m_wwwAuthenticate(f_calculatecChallenge_forWWWAuthorization
(PX_IMS_SUT_UE1_QOP,vc_authorization.body[0].digestResponse)))
);
//Awaiting 2nd REGISTER with authorization header
f_awaitingREGISTER(mw_REGISTER_unauthorizedRequest_IMS);//mw_REGISTER_authorizedRequest_IMS(m_Authorization_digest(mw_digestResponse(c_Integrity_protected_yes))));
// 200OK to complete the request
// vc_contact := vc_request.msgHeader.contact;
// vc_contact.contactBody.contactAddresses[0].contactParams := {{"expires",int2str(0)}};
v_passociated_url := vc_caller_From.addressField.nameAddr.addrSpec;
f_sendResponse(m_Response_2xxonREGISTER_IMS(c_statusLine200,vc_callId, vc_cSeq,vc_callee_From, vc_callee_To, vc_via,vc_contact,f_initSipUrl(c_userProfile_SCSCFwithHomeUE),v_passociated_url));
f_terminate_component()
};
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
function f_IMS_awaitDeRegistration () runs on ImsComponent
{
var SipUrl v_passociated_url;
//Awaiting 1st REGISTER
f_awaitingREGISTER(mw_REGISTER_unauthorizedRequest_IMS);
// 401 response
f_sendResponse(m_Response_WWWauthenticate_IMS(c_statusLine401,
vc_callId, vc_cSeq,vc_caller_From, vc_caller_To, vc_via,
m_wwwAuthenticate(f_calculatecChallenge_forWWWAuthorization
(PX_IMS_SUT_UE1_QOP,vc_authorization.body[0].digestResponse)))
);
//Awaiting 2nd REGISTER with authorization header
f_awaitingREGISTER(mw_REGISTER_unauthorizedRequest_IMS);//mw_REGISTER_authorizedRequest_IMS(m_Authorization_digest(mw_digestResponse(c_Integrity_protected_yes))));
// 200OK to complete the request
// vc_contact := vc_request.msgHeader.contact;
// vc_contact.contactBody.contactAddresses[0].contactParams := {{"expires",int2str(0)}};
v_passociated_url := vc_caller_From.addressField.nameAddr.addrSpec;
f_sendResponse(m_Response_2xxonREGISTER_IMS(c_statusLine200,vc_callId, vc_cSeq,vc_callee_From, vc_callee_To, vc_via,vc_contact,f_initSipUrl(c_userProfile_SCSCFwithHomeUE),v_passociated_url));
};
function f_SIP_postamble_UE1_withoutRegistration () runs on ImsComponent
{f_terminate_component()};
function f_SIP_postamble_UE2_withoutRegistration () runs on ImsComponent
{f_terminate_component()};
/**
*
* @param p_CallId parameter for outgoing BYE
* @param p_cSeq parameter for outgoing BYE
* @param p_from parameter for outgoing BYE
* @param p_to parameter for outgoing BYE
* @param p_reqHostPort parameter for outgoing BYE
*/
function f_terminateCall_IMS(SipUrl p_requestUri, CallId p_CallId, inout CSeq p_cSeq, From p_from,
template To p_to) runs on ImsComponent
{
LibSip_Steps.f_setHeadersBYE(p_cSeq);
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
// Sending of a BYE request to release the call and expect a final response
f_SendBYE(m_BYE_Request_IMS(p_requestUri, p_CallId, p_cSeq, p_from, valueof(p_to), vc_via, vc_route));
tc_resp.start(PX_SIP_TRESP);
alt
{
[] SIPP.receive (mw_Response_Base(mw_statusLine1xx, p_CallId, p_cSeq))
{
repeat;
}
[] SIPP.receive (mw_Response_Base(mw_statusLineFinal, p_CallId, p_cSeq))
{
tc_resp.stop;
}
// timeout should be handled in default_alt_step
}
} // end function f_terminateCall
/**
*
* @param p_CallId parameter for outgoing BYE
* @param p_cSeq parameter for outgoing BYE
* @param p_from parameter for outgoing BYE
* @param p_to parameter for outgoing BYE
* @param p_reqHostPort parameter for outgoing BYE
*/
function f_terminateCall_UE(SipUrl p_requestUri, CallId p_CallId, inout CSeq p_cSeq, From p_from,
template To p_to) runs on ImsComponent
{
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
// Sending of a BYE request to release the call and expect a final response
f_SendBYE(m_BYE_Request_UE(p_requestUri, p_CallId, p_cSeq, p_from, valueof(p_to), vc_via, vc_route));
tc_resp.start(PX_SIP_TRESP);
alt
{
[] SIPP.receive (mw_Response_Base(mw_statusLine1xx, p_CallId, p_cSeq))
{
repeat;
}
[] SIPP.receive (mw_Response_Base(mw_statusLineFinal, p_CallId, p_cSeq))
{
tc_resp.stop;
}
// timeout should be handled in default_alt_step
}
} // end function f_terminateCall_UE
}
group defaults {
}
} // module LibIms_Steps