Rev

Rev 605 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | SVN | Bug Tracker

Rev 605 Rev 607
1
/*
1
/*
2
 *  @author     STF 346, STF366, STF368, STF369, STF450, STF471
2
 *  @author     STF 346, STF366, STF368, STF369, STF450, STF471
3
 *  @version    $Id: LibSip_Interface.ttcn 605 2014-02-27 10:42:56Z nikolajev $
3
 *  @version    $Id: LibSip_Interface.ttcn 607 2014-02-27 17:24:26Z nikolajev $
4
 *  @desc        This module provides the types used by the test component
4
 *  @desc        This module provides the types used by the test component
5
 *              for SIP-IMS tests. Module become from STF306 and STF334-336
5
 *              for SIP-IMS tests. Module become from STF306 and STF334-336
6
 *              This module is part of LibSipV3.
6
 *              This module is part of LibSipV3.
7
 */
7
 */
8
module LibSip_Interface {
8
module LibSip_Interface {
9
    // LibCommon
9
    // LibCommon
10
    import from LibCommon_Sync all;
10
    import from LibCommon_Sync all;
11
    import from LibCommon_AbstractData all;
11
    import from LibCommon_AbstractData all;
12
    import from LibCommon_BasicTypesAndValues all;
12
    import from LibCommon_BasicTypesAndValues all;
13
    import from LibCommon_DataStrings all;
13
    import from LibCommon_DataStrings all;
14
    // LibSip
14
    // LibSip
15
    import from LibSip_SIPTypesAndValues all;
15
    import from LibSip_SIPTypesAndValues all;
16
    import from LibSip_SDPTypes all;
16
    import from LibSip_SDPTypes all;
17
    import from LibSip_XMLTypes all;
17
    import from LibSip_XMLTypes all;
18
18
19
    import from LibSip_PIXITS all;
19
    import from LibSip_PIXITS all;
20
20
21
    group AdressTypes {
21
    group AdressTypes {
22
        type record address4SIP {
22
        type record Address4SIP {
23
            // HostPort
23
            // HostPort
24
            charstring host optional,
24
            charstring host optional,
25
            // hostname, IPv4 or IPv6
25
            // hostname, IPv4 or IPv6
26
            integer portField
26
            integer portField
27
             optional // represented as an integer
27
             optional // represented as an integer
28
        }
28
        }
29
        with {
29
        with {
30
            encode "SIPCodec";
30
            encode "SIPCodec";
31
        }
31
        }
32
32
33
        type address4SIP address;
33
        type Address4SIP address;
34
34
35
35
36
    } // end group AdressTypes
36
    } // end group AdressTypes
37
37
38
    type port SipPort message {
38
    type port SipPort message {
39
        inout Request, REGISTER_Request, INVITE_Request, OPTIONS_Request, BYE_Request, CANCEL_Request, ACK_Request, PRACK_Request, NOTIFY_Request, SUBSCRIBE_Request, PUBLISH_Request, UPDATE_Request, REFER_Request, MESSAGE_Request, INFO_Request, Response, Raw;
39
        inout Request, REGISTER_Request, INVITE_Request, OPTIONS_Request, BYE_Request, CANCEL_Request, ACK_Request, PRACK_Request, NOTIFY_Request, SUBSCRIBE_Request, PUBLISH_Request, UPDATE_Request, REFER_Request, MESSAGE_Request, INFO_Request, Response, Raw;
40
    }
40
    }
41
    with {
41
    with {
42
        extension "address";
42
        extension "address";
43
    }
43
    }
44
44
45
    signature s_SIP_conversation(
45
    signature s_SIP_conversation(
46
        in charstring text,
46
        in charstring p_text,
47
        out boolean answer
47
        out boolean p_answer
48
    ) ;
48
    ) ;
49
    signature s_SIP_ringing(
49
    signature s_SIP_ringing(
50
        in charstring text,
50
        in charstring p_text,
51
        out boolean answer
51
        out boolean p_answer
52
    ) ;
52
    ) ;
53
    signature s_SIP_announcementA(
53
    signature s_SIP_announcementA(
54
        in charstring text,
54
        in charstring p_text,
55
        out boolean answer
55
        out boolean p_answer
56
    ) ;
56
    ) ;
57
    signature s_SIP_announcementB(
57
    signature s_SIP_announcementB(
58
        in charstring text,
58
        in charstring p_text,
59
        out boolean answer
59
        out boolean p_answer
60
    ) ;
60
    ) ;
61
    signature s_SIP_announcement(
61
    signature s_SIP_announcement(
62
        in charstring text,
62
        in charstring p_text,
63
        out boolean answer
63
        out boolean p_answer
64
    ) ;
64
    ) ;
65
    signature s_SIP_voiceMessage(
65
    signature s_SIP_voiceMessage(
66
        in charstring text,
66
        in charstring p_text,
67
        out boolean answer
67
        out boolean p_answer
68
    ) ;
68
    ) ;
69
    signature s_SIP_mediastopped(
69
    signature s_SIP_mediastopped(
70
        in charstring text,
70
        in charstring p_text,
71
        out boolean answer
71
        out boolean p_answer
72
    ) ;
72
    ) ;
73
    type port operatorPort procedure {
73
    type port OperatorPort procedure {
74
        inout s_SIP_conversation;
74
        inout s_SIP_conversation;
75
        inout s_SIP_ringing;
75
        inout s_SIP_ringing;
76
        inout s_SIP_announcementA;
76
        inout s_SIP_announcementA;
77
        inout s_SIP_announcementB;
77
        inout s_SIP_announcementB;
78
        inout s_SIP_announcement;
78
        inout s_SIP_announcement;
79
        inout s_SIP_voiceMessage;
79
        inout s_SIP_voiceMessage;
80
        inout s_SIP_mediastopped;
80
        inout s_SIP_mediastopped;
81
    }
81
    }
82
82
83
    // Solution for building error problem. (Important for validation)
83
    // Solution for building error problem. (Important for validation)
84
    // type component ImsComponent extends SipComponent need to be located in LibIms_Interface and not in LibSip_Interface module
84
    // type component ImsComponent extends SipComponent need to be located in LibIms_Interface and not in LibSip_Interface module
85
    // With this solution TAU compiler error.
85
    // With this solution TAU compiler error.
86
    // type component ImsComponent extends SipComponent
86
    // type component ImsComponent extends SipComponent
87
    // {
87
    // {
88
    // // general variables
88
    // // general variables
89
    // var ImsInterfaceProfile vc_interfaceprofile
89
    // var ImsInterfaceProfile vc_interfaceprofile
90
    // } // end ImsComponent
90
    // } // end ImsComponent
91
    type component SipComponent {
91
    type component SipComponent {
92
        // port
92
        // port
93
        port SipPort SIPP;
93
        port SipPort SIPP;
94
        // used for communication with the operator
94
        // used for communication with the operator
95
        port operatorPort opPort;
95
        port OperatorPort opPort;
96
96
97
        // current address to send TCP/UDP messages
97
        // current address to send TCP/UDP messages
98
        var SipUserProfile vc_userprofile; // PIXIT userinformation
98
        var SipUserProfile vc_userprofile; // PIXIT userinformation
99
        var address vc_sent_label; // removed because this value is predefined and used to open socket := {host := PX_SIP_SUT_IPADDR, portField := PX_SIP_SUT_PORT};
99
        var address vc_sent_label; // removed because this value is predefined and used to open socket := {host := PX_SIP_SUT_IPADDR, portField := PX_SIP_SUT_PORT};
100
        // last incoming message
100
        // last incoming message
101
        var Response vc_response; // last incoming response message
101
        var Response vc_response; // last incoming response message
102
        var boolean vc_boo_response := false; // to check if response received or not
102
        var boolean vc_boo_response := false; // to check if response received or not
103
        var Request vc_request; // last incoming request message
103
        var Request vc_request; // last incoming request message
104
        var boolean vc_boo_request := false; // to check if request received or not
104
        var boolean vc_boo_request := false; // to check if request received or not
105
        var Request vc_requestFor407; // last INVITE request to be authorized if 407/401 received from Proxy
105
        var Request vc_requestFor407; // last INVITE request to be authorized if 407/401 received from Proxy
106
        var SipUrl vc_requestUri := c_empty_RequestUri;
106
        var SipUrl vc_requestUri := c_empty_RequestUri;
107
        var SipUrl vc_requestUri2 := c_empty_RequestUri; // MRO
107
        var SipUrl vc_requestUri2 := c_empty_RequestUri; // MRO
108
        var charstring vc_branch := "";
108
        var charstring vc_branch := "";
109
        var charstring vc_branch_ICSCF := "";
109
        var charstring vc_branch_ICSCF := "";
110
        var charstring vc_branch_SCSCF := "";
110
        var charstring vc_branch_SCSCF := "";
111
111
112
        // SIP message header fields (for building next message)
112
        // SIP message header fields (for building next message)
113
        var template(omit) CallId vc_callId := c_empty_CallId;
113
        var template(omit) CallId vc_callId := c_empty_CallId;
114
        var template(omit) CallId vc_callIdReg := c_empty_CallId;
114
        var template(omit) CallId vc_callIdReg := c_empty_CallId;
115
        // TODO: STF471 added
115
        // TODO: STF471 added
116
        var template(omit) CallId vc_callIdSub := c_empty_CallId;
116
        var template(omit) CallId vc_callIdSub := c_empty_CallId;
117
        var From vc_from := c_empty_From;
117
        var From vc_from := c_empty_From;
118
        var To vc_to := c_empty_To;
118
        var To vc_to := c_empty_To;
119
        var To vc_cancel_To := c_empty_To; // used for next CANCEL
119
        var To vc_cancel_To := c_empty_To; // used for next CANCEL
120
        var Via vc_via := c_empty_Via;
120
        var Via vc_via := c_empty_Via;
121
        var Via vc_via_REG := c_empty_Via; // via used in last REGISTER
121
        var Via vc_via_REG := c_empty_Via; // via used in last REGISTER
122
        var ContentType vc_contentType := c_empty_ContentType; // MRO
122
        var ContentType vc_contentType := c_empty_ContentType; // MRO
123
        var template(omit) RecordRoute vc_recordRoute; // value of RecordRoute header
123
        var template(omit) RecordRoute vc_recordRoute; // value of RecordRoute header
124
        var boolean vc_boo_recordRoute := false; // boolean indicates valid recordRoute
124
        var boolean vc_boo_recordRoute := false; // boolean indicates valid recordRoute
125
        var template(omit) Route vc_route; // value of Route header
125
        var template(omit) Route vc_route; // value of Route header
126
        var template(omit) Route vc_route_REG; // value of Route header from registration ServiceRoute header for initial Requests
126
        var template(omit) Route vc_route_REG; // value of Route header from registration ServiceRoute header for initial Requests
127
        var
127
        var
128
        UrnUriComponents
128
        UrnUriComponents
129
            vc_reqUrnUri := {
129
            vc_reqUrnUri := {
130
                namespaceId := "",
130
                namespaceId := "",
131
                namespaceSpecificString := ""
131
                namespaceSpecificString := ""
132
            };
132
            };
133
        var boolean vc_boo_route := false; // boolean indicates valid Route
133
        var boolean vc_boo_route := false; // boolean indicates valid Route
134
        var template(omit) Contact vc_contact; // value of Contact header
134
        var template(omit) Contact vc_contact; // value of Contact header
135
        var CSeq vc_cSeq := c_empty_cSeq; // value of CSeq header
135
        var CSeq vc_cSeq := c_empty_cSeq; // value of CSeq header
136
        var template(value)
136
        var template(value)
137
        RAck
137
        RAck
138
            vc_rAck := {
138
            vc_rAck := {
139
                fieldName := RACK_E,
139
                fieldName := RACK_E,
140
                responseNum := 1,
140
                responseNum := 1,
141
                seqNumber := 1,
141
                seqNumber := 1,
142
                method := "INVITE"
142
                method := "INVITE"
143
            }; // value of RAck header
143
            }; // value of RAck header
144
144
145
        // address to send request
145
        // address to send request
146
        var HostPort vc_reqHostPort := {//STF471 removed PIXIT assignment, should be performed in specific ATS 
146
        var HostPort vc_reqHostPort := {//STF471 removed PIXIT assignment, should be performed in specific ATS 
147
            host := "127.0.0.1",    // former PX_SIP_SUT_IPADDR value
147
            host := "127.0.0.1",    // former PX_SIP_SUT_IPADDR value
148
            portField := 5060       //former PX_SIP_SUT_PORT value
148
            portField := 5060       //former PX_SIP_SUT_PORT value
149
        };
149
        };
150
        var template(omit) Privacy vc_privacy;
150
        var template(omit) Privacy vc_privacy;
151
        var HistoryInfo_List vc_historyInfoList := {}; // value of history list according to RFC4244
151
        var HistoryInfo_List vc_historyInfoList := {}; // value of history list according to RFC4244
152
        var SipUrl vc_confURI; // conference URI according to TS124147 ch. 5.3.1.3.2
152
        var SipUrl vc_confURI; // conference URI according to TS124147 ch. 5.3.1.3.2
153
        var SDP_Message vc_sdp_remote; // incoming SDP offers
153
        var SDP_Message vc_sdp_remote; // incoming SDP offers
154
        var SDP_Message vc_sdp_local; // SDP values to be sent
154
        var SDP_Message vc_sdp_local; // SDP values to be sent
155
        var XmlBody vc_xml_remote; // incoming XML value
155
        var XmlBody vc_xml_remote; // incoming XML value
156
        var template XmlBody vc_xml_local; // SDP values to be sent
156
        var template XmlBody vc_xml_local; // SDP values to be sent
157
        var template(omit) CSeq vc_iut_CSeq := c_empty_cSeq; // value of last CSeq header used by the IUT in request
157
        var template(omit) CSeq vc_iut_CSeq := c_empty_cSeq; // value of last CSeq header used by the IUT in request
158
        // To/From header-fields to be used if the callee will release the session
158
        // To/From header-fields to be used if the callee will release the session
159
        var To vc_callee_To := c_empty_To;
159
        var To vc_callee_To := c_empty_To;
160
        var From vc_callee_From := c_empty_From;
160
        var From vc_callee_From := c_empty_From;
161
        // To/From header-fields to be used if the caller will release the session
161
        // To/From header-fields to be used if the caller will release the session
162
        var To vc_caller_To := c_empty_To;
162
        var To vc_caller_To := c_empty_To;
163
        var From vc_caller_From := c_empty_From;
163
        var From vc_caller_From := c_empty_From;
164
        var Authorization vc_authorization;
164
        var Authorization vc_authorization;
165
165
166
        // variables for storing default references
166
        // variables for storing default references
167
        var default vc_default;
167
        var default vc_default;
168
        var default vc_def_catchSyncStop;
168
        var default vc_def_catchSyncStop;
169
169
170
        // general timers
170
        // general timers
171
        timer tc_T1 := 0.5;//STF471 default value, should be set in specific ATS, former PX_SIP_T1
171
        timer tc_T1 := 0.5;//STF471 default value, should be set in specific ATS, former PX_SIP_T1
172
        timer tc_Tf := 32.0;//STF471 default value, should be set in specific ATS, former PX_SIP_TF
172
        timer tc_Tf := 32.0;//STF471 default value, should be set in specific ATS, former PX_SIP_TF
173
        timer tc_wait := PX_SIP_TWAIT;
173
        timer tc_wait := PX_SIP_TWAIT;
174
        timer tc_ack := PX_SIP_TACK;
174
        timer tc_ack := PX_SIP_TACK;
175
        timer tc_resp := PX_SIP_TRESP;
175
        timer tc_resp := PX_SIP_TRESP;
176
        timer tc_noAct := PX_SIP_TNOACT; // time for SUT to get idle state
176
        timer tc_noAct := PX_SIP_TNOACT; // time for SUT to get idle state
177
        // timer TRept;
177
        // timer TRept;
178
        // timer TSync := 10.0; //STF471 default value, should be set in specific ATS, former PX_SIP_TSYNC
178
        // timer TSync := 10.0; //STF471 default value, should be set in specific ATS, former PX_SIP_TSYNC
179
        timer tc_guard := 120.0; //STF471 default value, should be set in specific ATS, former PX_SIP_TGUARD
179
        timer tc_guard := 120.0; //STF471 default value, should be set in specific ATS, former PX_SIP_TGUARD
180
        timer tc_tDelay := 32.0;
180
        timer tc_tDelay := 32.0;
181
181
182
        var float vc_tcRESP := PX_SIP_TRESP; // standard value for TRESP (may be modified in particular tests)
182
        var float vc_tcRESP := PX_SIP_TRESP; // standard value for TRESP (may be modified in particular tests)
183
        // indicators set/used parameter status or state handling in default
183
        // indicators set/used parameter status or state handling in default
184
        var boolean vc_sdp_remote_is_valid := false; // true if there is a value in v_SDP_remote
184
        var boolean vc_sdp_remote_is_valid := false; // true if there is a value in v_SDP_remote
185
        var boolean vc_history_is_valid := false; // true if there is a HistoryList in response message
185
        var boolean vc_history_is_valid := false; // true if there is a HistoryList in response message
186
        var boolean vc_send_SDP := false; // send SDP in the next outgoing message
186
        var boolean vc_send_SDP := false; // send SDP in the next outgoing message
187
        var boolean vc_ignore_bye := false; // enable ignore of repeated bye in default
187
        var boolean vc_ignore_bye := false; // enable ignore of repeated bye in default
188
        var boolean vc_ignore_invite := false; // enable ignore invite in default
188
        var boolean vc_ignore_invite := false; // enable ignore invite in default
189
        var boolean vc_ignore_subscribe := false; // enable ignore subscribe in default
189
        var boolean vc_ignore_subscribe := false; // enable ignore subscribe in default
190
        var boolean vc_ignore181 := false; // enable ignore of 181 in default
190
        var boolean vc_ignore181 := false; // enable ignore of 181 in default
191
        var boolean vc_ignore484 := false; // enable ignore of 484 in default
191
        var boolean vc_ignore484 := false; // enable ignore of 484 in default
192
        var boolean vc_ignore4xx := false; // enable ignore of 4xx in default
192
        var boolean vc_ignore4xx := false; // enable ignore of 4xx in default
193
        var boolean vc_ignore200OKinv := false; // enable ignore of 200OKinv in default
193
        var boolean vc_ignore200OKinv := false; // enable ignore of 200OKinv in default
194
        var boolean vc_ignore_notify := false; // enable ignore of notify in default
194
        var boolean vc_ignore_notify := false; // enable ignore of notify in default
195
        var boolean vc_supported_100rel := false; // true if the received invite contains 100rel
195
        var boolean vc_supported_100rel := false; // true if the received invite contains 100rel
196
        var boolean vc_supported_precondition := false; // true if the received invite contains precondition
196
        var boolean vc_supported_precondition := false; // true if the received invite contains precondition
197
        var boolean vc_MESSAGEreceived := false; // true if MESSAGE received during altstep
197
        var boolean vc_MESSAGEreceived := false; // true if MESSAGE received during altstep
198
        var boolean vc_first_recv := false; // true after receipt of first incomming SIP message
198
        var boolean vc_first_recv := false; // true after receipt of first incomming SIP message
199
        var boolean vc_firstREGISTER_sent := false; // true after sent of first REGISTER message
199
        var boolean vc_firstREGISTER_sent := false; // true after sent of first REGISTER message
200
        var boolean vc_DeregDone := false; // true after first DeREGISTRATION trail (avoid loop)
200
        var boolean vc_DeregDone := false; // true after first DeREGISTRATION trail (avoid loop)
201
        var boolean vc_interface_isc := false; // true if isc interface is in use
201
        var boolean vc_interface_isc := false; // true if isc interface is in use
202
        var boolean v_white_space := false; // MRO
202
        var boolean vc_white_space := false; // MRO
203
        // TODO: TT change
203
        // TODO: TT change
204
        var boolean vc_subscribed := false;
204
        var boolean vc_subscribed := false;
205
        // ETS address
205
        // ETS address
206
        var address v_ets_label; /*STF471 removed assignment, should be performed in specific ATS
206
        var address vc_ets_label; /*STF471 removed assignment, should be performed in specific ATS
207
            := {
207
            := {
208
                host := PX_SIP_TS1_IPADDR,
208
                host := PX_SIP_TS1_IPADDR,
209
                portField := PX_SIP_TS1_PORT
209
                portField := PX_SIP_TS1_PORT
210
            };*/
210
            };*/
211
211
212
        // parts needed for Client/SelfSyncComp type compatibility
212
        // parts needed for Client/SelfSyncComp type compatibility
213
        var StringStack v_stateStack := c_initStringStack;
213
        var StringStack vc_stateStack := c_initStringStack;
214
        port SyncPort syncSendPort;
214
        port SyncPort syncSendPort;
215
        port SyncPort syncPort;
215
        port SyncPort syncPort;
216
        timer tc_sync := PX_TSYNC_TIME_LIMIT;
216
        timer tc_sync := PX_TSYNC_TIME_LIMIT;
217
    // // used for communication with the operator
217
    // // used for communication with the operator
218
    // port operatorPort_SIP opPort;
218
    // port OperatorPort_SIP opPort;
219
    } // end SipComponent
219
    } // end SipComponent
220
} // end module LibSip_Interface
220
} // end module LibSip_Interface
221
 
221