Compare Revisions

The credentials to download the source code are:
 Username: svnusers
 Password: svnusers

Ignore whitespace Rev 189 → Rev 190

/branches/v3/ttcn/LibIms_Steps.ttcn
24,9 → 24,9
group parameterOperations {
 
/**
* @desc functions add new via parameter
* @desc Adds new Via parameter
* @param p_message (request) SIP message to be used to prepair via header
* @param p_userprofile user profile
* @param p_userprofile The user profile
*/
function f_addNewViaParameter(
in Request p_message,
48,9 → 48,8
}
 
/**
* @desc functions remove own via parameter
* @desc Removes own Via parameter
* @param p_message (request) SIP message to be used to prepair via header
* @param p_userprofile user profile
*/
function f_removeOwnViaParameter(
in Response p_message
70,9 → 69,8
}
 
/**
* @desc functions add new via parameter
* @desc Adds new RecordRoute parameter and removes Route parameter
* @param p_message (request) SIP message to be used to prepair via header
* @param p_userprofile user profile
*/
function f_addNewRecordRouteAndRemoveRoutParameter(
in Request p_message
106,9 → 104,8
}
 
/**
* @desc functions add new recordRoute parameter
* @param p_message (request) SIP message to be used to prepair via header
* @param p_userprofile user profile
* @desc Adds new RecordRoute parameter (IMS)
* @param p_rr The recordRoute parameter to add
*/
function f_addNewRecordRouteIMS(
in RecordRoute p_rr
134,24 → 131,19
}
}
 
 
} // end group parameterOperations
 
group fieldOperations {
 
/**
* @desc sets BYE header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s current cSeq
* @param p_to_user user_profile id of the user to send Bye
* @verdict
* @desc Sets BYE header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s The current cSeq
* @param p_to_user The user_profile id of the user to send Bye
*/
function f_setHeadersBYE(
inout CSeq p_cSeq_s,
in integer p_to_user
) runs on ImsComponent {
// vc_to := f_initToHeader(p_to_user); // init of vc_to using userProfile identifier
//
// vc_from := f_initFromHeader(vc_userprofile.id, f_getRndTag()); // init of vc_from using userProfile identifier
vc_requestUri := f_initSipUrl(p_to_user); // Request URI of Invite is identical with To header
vc_route := f_route(); // update the route header field depending on vc_boo_route
vc_recordRoute := f_recordroute(); // update the route header field depending on vc_boo_route
159,10 → 151,9
} // end f_setHeadersBYE
 
/**
* @desc sets CANCEL header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s current cSeq
* @param p_to_user user_profile id of the user to send Cancel
* @verdict
* @desc Sets CANCEL header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s The current cSeq
* @param p_to_user The user_profile id of the user to send Cancel
*/
function f_setHeadersCANCEL(
inout CSeq p_cSeq_s,
174,7 → 165,8
} // end f_setHeadersCANCEL
 
/**
* @desc sets headers for forward request from AS in case if AS acts as Proxy
* @desc Sets headers for forward request from AS in case if AS acts as Proxy
* @param p_cSeq_s The current cSeq
* @param p_proxyMode true = proxyMode, false = B2BMode
*/
function f_setHeadersForwardRequestFromAS(
202,7 → 194,8
} // end function f_setHeadersForwardRequest
 
/**
* @desc sets header fields for forward request from AS in case if AS acts as Proxy
* @desc Sets header fields for forward request from AS in case if AS acts as Proxy
* @param p_cSeq_s The current cSeq
*/
function f_setHeadersForwardResponseFromAS(
inout CSeq p_cSeq_s
221,10 → 214,9
} // end function f_setHeadersForwardResponse
 
/**
* @desc sets Invite header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s current cSeq
* @param p_to_user user_profile id of the user to be invited
* @verdict
* @desc Sets Invite header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s The current cSeq
* @param p_to_user The user_profile id of the user to be invited
*/
function f_setHeadersINVITE(
inout CSeq p_cSeq_s,
244,10 → 236,9
} // end f_setHeadersINVITE
 
/**
* @desc sets Invite header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s current cSeq
* @param p_to_user user_profile id of the user to be invited
* @verdict
* @desc Sets Invite header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s The current cSeq
* @param p_to_user The user_profile id of the user to be invited
*/
function f_setHeadersUPDATE(
inout CSeq p_cSeq_s,
267,10 → 258,9
} // end f_setHeadersUPDATE
 
/**
* @desc sets Message header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s current cSeq
* @param p_to_user user_profile id of the user to be invited
* @verdict
* @desc Sets Message header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s The current cSeq
* @param p_to_user The user_profile id of the user to be invited
*/
function f_setHeadersMESSAGE(
inout CSeq p_cSeq_s,
283,10 → 273,9
} // end f_setHeadersMESSAGE
 
/**
* @desc sets Notify header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s current cSeq
* @param p_to_user user_profile id of the user to be invited
* @verdict
* @desc Sets Notify header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s The current cSeq
* @param p_to_user The user_profile id of the user to be invited
*/
function f_setHeadersNOTIFY(
inout CSeq p_cSeq_s,
308,10 → 297,9
} // end f_setHeadersNOTIFY
 
/**
* @desc sets Publish header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s current cSeq
* @param p_to_user user_profile id of the user to be invited
* @verdict
* @desc Sets Publish header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s The current cSeq
* @param p_to_user The user_profile id of the user to be invited
*/
function f_setHeadersPUBLISH(
inout CSeq p_cSeq_s,
340,10 → 328,9
} // end f_setHeadersPUBLISH
 
/**
* @desc sets Subscribe header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s current cSeq
* @param p_to_user user_profile id of the user to be invited
* @verdict
* @desc Sets Subscribe header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s The current cSeq
* @param p_to_user The user_profile id of the user to be invited
*/
function f_setHeadersSUBSCRIBE(
inout CSeq p_cSeq_s,
365,9 → 352,10
} // end f_setHeadersSUBSCRIBE
 
/**
* @desc sets headers for ReINVITE method
* @param p_cSeq_s current cSeq
* @desc Sets headers for ReINVITE method
* @param p_cSeq_s The current cSeq
* @param p_orginatingSide true in case of Re-INVITE is send from the orgination endpoint otherwise false.
* @param p_to_user The user_profile id of the user to be re-invited
*/
function f_setHeadersReINVITE(
inout CSeq p_cSeq_s,
418,9 → 406,9
} // end function f_setHeadersReINVITE
 
/**
* @desc sets component variables related to message header fields when sending requests from the home I-CSCF (TS) to the visited P-CSCF (SUT) (message type independent: CSeq, contact, via), function uses information from userprofile and interfaceprofile
* @param p_cSeq_s CSeq parameter
* @param p_method method name for cSeq header field
* @desc Sets component variables related to message header fields when sending requests from the home I-CSCF (TS) to the visited P-CSCF (SUT) (message type independent: CSeq, contact, via), function uses information from userprofile and interfaceprofile
* @param p_cSeq_s The CSeq parameter
* @param p_method The method name for cSeq header field
*/
function f_setHeadersGeneral_ICSCF(
inout CSeq p_cSeq_s,
448,8 → 436,8
} // end function f_setHeadersGeneral_ICSCF
 
/**
* @desc sets header field for the next outgoing REGISTER message from the visited P-CSCF to the home I-CSCF
* @param p_cSeq_s CSeq parameter to be applied
* @desc Sets header field for the next outgoing REGISTER message from the visited P-CSCF to the home I-CSCF
* @param p_cSeq_s The CSeq parameter to be applied
*/
function f_setHeaders_REGISTER_PCSCF(
inout CSeq p_cSeq_s
510,13 → 498,10
};
} // end function setHeaders_REGISTER_PCSCF
 
 
 
/**
* @desc sets REFER header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s current cSeq
* @param p_to_user user_profile id of the user to be invited
* @verdict
* @desc Sets REFER header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s The current cSeq
* @param p_to_user The user_profile id of the user to be invited
*/
function f_setHeadersREFER(
inout CSeq p_cSeq_s,
536,9 → 521,9
} // end f_setHeadersREFER
 
/**
* @desc sets REFER header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s current cSeq
* @param p_uri SipUrl for request URI and To header
* @desc Sets REFER header fields (IMS addresses) extension of general settings from LibSip basic function
* @param p_cSeq_s The current cSeq
* @param p_uri The SipUrl for request URI and To header
*/
function f_setHeadersREFER_conf(
inout CSeq p_cSeq_s,
567,16 → 552,17
LibSip_Steps.f_setHeadersREFER(p_cSeq_s);
} // end f_setHeadersREFER_conf
 
 
} // end group fieldOperations
 
group awaitingMessage {
}
group sendMessage {
 
/**
* @desc send PRACK message
* @param p_request template of the message to be sent
* @desc Sends PRACK message
* @param p_mb The message body of the PRACK message
* @param p_rack_cseq The cSeq of the PRACK message
*/
function f_SendPRACK_sdp(
template(value) MessageBody p_mb,
605,9 → 591,8
group globalSteps {
 
/**
* @desc sets user parameters with PIXIT values
* @param p_user identifies the selected user configuration and location
* @verdict
* @desc Sets user parameters with PIXIT values
* @param p_user Identifies the selected user configuration and location
*/
function f_init_userprofile(
in integer p_user
816,7 → 801,7
vc_userprofile.contactPort := PX_IMS_TS_AS1_PORT; // contact (simulated UE)
vc_userprofile.contactIpaddr := PX_IMS_TS_AS1_IPADDR; // contact
vc_userprofile.bearerIpaddr := PX_IMS_SUT_UE1_BEARER_IPADDR;
vc_userprofile.homeDomain := PX_IMS_TS_AS1_HOME_DOMAIN; // via, routevc_userprofile.publUsername := PX_IMS_SUT_UE4_PUBLIC_USER; // From, To (register)
vc_userprofile.homeDomain := PX_IMS_TS_AS1_HOME_DOMAIN; // via, route
vc_userprofile.publUsername := "as1";
vc_userprofile.qop := ""; // Authorization
vc_userprofile.privUsername := ""; // Authorization
844,6 → 829,11
}
}
 
/**
* @desc Initializes the To header
* @param p_user Identifies the selected user configuration and location
* @return The To header
*/
function f_initToHeader(
in integer p_user
) runs on ImsComponent
862,7 → 852,12
return (p_to);
}
 
 
/**
* @desc Initializes the From header
* @param p_user Identifies the selected user configuration and location
* @param p_tag_str The string value of the tag id
* @return The From header
*/
function f_initFromHeader(
in integer p_user,
charstring p_tag_str
887,6 → 882,11
return v_from;
}
 
/**
* @desc Initializes the SIP URL
* @param p_user Identifies the selected user configuration and location
* @return The SIP URL
*/
function f_initSipUrl(
in integer p_user
) runs on ImsComponent
1113,11 → 1113,9
}
}
 
 
/**
* @desc sets user parameters with PIXIT values
* @param p_user identifies the selected user configuration and location
* @verdict
* @desc Initializes interface profile parameters with PIXIT values
* @param p_interface Identifies the selected interface
*/
function f_init_interfaceprofile(
in integer p_interface
1172,9 → 1170,9
}
 
/**
* @desc retrieves user DomainPort value of the interface profile
* @param p_interface identifies the selected interface
* @return DomainPort template
* @desc Retrieves user DomainPort value of the user profile
* @param p_userProfile Identifies the selected user profile
* @return The Domain HostPort
*/
function f_get_userDomainPort(
in SipUserProfile p_userProfile
1188,9 → 1186,9
}
 
/**
* @desc retrieves HostPort value of the interface profile
* @param p_interface identifies the selected interface
* @return HostPort template
* @desc Retrieves HostPort value of the interface profile
* @param p_interface Identifies the selected interface
* @return The HostPort
*/
function f_get_interfaceHostPort(
in ImsInterfaceProfile p_interface
1204,9 → 1202,9
}
 
/**
* @desc retrieves DomainPort value of the interface profile
* @param p_interface identifies the selected interface
* @return DomainPort template
* @desc Retrieves DomainPort value of the interface profile
* @param p_interface Identifies the selected interface
* @return The Domain HostPort
*/
function f_get_interfaceDomainPort(
in ImsInterfaceProfile p_interface
1220,9 → 1218,9
}
 
/**
* @desc retrieves SipUrl of the interface profile
* @param p_interface identifies the selected interface
* @return SipUrl template
* @desc Gets the receive template for the NameAddr of the interface
* @param p_interface Identifies the selected interface
* @return The NameAddr template
*/
function f_get_interfaceNameAddr(
in ImsInterfaceProfile p_interface
1231,13 → 1229,13
return mw_SipUrl_SUTinterface(p_interface.SUTIpaddr, p_interface.SUTPort);
}
 
 
}
group registration {
 
/**
* @desc registration and authentication with MD5
* @param p_cSeq_s cseq parameter
* @desc Registration and authentication
* @param p_cSeq_s The current cseq
* @param p_auth flag indicating if authentication is needed
*/
function f_Registration_IMS(
1276,10 → 1274,19
 
/**
* @desc awaiting UE1 registration (with authentication)
* @param p_cSeq_s cseq parameter
* @param p_cSeq_s The current cseq
* @param p_register The expected REGISTER_Request - default: mw_REGISTER_authorizedRequest_IMS
*/
function f_awaitingRegistration_IMS(
inout CSeq p_cSeq_s
inout CSeq p_cSeq_s,
in template(present) REGISTER_Request p_register :=
mw_REGISTER_authorizedRequest_IMS(
mw_Authorization_digest(
mw_digestResponse(
(c_Integrity_protected_yes, c_Integrity_protected_ip_assoc_pending)
)
)
)
) runs on ImsComponent {
var SipUrl v_passociated_url;
var Authorization p_authorization;
1305,15 → 1312,7
);
 
// Awaiting 2nd REGISTER with authorization header
f_awaitingREGISTER(
mw_REGISTER_authorizedRequest_IMS(
mw_Authorization_digest(
mw_digestResponse(
(c_Integrity_protected_yes, c_Integrity_protected_ip_assoc_pending)
)
)
)
);
f_awaitingREGISTER(p_register);
 
// 200OK to complete the request
if (isvalue(vc_request.msgHeader.contact)) {
1330,58 → 1329,22
} // end function f_awaitingRegistration_IMS
 
/**
* @desc awaiting UE1 registration (with authentication)
* @param p_cSeq_s cseq parameter
* @desc Awaiting UE1 registration (with authentication, without security headers)
* @param p_cSeq_s The current cseq
*/
function f_awaitingRegistration_IMS_gm(
inout CSeq p_cSeq_s
) runs on ImsComponent {
var SipUrl v_passociated_url;
var Authorization p_authorization;
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,
valueof(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
if (isvalue(vc_request.msgHeader.contact)) {
vc_contact := valueof(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));
f_awaitingRegistration_IMS(p_cSeq_s, mw_REGISTER_authorizedRequest_wo_securityheaders_IMS);
vc_DeregDone := false;
} // end function f_awaitingRegistration_IMS_gm
 
 
/**
* @desc remove registration
* @param p_cSeq_s cseq parameter
* @desc Remove registration
* @param p_cSeq_s The current cseq
*/
function f_RemoveRegistration_IMS(
inout CSeq p_cSeq
1425,8 → 1388,6
}
} // end f_RemoveRegistration_IMS
 
 
 
} // end group registration
 
group preambles {
1433,8 → 1394,8
 
/**
* @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
* @param p_userprofile User profile of call
* @param p_cSeq_s The current cseq
*/
function f_IMS_preamble_MGCF(
in integer p_userprofile,
1449,8 → 1410,8
 
/**
* @desc Sets variables and default initialization for user profile
* @param p_userprofile user profile of call
* @param p_cSeq_s cseq parameter
* @param p_userprofile User profile of call
* @param p_cSeq_s The current cseq
*/
function f_IMS_preamble_woRegistration(
in integer p_userprofile,
1473,8 → 1434,8
//NOTE STF471 added
/**
* @desc Sets variables and default initialization for user profile
* @param p_userprofile user profile of call
* @param p_cSeq_s cseq parameter
* @param p_userprofile User profile of call
* @param p_cSeq_s The current cseq
*/
function f_IMS_preamble_woRegistration_as(
in integer p_userprofile,
1495,9 → 1456,10
 
/**
* @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
* @param p_userprofile User profile of call
* @param p_interface Identifies the selected interface
* @param p_cSeq_s The current cseq
* @param p_register Register template
*/
function f_IMS_preamble_withEmergencyRegistration(
in integer p_userprofile,
1518,9 → 1480,10
 
/**
* @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
* @param p_userprofile User profile of call
* @param p_interface Identifies the selected interface
* @param p_cSeq_s The current cseq
* @param p_register Register template
*/
function f_IMS_preamble_withRegistration(
in integer p_userprofile,
1546,15 → 1509,18
//NOTE STF471 added
/**
* @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
* @param p_userprofile User profile of call
* @param p_interface Identifies the selected interface
* @param p_cSeq_s The current cseq
* @param p_register Register template
*/
function f_IMS_preamble_withRegistrationWoSubscription(
in integer p_userprofile,
in integer p_interface,
inout CSeq p_cSeq_s,
out template REGISTER_Request p_register
) runs on ImsComponent {
f_init_interfaceprofile(p_interface);
 
// Variables & defaults initialization
f_IMS_preamble_woRegistration(p_userprofile, p_cSeq_s);
1568,8 → 1534,9
 
/**
* @desc Sets variables and default initialization for user profile and handle registration and authentication with MD5 (basic registration template)
* @param p_userprofile user profile of call
* @param p_cSeq_s cseq parameter
* @param p_userprofile User profile of call
* @param p_interface Identifies the selected interface
* @param p_cSeq_s The current cseq
*/
function f_IMS_preamble_withRegistrationBasic(
in integer p_userprofile,
1588,8 → 1555,9
 
/**
* @desc Sets variables and default initialization for user profile and handle registration and authentication with MD5 (basic registration template)
* @param p_userprofile user profile of call
* @param p_cSeq_s cseq parameter
* @param p_userprofile User profile of call
* @param p_interface Identifies the selected interface
* @param p_cSeq_s The current cseq
*/
function f_IMS_preamble_AS(
in integer p_userprofile,
1613,14 → 1581,13
vc_contact := m_Contact(m_SipUrl_contactIpaddr(vc_userprofile));
}
 
 
} // end group preambles
 
group postambles {
 
/**
* @desc Sets variables and default initialization for user profile and handle deregistration
* @param p_cSeq_s cseq parameter
* @desc Terminates component and handles deregistration
* @param p_cSeq_s The current cseq
*/
function f_IMS_postamble_withDeRegistration(
CSeq p_CSeq
1630,8 → 1597,8
}
 
/**
* @desc Sets variables and default initialization for user profile and handle deregistration on AS as TS
* @param p_cSeq_s cseq parameter
* @desc Terminates component and optionally handles deregistration on AS as TS
* @param p_deRegistration Handle deregistration?
*/
function f_IMS_postamble_AS_withDeRegistration(
boolean p_deRegistration
1643,16 → 1610,25
f_terminate_component();
}
 
/**
* @desc Terminates component without registration
*/
function f_SIP_postamble_IMS1_withoutRegistration(
) runs on ImsComponent {
f_terminate_component();
}
 
/**
* @desc Terminates component without de-registration
*/
function f_IMS_postamble_withoutDeRegistration(
) runs on ImsComponent {
f_terminate_component();
}
 
/**
* @desc Terminates component with de-registration
*/
function f_SIP_postamble_IMS1_awaitDeRegistration(
) runs on ImsComponent {
var SipUrl v_passociated_url;
1663,11 → 1639,9
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, valueof(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))));
f_awaitingREGISTER(mw_REGISTER_unauthorizedRequest_IMS);
// 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));
 
1674,6 → 1648,9
f_terminate_component();
}
 
/**
* @desc Terminates component with de-registration
*/
function f_IMS_postamble_awaitDeRegistration(
) runs on ImsComponent {
var SipUrl v_passociated_url;
1684,10 → 1661,9
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, valueof(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_unauthorizedRequest_IMS);
// 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));
 
1695,6 → 1671,9
}
 
 
/**
* @desc Awaits de-registration
*/
function f_IMS_awaitDeRegistration(
) runs on ImsComponent {
var SipUrl v_passociated_url;
1705,19 → 1684,24
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, valueof(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_unauthorizedRequest_IMS);
// 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));
}
 
/**
* @desc Terminates component without registration
*/
function f_SIP_postamble_UE1_withoutRegistration(
) runs on ImsComponent {
f_terminate_component();
}
 
/**
* @desc Terminates component without registration
*/
function f_SIP_postamble_UE2_withoutRegistration(
) runs on ImsComponent {
f_terminate_component();
1724,12 → 1708,12
}
 
/**
* @desc sends BYE and awaits response
* @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
* @desc Sends BYE and awaits response (IMS)
* @param p_requestUri The Request URI
* @param p_CallId CallId parameter for outgoing BYE
* @param p_cSeq CSeq parameter for outgoing BYE
* @param p_from From parameter for outgoing BYE
* @param p_to To parameter for outgoing BYE
*/
function f_terminateCall_IMS(
SipUrl p_requestUri,
1752,16 → 1736,16
}
// timeout should be handled in default_alt_step
}
} // end function f_terminateCall
} // end function f_terminateCall_IMS
 
 
/**
* @desc sends BYE and awaits response
* @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
* @desc Sends BYE and awaits response (UE)
* @param p_requestUri The Request URI
* @param p_CallId CallId parameter for outgoing BYE
* @param p_cSeq CSeq parameter for outgoing BYE
* @param p_from From parameter for outgoing BYE
* @param p_to To parameter for outgoing BYE
* @param p_recordRoute RecordRoute parameter for outgoing BYE - default: omit
*/
function f_terminateCall_UE(
SipUrl p_requestUri,
1793,14 → 1777,13
}
} // end function f_terminateCall_UE
 
 
/**
* @desc sends BYE and awaits response and De-registration
* @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
* @desc Sends BYE and awaits response and De-registration
* @param p_requestUri The Request URI
* @param p_CallId CallId parameter for outgoing BYE
* @param p_cSeq CSeq parameter for outgoing BYE
* @param p_from From parameter for outgoing BYE
* @param p_to To parameter for outgoing BYE
*/
function f_terminateCall_UE_withDeReg(
SipUrl p_requestUri,
1825,12 → 1808,15
}
action("Please de-register");
f_IMS_awaitDeRegistration();
// f_terminate_component();
} // end function f_terminateCall_UE_withDeReg
 
}
group defaults {
 
/**
* @desc Altstep for clearing registration (IMS user)
* @verdict fail for all unexpected branches
*/
altstep a_clearRegistration_IMSuser(
) runs on ImsComponent {
var Response v_response;
1905,8 → 1891,6
[] SIPP.receive(mw_SUBSCRIBE_Request_Base) -> value v_request sender vc_sent_label {
f_setHeadersOnReceiptOfRequest(v_request);
f_sendResponse(m_Response_Contact(c_statusLine200, vc_callId, vc_cSeq, vc_callee_From, vc_callee_To, vc_via, vc_contact));
// f_setHeadersGeneral(vc_cSeq, "NOTIFY"); // cseq, contact, branch, via
// f_SendNOTIFY(m_NOTIFY_Request_contact(vc_requestUri, vc_callId, vc_cSeq, vc_from, vc_to, vc_via, vc_contact));
log(v_request.msgHeader.contact.contactBody.contactAddresses[0].addressField.nameAddr.addrSpec);
f_SendNOTIFY(m_NOTIFY_Request_contact(v_request.msgHeader.contact.contactBody.contactAddresses[0].addressField.nameAddr.addrSpec, vc_callId, vc_cSeq, vc_callee_From, vc_callee_To, vc_via, vc_contact));
f_awaitingOkResponse(vc_cSeq);
1962,8 → 1946,6
[] SIPP.receive {
setverdict(fail);
all timer.stop;
// f_setHeadersCANCEL(vc_cSeq);
// f_SendCANCEL(m_CANCEL_Request_Base(vc_requestUri, vc_callId, vc_cSeq, vc_from, vc_cancel_To, vc_via )); // difference between registration state or transaction state
action("Please de-register");
f_IMS_awaitDeRegistration();
f_componentStop();
1971,7 → 1953,7
}
 
/**
* @desc main default altstep to handle unexpected messages and timeout
* @desc Main default altstep to handle unexpected messages and timeout
* @verdict fail for all unexpected branches
*/
altstep a_altstep_AS(