Newer
Older
f_SendCANCEL(p_request);
tc_resp.start(PX_SIP_TRESP);
alt
{
[] SIPP.receive (mw_Response_Base(c_statusLine200, vc_callId, vc_cSeq))
{
tc_resp.stop;
}
}
}
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
function f_cancelCall_await487(template CANCEL_Request p_request)
runs on SipComponent
{
// This function is called to bring back the IUT in idle condition
// in case of errors or unexpected behaviour.
// Sending of a CANCEL request with the same Cseq
f_cancelCall(p_request);
// set method on INVITE
vc_cSeq.method := "INVITE";
//await on 487 response and send ACK
f_awaitingResponse(mw_Response_Base(c_statusLine487, vc_callId, vc_cSeq));
f_SendACK(m_ACK_Request_Base(vc_requestUri, vc_callId, vc_cSeq, vc_from, vc_to, vc_via));
}
function f_awaitCancelCall_send487(template CANCEL_Request p_request)
runs on SipComponent
{
f_awaitingCANCEL(p_request);
f_sendResponse(m_Response_Base(c_statusLine200, vc_callId, vc_cSeq,vc_caller_From, vc_caller_To, vc_via));
// set method on INVITE
vc_cSeq.method := "INVITE";
//send 487 response and await ACK
f_sendResponse(m_Response_Base(c_statusLine487, vc_callId, vc_cSeq,vc_caller_From, vc_caller_To, vc_via));
// await ACK
f_awaitingACK(mw_ACK_Request_Base(vc_callId));
}
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
} // end group Postambles
group SipChecks
{
/*
* @desc check the presence of conversation at SIP side
*
*/
function f_check_Conversation() runs on SipComponent
{
var boolean v_result;
var charstring v_question := "confirm if conversation at SIP port";
if (PX_SIP_CheckConversation) {
opPort.call(s_SIP_conversation:{v_question, -})
{[] opPort.getreply(s_SIP_conversation:{-, true}) {}
[] opPort.getreply(s_SIP_conversation:{-, false})
{all timer.stop;
setverdict(fail);
syncPort.send(m_syncClientStop);
stop;}
}
}
f_selfOrClientSyncAndVerdict(c_uPlane, f_getVerdict()); // Note: implemented in test bodies
return
} // end of f_check_Conversation
/*
* @desc check the presence of conversation at SIP side
*
*/
function f_check_Ringing() runs on SipComponent
{
var boolean v_result;
var charstring v_question := "confirm if ringing at SIP port";
if (PX_SIP_CheckRinging) {
opPort.call(s_SIP_ringing:{v_question, -})
{[] opPort.getreply(s_SIP_ringing:{-, true}) {}
[] opPort.getreply(s_SIP_ringing:{-, false})
{all timer.stop;
setverdict(fail);
syncPort.send(m_syncClientStop);
stop;}
}
}
f_selfOrClientSyncAndVerdict(c_Ringing, f_getVerdict());
return
} // end of f_check_Ringing
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
/*
* @desc check the announcement at SIP side (UE A)
*
*/
function f_check_AnnouncementUE_A() runs on SipComponent
{
var boolean v_result;
var charstring v_question := "confirm if announcement at UE A";
if (PX_SIP_CheckConversation) {
opPort.call(s_SIP_announcementA:{v_question, -})
{[] opPort.getreply(s_SIP_announcementA:{-, true}) {}
[] opPort.getreply(s_SIP_announcementA:{-, false})
{all timer.stop;
setverdict(fail);
syncPort.send(m_syncClientStop);
stop;}
}
}
f_selfOrClientSyncAndVerdict(c_annoucA, f_getVerdict());
return
} // end of f_check_AnnouncementUE_A
/*
* @desc check the announcement at SIP side (UE B)
*
*/
function f_check_AnnouncementUE_B() runs on SipComponent
{
var boolean v_result;
var charstring v_question := "confirm if announcement at UE B";
if (PX_SIP_CheckConversation) {
opPort.call(s_SIP_announcementB:{v_question, -})
{[] opPort.getreply(s_SIP_announcementB:{-, true}) {}
[] opPort.getreply(s_SIP_announcementB:{-, false})
{all timer.stop;
setverdict(fail);
syncPort.send(m_syncClientStop);
stop;}
}
}
f_selfOrClientSyncAndVerdict(c_annoucB, f_getVerdict());
return
} // end of f_check_AnnouncementUE_B
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
/*
* @desc check the announcement at SIP side
*
*/
function f_check_Announcement() runs on SipComponent
{
var boolean v_result;
var charstring v_question := "confirm if announcement at SIP side";
if (PX_SIP_CheckConversation) {
opPort.call(s_SIP_announcement:{v_question, -})
{[] opPort.getreply(s_SIP_announcement:{-, true}) {}
[] opPort.getreply(s_SIP_announcement:{-, false})
{all timer.stop;
setverdict(fail);
syncPort.send(m_syncClientStop);
stop;}
}
}
f_selfOrClientSyncAndVerdict(c_annouc, f_getVerdict());
return
} // end of f_check_Announcement
/*
* @desc check the Voice message at SIP side
*
*/
function f_check_VoiceMessage() runs on SipComponent
{
var boolean v_result;
var charstring v_question := "confirm if voice message at SIP side";
if (PX_SIP_CheckConversation) {
opPort.call(s_SIP_voiceMessage:{v_question, -})
{[] opPort.getreply(s_SIP_voiceMessage:{-, true}) {}
[] opPort.getreply(s_SIP_voiceMessage:{-, false})
{all timer.stop;
setverdict(fail);
syncPort.send(m_syncClientStop);
stop;}
}
}
f_selfOrClientSyncAndVerdict(c_voicem, f_getVerdict());
return
} // end of f_check_Announcement
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
/*
* @desc check the stop of media stream
*
*/
function f_check_MediaStopped() runs on SipComponent
{
var boolean v_result;
var charstring v_question := "confirm if media stream stopped";
if (PX_SIP_CheckConversation) {
opPort.call(s_SIP_mediastopped:{v_question, -})
{[] opPort.getreply(s_SIP_mediastopped:{-, true}) {}
[] opPort.getreply(s_SIP_mediastopped:{-, false})
{all timer.stop;
setverdict(fail);
syncPort.send(m_syncClientStop);
stop;}
}
}
f_selfOrClientSyncAndVerdict(c_uPlaneStop, f_getVerdict());
return
} // end of f_check_MediaStopped
}
group DefaultsTestStep
{
/**
* @desc This default handles receiving of the sync server
* STOP message and calls the RT HUT postamble. (copy from common lib)
*/
altstep a_Sip_catchSyncStop() runs on SipComponent
{
[] syncPort.receive(m_syncServerStop)
{
tc_sync.stop ;
log("**** a_Sip_catchSyncStop: Test component received STOP signal from MTC - going to IDLE state **** ");
//TODO complete postamble
syncPort.send(m_syncClientStop);
//in case if deregistration was not done
//f_RemoveRegistration(vc_cSeq);
f_terminate_component();
log("**** a_Sip_catchSyncStop: TEST COMPONENT NOW STOPPING ITSELF! **** ") ;
setverdict(inconc);
stop ;
}
}
/**
*
* @desc main default altstep to handle unexpected messages and timeout
* @verdict fail for all unexpected branches
*/
altstep a_clearRegistration() runs on SipComponent
{
var Response v_response;
var Request v_request;
[] any timer.timeout
{
setverdict(fail);
all timer.stop;
//TODO check how to solve release of call
//f_SendCANCEL(m_CANCEL_Request(vc_callId, vc_cSeq, vc_from, vc_cancel_To, vc_reqHostPort, vc_via )); // difference between registration state or transaction state
f_RemoveRegistration(vc_cSeq);
}
// allow repeated INVITEs
[vc_ignore_invite] SIPP.receive(mw_INVITE_Request_Base)
{
repeat
}
// allow repeated BYEs after ack of the first BYE
[vc_ignore_bye] SIPP.receive (mw_BYE_Request_Base(?))
{
repeat
}
[] SIPP.receive (mw_ACK_Request_Base(?))
{
repeat
}
[] SIPP.receive(mw_Response_Base(c_statusLine100,?, ?))
{
repeat
}
// ignore 181 if flag is set (following TS 183004 §4.5.2.1)
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
[vc_ignore181] SIPP.receive(mw_Response_Base(c_statusLine181,vc_callId, vc_cSeq))-> value v_response sender vc_sent_label
{
f_setHeadersOnReceiptOfResponse(v_response.msgHeader.cSeq, v_response);
repeat;
}
// according to SIP chap.8.1.3.2
[] SIPP.receive(mw_Response_Base(c_statusLine183,vc_callId, vc_cSeq))
{
repeat;
}
// ignore 484 if flag is set
[vc_ignore484] SIPP.receive(mw_Response_Base(c_statusLine484,vc_callId, vc_cSeq))
{
repeat
}
[vc_ignore4xx] SIPP.receive(mw_Response_Base(mw_statusLine4xx,vc_callId, ?))-> value v_response sender vc_sent_label
{
f_setHeadersOnReceiptOfResponse(v_response.msgHeader.cSeq, v_response);
f_SendACK(m_ACK_Request_route(vc_requestUri, vc_callId, v_response.msgHeader.cSeq, vc_from, vc_to, vc_via, valueof(vc_route)));
repeat
}
[vc_ignore200OKinv] SIPP.receive(mw_Response_Base(c_statusLine200, vc_callId, ?))
{
repeat
}
[] SIPP.receive(mw_INFO_Request_Base(vc_callId))->value v_request sender vc_sent_label
{
f_setHeadersOnReceiptOfRequest(v_request);
f_send200OK();
repeat
}
// awaiting of Notify
[] SIPP.receive(mw_NOTIFY_Request_Base(vc_callId))->value v_request sender vc_sent_label
{
f_setHeadersOnReceiptOfRequest(v_request);
f_send200OK();
repeat
}
// awaiting of subscribe from UE
[vc_ignore_subscribe] SIPP.receive(mw_SUBSCRIBE_Request_Base)-> value v_request sender vc_sent_label
{
f_setHeadersOnReceiptOfSUBSCRIBE(v_request);
f_send200OK();
repeat;
}
//awaiting of subscribe on proxy
[] 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);
repeat
}
//awaiting of PRACK message
[] SIPP.receive(mw_PRACK_Request_Base(vc_callId))->value v_request sender vc_sent_label
{
f_setHeadersOnReceiptOfRequest(v_request);
f_send200OK();
repeat
}
// unexpected BYE is acknowledged to avoid retransmissions
[] SIPP.receive(mw_BYE_Request_Base(?))-> value v_request sender vc_sent_label
{
setverdict(fail);
f_setHeadersOnReceiptOfRequest(v_request);
f_send200OK();
f_RemoveRegistration(vc_cSeq);
}
// unexpected CANCEL is acknowledged to avoid retransmissions
[] SIPP.receive(mw_CANCEL_Request_Base(?))-> value v_request sender vc_sent_label
{
setverdict(fail);
f_setHeadersOnReceiptOfRequest(v_request);
//Answer to the CANCEL
f_send200OK();
f_RemoveRegistration(vc_cSeq);
}
// catch 4xx response
[] SIPP.receive(mw_Response_Base(mw_statusLine4xx, vc_callId, ?))-> value v_response sender vc_sent_label
{
setverdict(fail);
f_setHeadersOnReceiptOfResponse(v_response.msgHeader.cSeq, v_response);
LibSip_Steps.f_setHeadersACK();
f_SendACK(m_ACK_Request_route(vc_requestUri, vc_callId, v_response.msgHeader.cSeq, vc_from, vc_to, vc_via, vc_route));
f_RemoveRegistration(vc_cSeq);
}
// catch 5xx response
[] SIPP.receive(mw_Response_Base(mw_statusLine5xx, vc_callId, ?))-> value v_response sender vc_sent_label
{
setverdict(fail);
f_setHeadersOnReceiptOfResponse(v_response.msgHeader.cSeq, v_response);
LibSip_Steps.f_setHeadersACK();
f_SendACK(m_ACK_Request_route(vc_requestUri, vc_callId, v_response.msgHeader.cSeq, vc_from, vc_to, vc_via, vc_route));
f_RemoveRegistration(vc_cSeq);
// catch invalid REGISTER
[] SIPP.receive(mw_REGISTER_Request_Base)-> value v_request sender vc_sent_label
{
setverdict(fail);
f_componentStop();
}
// any
[] 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
f_RemoveRegistration(vc_cSeq);
* @desc altstep handle authentication for INVITE message
*/
altstep a_altstep_401or407() runs on SipComponent {
[] any port.check (receive) {
var CommaParam_List v_challenge;
var Credentials v_Credentials;
var Response v_Response;
var Request v_Request := valueof (vc_requestFor407);
tc_resp.start (PX_SIP_TRESP);
alt {
[] SIPP.receive (mw_Response_Base((c_statusLine401,c_statusLine407),
vc_callId,
vc_cSeq)) -> value v_Response {
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
// get tag from To header if available
vc_to := v_Response.msgHeader.toField;
if (vc_cSeq.method == "INVITE"){
// send ACK
f_SendACK(m_ACK_Request_Base(vc_requestUri, vc_callId, vc_cSeq, vc_from, vc_to, vc_via));
}
// resent the INVITE message with Proxyauthorization header include
// Extract challenge and calculate credentials for a response.
if (ischosen (v_Response
.msgHeader
.proxyAuthenticate
.challenge
.otherChallenge // instead of digestCln (changed by axr to comply to alcatel)
)) {
v_challenge :=
v_Response
.msgHeader
.proxyAuthenticate
.challenge
.otherChallenge.authParams;
v_Credentials :=
f_calculatecCredentials(vc_userprofile,
vc_requestFor407.msgHeader.cSeq.method,
v_challenge);
} else {
log ("No scheme in Proxy Authenticate header!!");
setverdict (inconc);
stop;
}
vc_branch := c_branchCookie & f_getRndTag();
vc_via := {
fieldName := VIA_E,
viaBody := {
valueof (m_ViaBody_currIpaddr(vc_branch, vc_userprofile))}
};
v_Request.msgHeader.via := vc_via;
// Increment CSeq sequence number of and add the credentials
// to the original saved INVITE message.
vc_cSeq.method := vc_requestFor407.msgHeader.cSeq.method;
vc_cSeq.seqNumber := vc_cSeq.seqNumber + 1;
v_Request.msgHeader.cSeq.seqNumber :=
vc_cSeq.seqNumber;
v_Request.msgHeader.proxyAuthorization.fieldName :=
PROXY_AUTHORIZATION_E;
v_Request.msgHeader.proxyAuthorization.credentials :=
{v_Credentials};
// Re-send the saved INVITE with Authorization header
// included.
SIPP.send (v_Request) to vc_sent_label;
}
}
}
}
} // end of group DefaultsTestStep
} // end module LibSip_Steps