Newer
Older
} // end of f_awaitingUPDATE_sendReply
/**
* @desc await REFER request
*/
function f_awaitingREFER(in template REFER_Request p_MSG) runs on SipComponent
{
var REFER_Request v_MSG;
tc_resp.start(PX_SIP_TRESP);
alt
{
[] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label
{
tc_resp.stop;
f_setHeadersOnReceiptOfRequest(v_MSG);
}
}
} // end of f_awaitingUPDATE
} // end AwaitingMessage
group SendMessage {
/**
*
* @desc send ACK message, update the route and recordRoute header fields depending on boolean flags
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
* @param p_request template of the message to be sent
*/
function f_SendACK(template ACK_Request p_request) runs on SipComponent
{
p_request.msgHeader.route := f_route(); // update the route header field depending on vc_boo_route
// n/a p_request.msgHeader.recordRoute := f_recordroute(); // update the route header field depending on vc_boo_route
SIPP.send(p_request) to vc_sent_label;
}
/**
*
* @desc send BYE message, update the route and recordRoute header fields depending on boolean flags
* @param p_request template of the message to be sent
*/
function f_SendBYE(template BYE_Request p_request) runs on SipComponent
{
SIPP.send(p_request) to vc_sent_label;
}
/**
*
* @desc send CANCEL message
* @param p_request template of the message to be sent
*/
function f_SendCANCEL(template CANCEL_Request p_request) runs on SipComponent
{
SIPP.send(p_request) to vc_sent_label;
}
/**
*
* @desc send INFO message
* @param p_request template of the message to be sent
*/
function f_SendINFO(template INFO_Request p_request) runs on SipComponent
{
f_setHeadersGeneral(vc_cSeq, "INFO"); // cseq, contact, branch, via
SIPP.send(p_request) to vc_sent_label;
}
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
/**
*
* @desc send INVITE message
* @param p_request template of the message to be sent
*/
function f_SendINVITE(template INVITE_Request p_request) runs on SipComponent
{
vc_requestFor407 := valueof(p_request);
SIPP.send(p_request) to vc_sent_label;
if(PX_SIP_INVITE_AUTHENTICATION_ENABLED) {a_altstep_401or407();};
}
/**
*
* @desc send PRACK message
* @param p_request template of the message to be sent
*/
function f_SendPRACK(template PRACK_Request p_request) runs on SipComponent
{
f_setHeadersGeneral(vc_cSeq, "PRACK"); // cseq, contact, branch, via
vc_rAck := valueof(m_RAck(vc_response.msgHeader.rSeq.responseNum, vc_cSeq.seqNumber, vc_cSeq.method));
SIPP.send(p_request) to vc_sent_label;
}
/**
*
* @desc send PUBLISH message
* @param p_request template of the message to be sent
*/
function f_SendPUBLISH(template PUBLISH_Request p_request) runs on SipComponent
{
SIPP.send(p_request) to vc_sent_label;
}
/**
*
* @desc send REGISTER message
* @param p_request template of the message to be sent
*/
function f_SendREGISTER(template REGISTER_Request p_request) runs on SipComponent
{
SIPP.send(p_request) to vc_sent_label;
}
/**
*
* @desc send SUBSCRIBE message
* @param p_request template of the message to be sent
*/
function f_SendSUBSCRIBE(template SUBSCRIBE_Request p_request) runs on SipComponent
{
SIPP.send(p_request) to vc_sent_label;
}
/**
*
* @desc send UPDATE message
* @param p_request template of the message to be sent
*/
function f_SendUPDATE(template UPDATE_Request p_request) runs on SipComponent
{
f_setHeadersGeneral(vc_cSeq, "UPDATE"); // cseq, contact, branch, via
SIPP.send(p_request) to vc_sent_label;
if(PX_SIP_INVITE_AUTHENTICATION_ENABLED) {a_altstep_401or407();};
*
* @desc function send MESSAGE message
* @param p_request template of the message to be sent
*/
function f_SendMESSAGE(template MESSAGE_Request p_request) runs on SipComponent
{
SIPP.send(p_request) to vc_sent_label;
}
/**
*
* @desc function send NOTIFY message
* @param p_request template of the notify to be sent
*/
function f_SendNOTIFY(template NOTIFY_Request p_request) runs on SipComponent
{
SIPP.send(p_request) to vc_sent_label;
}
/**
*
* @desc send REFER message
* @param p_request template of the message to be sent
*/
function f_SendREFER(template REFER_Request p_request) runs on SipComponent
{
SIPP.send(p_request) to vc_sent_label;
}
/**
*
* @desc send 200 OK
*/
function f_send200OK() runs on SipComponent
{
f_sendResponse(m_Response_Base(c_statusLine200, vc_callId, vc_cSeq, vc_caller_From, vc_caller_To, vc_via));
}
/**
*
* @desc send response
* @param p_request template of the message to be sent
*/
function f_sendResponse(template Response p_response) runs on SipComponent
{
//p_response.msgHeader.route := f_route(); // update the route header field depending on vc_boo_route//TODO check if route header is needed in responses
p_response.msgHeader.recordRoute := f_recordroute(); // update the route header field depending on vc_boo_route
SIPP.send(p_response) to vc_sent_label;
}
} // end SendMessage
group GlobalSteps {
/**
* @desc component initialization
* @param p_cSeq_s cSeq value to be assigned to the component variable
*/
function f_init_component(inout CSeq p_cSeq_s) runs on SipComponent
{
//Variables
vc_cSeq := p_cSeq_s;
//Defaults
vc_def_catchSyncStop := activate(a_Sip_catchSyncStop());
vc_default := activate (a_clearRegistration());
}
/**
* @desc component termination
*/
function f_terminate_component() runs on SipComponent
{
deactivate;
stop;
}
/**
*
* @desc component termination
*/
function f_componentStop() runs on SipComponent
{
syncPort.send(m_syncClientStop);
SIPP.clear;
stop;
}
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
/**
*
* @desc setting of user parameters with PIXIT values
* @param p_user identifies the selected user configuration and location
*/
function f_init_userprofile(in integer p_user) runs on SipComponent
{
vc_userprofile.id := p_user;
select(p_user){
case (c_userProfile_SIP1_home) { //variant c_userProfile_SIP1_home
vc_userprofile.currPort := PX_SIP_TS1_PORT;
vc_userprofile.currIpaddr := PX_SIP_TS1_IPADDR;
vc_userprofile.contactPort := PX_SIP_TS1_PORT;
vc_userprofile.contactIpaddr := PX_SIP_TS1_IPADDR;
vc_userprofile.bearerIpaddr := PX_SIP_TS1_BEARER_IPADDR;
vc_userprofile.homeDomain := PX_SIP_TS1_LOCAL_DOMAIN;
vc_userprofile.publUsername := PX_SIP_TS1_LOCAL_USER;
vc_userprofile.qop := PX_SIP_SUT_UE1_QOP;
vc_userprofile.privUsername := PX_SIP_SUT_UE1_USERNAME;
vc_userprofile.passwd := PX_SIP_SUT_UE1_PASSWD;
vc_userprofile.registrarDomain := PX_SIP_SUT_REGISTRAR_DOMAIN;
}
case (c_userProfile_SIP2_home) { //variant c_userProfile_SIP2_home
vc_userprofile.currPort := PX_SIP_TS2_PORT;
vc_userprofile.currIpaddr := PX_SIP_TS2_IPADDR;
vc_userprofile.contactPort := PX_SIP_TS2_PORT;
vc_userprofile.contactIpaddr := PX_SIP_TS2_IPADDR;
vc_userprofile.bearerIpaddr := PX_SIP_TS2_BEARER_IPADDR;
vc_userprofile.homeDomain := PX_SIP_TS2_LOCAL_DOMAIN;
vc_userprofile.publUsername := PX_SIP_TS2_LOCAL_USER;
vc_userprofile.qop := PX_SIP_SUT_UE2_QOP;
vc_userprofile.privUsername := PX_SIP_SUT_UE2_USERNAME;
vc_userprofile.passwd := PX_SIP_SUT_UE2_PASSWD;
vc_userprofile.registrarDomain := PX_SIP_SUT_REGISTRAR_DOMAIN;
}
}
}
/**
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
* @desc function waits for particular time that allows the SUT to return to idle state
*/
function f_awaitSUTidle() runs on SipComponent
{
vc_ignore4xx := true; // allow 4xx in default
tc_noAct.start;
alt {
[] tc_noAct.timeout{}
}
}
/**
*
* @desc function waits for particular time before next expected message
*/
function f_wait(float p_time) runs on SipComponent
{
tc_noAct.start(p_time);
alt {
[] tc_noAct.timeout{}
}
}
/**
*
* @desc function cause termination of a PTC
* @param p_syncPoint dummy parameter (copied from the common lib)
*/
function f_check2Null(in charstring p_syncPoint) runs on SipComponent
{
//!= pass does not work, because in case of "none" execution shall continue
if (getverdict == inconc or getverdict == fail){
log("**** f_check2Null: Verdict evaluated to fail or inconc. Stopping test execution now ");
f_selfOrClientSyncAndVerdict (p_syncPoint, e_error) ;
}//end if
}
rennoch
committed
/*
rennoch
committed
* @desc original copied from older LibCommon_VerdictControl
*/
function f_getVerdict()
return FncRetCode {
var FncRetCode v_ret := e_error;
if (getverdict == pass or getverdict == none) {
v_ret := e_success;
}
return v_ret;
}
}// end group GlobalSteps
group Registration {
/**
*
* @desc registration and authentication with MD5
* @param p_cSeq_s cseq parameter
* @param p_register register template
* @param p_auth flag indicating if authentication is needed
*/
function f_Registration(inout CSeq p_cSeq_s, out template REGISTER_Request p_register, in boolean p_auth) runs on SipComponent
{
if (PX_SIP_REGISTRATION)
{
f_setHeaders_REGISTER(p_cSeq_s);
p_register := m_REGISTER_Request_Base(vc_requestUri, vc_callId, p_cSeq_s, vc_from, vc_to, vc_via_REG, vc_contact, vc_authorization);
f_SendREGISTER(p_register); //LibSip
//awaiting of 401 and sending 2nd REGISTER and awaiting 200 OK REGISTER
if (p_auth)
{
// 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_callId, p_cSeq_s)) -> value vc_response
{
tc_ack.stop;
f_setHeadersOnReceiptOfResponse(p_cSeq_s, vc_response);
// set headers via, cseq and authorization
f_setHeaders_2ndREGISTER(p_cSeq_s);
p_register := m_REGISTER_Request_Base(vc_requestUri, vc_callId, p_cSeq_s, vc_from, vc_to, vc_via_REG, vc_contact, vc_authorization);
// Re-send protected REGISTER
f_SendREGISTER(p_register);//LibSip
// awaiting 200 OK REGISTER
f_awaitingOkResponse(p_cSeq_s);
f_getServiceRouteMapIntoRouteInRegistration(p_cSeq_s, vc_response);
}
[] SIPP.receive (mw_Response_Base(c_statusLine200, vc_callId, p_cSeq_s)) -> value vc_response
f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response);
f_getServiceRouteMapIntoRouteInRegistration(p_cSeq_s, vc_response);
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
log ("Authorization was not requested as expected");
}
}
}
else
{
f_awaitingOkResponse(p_cSeq_s);
f_getServiceRouteMapIntoRouteInRegistration(p_cSeq_s, vc_response);
}
};
}//end function f_Registration
/**
*
* @desc remove registration
* @param p_cSeq_s cseq parameter
*/
function f_RemoveRegistration(inout CSeq p_cSeq) runs on SipComponent
{
var CommaParam_List v_challenge;
var Credentials v_credentials;
//
if(vc_DeregDone)
{
f_componentStop();
}
else {vc_DeregDone := true;}
if (PX_SIP_REGISTRATION)
{
f_setHeaders_deREGISTER(p_cSeq);
v_request := m_REGISTER_Request_expires(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(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
/**
*
* @desc remove registration without authorization
* @param p_cSeq_s cseq parameter
*/
function f_RemoveRegistration_wo_authorization(inout CSeq p_cSeq) runs on SipComponent
{
var SemicolonParam_List tmp_params;
if (PX_SIP_REGISTRATION)
{
f_setHeaders_deREGISTER(p_cSeq);
f_SendREGISTER(m_REGISTER_Request_expires(vc_requestUri, vc_callIdReg, p_cSeq,
vc_from, vc_to, vc_via, vc_contact, vc_authorization, "0" ));
f_awaitingResponse(mw_Response_Base(c_statusLine200, vc_callIdReg, p_cSeq));
}
} // end f_RemoveRegistration_wo_authorization
}//end group Registration
group Subscription {
/**
*
* @desc UE send subscrbe, await on 200 OK, await notify and send 200 OK
* @param p_cSeq_s cseq parameter
* @param p_register subscribe template
*/
function f_Subscription(inout CSeq p_cSeq_s,template SUBSCRIBE_Request p_subscribe) runs on SipComponent
//f_setHeaders_SUBSCRIBE(p_cSeq_s);
//send SUBSCRIBE
f_SendSUBSCRIBE(p_subscribe);
// awaiting 200 OK SUBSCRIBE
f_awaitingOkResponse(p_cSeq_s);
//await NOTIFY and send reply 200 OK
f_awaitingNOTIFY_sendReply(mw_NOTIFY_Request_Base(vc_callId));
}//end function f_Subscription
/**
*
* @desc UE send subscrbe, await on 200 OK, await notify and send 200 OK
* @param p_cSeq_s cseq parameter
* @param p_register subscribe template
*/
function f_SubscriptionWithNotification(inout CSeq p_cSeq_s, template SUBSCRIBE_Request p_subscribe, template NOTIFY_Request p_notify) runs on SipComponent
{
f_setHeaders_SUBSCRIBE(p_cSeq_s);
//send SUBSCRIBE
f_SendSUBSCRIBE(p_subscribe);
// awaiting 200 OK SUBSCRIBE
f_awaitingOkResponse(p_cSeq_s);
//await NOTIFY and send reply 200 OK
f_awaitingNOTIFY_sendReply(p_notify);
}//end function f_Subscription
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
}//end group Subscription
group Preambles {
/**
*
* @desc Set variables and default initialization for user profile
* @param p_userprofile user profile of call
* @param p_cSeq_s cseq parameter
*/
function f_SIP_preamble_woREG(in integer p_userprofile, inout CSeq p_cSeq_s) runs on SipComponent
{
//varables and altsteps
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));
}
/**
*
* @desc Set 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_SIP_preamble_withREG(in integer p_userprofile, inout CSeq p_cSeq_s, template REGISTER_Request p_register) runs on SipComponent
{
//preamble
f_SIP_preamble_woREG(p_userprofile, p_cSeq_s);
//Registration, Awaiting
f_Registration(p_cSeq_s, p_register, PX_SIP_REGISTER_AUTHENTICATION_ENABLED);
}
}// end group Preambles
group Postambles {
/**
*
* @desc function send BYE and awaits reponse
* @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
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
* @param p_reqHostPort parameter for outgoing BYE
*/
function f_terminateCall(SipUrl p_requestUri, CallId p_CallId, inout CSeq p_cSeq, From p_from,
template To p_to) runs on SipComponent
{
// Sending of a BYE request to release the call and expect a final response
f_SendBYE(m_BYE_Request_cause(p_requestUri, p_CallId, p_cSeq, p_from, valueof(p_to), vc_via, PX_SIP_BYE_CAUSE));
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;
}
}
} // end function f_terminateCall
function f_cancelCall(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_setHeadersCANCEL(vc_cSeq);
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
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;
}
}
}
} // 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
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
/*
* @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
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
/*
* @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
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
/*
* @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
}
// allow 100 replies
[] SIPP.receive(mw_Response_Base(c_statusLine100,vc_callId, vc_cSeq))
{
repeat
}
// ignore 181 if flag is set (following TS 183004 §4.5.2.1)
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
[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, 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 subscribe on proxy
[] SIPP.receive(mw_SUBSCRIBE_Request_Base)->value v_request sender vc_sent_label
{
f_setHeadersOnReceiptOfRequest(v_request);
f_send200OK();
f_setHeadersGeneral(vc_cSeq, "NOTIFY"); // cseq, contact, branch, via
f_SendNOTIFY(m_NOTIFY_Request_Base(vc_requestUri, vc_callId, vc_cSeq, vc_from, vc_to, vc_via));
f_awaitingOkResponse(vc_cSeq);
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);
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);
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);
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
* @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_ack.start (PX_SIP_TACK);
alt {
[] SIPP.receive (mw_Response_Base((c_statusLine401,c_statusLine407),
vc_callId,
vc_cSeq)) -> value v_Response {
tc_ack.stop;
// 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};