Loading ttcn/LibSip_SIPTypesAndValues.ttcn +14 −4 Original line number Diff line number Diff line Loading @@ -174,6 +174,16 @@ group AuthorizationConstants { } //end group AuthorizationConstants group PChargingVectorConstants { const charstring c_icid := "icid-value"; const charstring c_icid_value := "123abc"; const charstring c_icid_generated_at := "icid-generated-at"; const charstring c_orig_ioi := "orig-ioi"; const charstring c_term_ioi := "term-ioi"; } //end group PChargingVectorConstants group HeaderFieldConstants { const CallId c_empty_CallId := Loading ttcn/LibSip_Steps.ttcn +84 −71 Original line number Diff line number Diff line Loading @@ -1152,8 +1152,15 @@ group SetHeaders { viaBody := {valueof(m_ViaBody_currIpaddr(vc_branch, vc_userprofile))} }; if(ischosen(vc_response.msgHeader.wwwAuthenticate.challenge.otherChallenge)) // Extract challenge and calculate credentials for a response. { v_challenge := vc_response.msgHeader.wwwAuthenticate.challenge.otherChallenge.authParams; } else { v_challenge := vc_response.msgHeader.wwwAuthenticate.challenge.digestCln; } // Increment CSeq sequence number vc_cSeq.seqNumber := vc_cSeq.seqNumber + 1; Loading Loading @@ -1316,7 +1323,8 @@ group SetHeaders { { f_setHeadersGeneral(p_cSeq_s, "NOTIFY"); // cseq, contact, branch, via vc_callId := { fieldName:=CALL_ID_E, callid:=f_getRndCallId(p_cSeq_s) & c_AT & vc_userprofile.currIpaddr }; //after SUBSCRIBE message callid shall be same //vc_callId := { fieldName:=CALL_ID_E, callid:=f_getRndCallId(p_cSeq_s) & c_AT & vc_userprofile.currIpaddr }; vc_cancel_To := vc_to; vc_caller_To := vc_to; Loading Loading @@ -1418,7 +1426,7 @@ group SetHeaders { vc_cancel_To := p_Request.msgHeader.toField; if (ispresent(p_Request.msgHeader.contact)) { if (ispresent(p_Request.msgHeader.contact) and (not ischosen(p_Request.msgHeader.contact.contactBody.wildcard))) { vc_reqHostPort := f_getContactAddr(p_Request.msgHeader.contact.contactBody.contactAddresses[0]); } Loading Loading @@ -2468,15 +2476,15 @@ group AwaitingMessage { { var Request v_request; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_register)-> value v_request sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfREGISTER(v_request); } [] tc_resp.timeout [] tc_wait.timeout { setverdict (fail); f_componentStop(); Loading @@ -2489,16 +2497,16 @@ group AwaitingMessage { * @desc function awaits SUBSCRIBE * @param p_register expected SUBSCRIBE request */ function f_awaitingSUBSCRIBE(in template SUBSCRIBE_Request p_register) runs on SipComponent function f_awaitingSUBSCRIBE(in template SUBSCRIBE_Request p_subscribe) runs on SipComponent { var Request v_request; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_register)-> value v_request sender vc_sent_label [] SIPP.receive(p_subscribe)-> value v_request sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfSUBSCRIBE(v_request); } } Loading @@ -2513,19 +2521,19 @@ group AwaitingMessage { { var Request v_request; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_register)-> value v_request sender vc_sent_label { tc_resp.stop; tc_wait.stop; vc_request := v_request; f_setHeadersOnReceiptOfREGISTER(v_request); //Answer to the Request if (p_reply) {f_send200OK();}; } [] tc_resp.timeout [] tc_wait.timeout { setverdict (fail); f_componentStop(); Loading @@ -2542,12 +2550,12 @@ group AwaitingMessage { function f_awaitingOkResponse(inout CSeq p_cSeq_s) runs on SipComponent { tc_ack.start(PX_SIP_TACK); tc_resp.start(PX_SIP_TRESP); alt { [] SIPP.receive (mw_Response_Base(c_statusLine200, vc_callId, p_cSeq_s)) -> value vc_response { tc_ack.stop; tc_resp.stop; f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response); setverdict(pass) } Loading @@ -2561,14 +2569,14 @@ group AwaitingMessage { */ function f_awaitingResponse(in template Response p_Response) runs on SipComponent { tc_ack.start(PX_SIP_TACK); tc_resp.start(PX_SIP_TRESP); alt { [] SIPP.receive (p_Response) -> value vc_response { tc_ack.stop; tc_resp.stop; f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response); setverdict(pass) //setverdict(pass) } } } //end f_awaitingResponse Loading @@ -2580,11 +2588,12 @@ group AwaitingMessage { */ function f_awaitingResponseSendACK(in template Response p_Response) runs on SipComponent { tc_ack.start(PX_SIP_TACK); tc_resp.start(PX_SIP_TRESP); alt { [] SIPP.receive (p_Response) -> value vc_response { tc_ack.stop; tc_resp.stop; f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response); LibSip_Steps.f_setHeadersACK(); f_SendACK(m_ACK_Request_Base(vc_requestUri, vc_callId, vc_cSeq, vc_from, vc_to, vc_via)); setverdict(pass); } Loading @@ -2598,17 +2607,17 @@ group AwaitingMessage { */ function f_awaitingResponsePassOnTimeout(in template Response p_Response) runs on SipComponent { tc_ack.start(PX_SIP_TACK); tc_resp.start(PX_SIP_TRESP); alt { [] SIPP.receive (p_Response) -> value vc_response { tc_ack.stop; tc_resp.stop; f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response); vc_boo_response:=true; //setverdict(pass) } [] tc_ack.timeout [] tc_resp.timeout { vc_boo_response:=false; //setverdict (pass) Loading @@ -2620,17 +2629,17 @@ group AwaitingMessage { * @desc await INFO request * reply with 200 OK */ function f_awaitingINFO_sendReply(in template INFO_Request p_MSG) runs on SipComponent function f_awaitingINFO_sendReply(in template INFO_Request p_info) runs on SipComponent { var INFO_Request v_MSG; var INFO_Request v_request; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label [] SIPP.receive(p_info)-> value v_request sender vc_sent_label { tc_resp.stop; f_setHeadersOnReceiptOfRequest(v_MSG); tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_request); //Answer to the INFO f_send200OK(); } Loading Loading @@ -2738,12 +2747,12 @@ group AwaitingMessage { { var BYE_Request v_BYE_Request; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { []SIPP.receive (p_BYE) -> value v_BYE_Request sender vc_sent_label { tc_resp.stop; tc_wait.stop; vc_ignore_bye:= true; f_setHeadersOnReceiptOfBYE(v_BYE_Request); //f_send200OK(); Loading @@ -2761,12 +2770,12 @@ group AwaitingMessage { { var BYE_Request v_BYE_Request; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { []SIPP.receive (p_BYE) -> value v_BYE_Request sender vc_sent_label { tc_resp.stop; tc_wait.stop; vc_ignore_bye:= true; f_setHeadersOnReceiptOfBYE(v_BYE_Request); f_send200OK(); Loading @@ -2783,18 +2792,18 @@ group AwaitingMessage { { var BYE_Request v_BYE_Request; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { []SIPP.receive (p_BYE) -> value v_BYE_Request sender vc_sent_label { tc_resp.stop; tc_wait.stop; vc_ignore_bye:= true; vc_boo_request := true; f_setHeadersOnReceiptOfBYE(v_BYE_Request); f_send200OK(); } [] tc_resp.timeout [] tc_wait.timeout { vc_boo_request := false; } Loading @@ -2810,12 +2819,12 @@ group AwaitingMessage { { var CANCEL_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { []SIPP.receive (p_CANCEL) -> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); } } Loading @@ -2827,17 +2836,17 @@ group AwaitingMessage { { var MESSAGE_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); } [] SIPP.receive(mw_MESSAGE_Request_Base)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); log("Received MESSAGE not as expected!"); setverdict (fail); Loading @@ -2853,12 +2862,12 @@ group AwaitingMessage { { var MESSAGE_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(mw_MESSAGE_Request_Base)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); //Answer to the MESSAGE f_send200OK(); Loading @@ -2874,12 +2883,12 @@ group AwaitingMessage { { var MESSAGE_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); //Answer to the MESSAGE //f_send200OK(); Loading @@ -2887,7 +2896,7 @@ group AwaitingMessage { f_send200OK(); //setverdict (pass); } [] tc_resp.timeout [] tc_wait.timeout { vc_boo_request := false; //setverdict (pass); Loading @@ -2903,12 +2912,12 @@ group AwaitingMessage { { var NOTIFY_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_getRouteMapIntoRecordRoute(vc_cSeq, v_MSG); f_setHeadersOnReceiptOfRequest(v_MSG); //Answer to the NOTIFY Loading @@ -2925,12 +2934,12 @@ group AwaitingMessage { { var PRACK_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); //Answer to the PRACK f_send200OK(); Loading @@ -2947,12 +2956,12 @@ group AwaitingMessage { { var PUBLISH_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); //Answer to the PUBLISH f_send200OK(); Loading @@ -2968,12 +2977,12 @@ group AwaitingMessage { { var UPDATE_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); } } Loading @@ -2987,12 +2996,12 @@ group AwaitingMessage { { var UPDATE_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); //Answer to the UPDATE f_send200OK(); Loading @@ -3009,12 +3018,12 @@ group AwaitingMessage { { var REFER_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); } } Loading Loading @@ -3340,12 +3349,12 @@ group Registration { { // receiving 401 Unauthorized response. // and Re-send REGISTER request with Authorization header tc_ack.start(PX_SIP_TACK); tc_resp.start(PX_SIP_TRESP); alt { [] SIPP.receive (mw_Response_Base(c_statusLine401, vc_callId, p_cSeq_s)) -> value vc_response { tc_ack.stop; tc_resp.stop; f_setHeadersOnReceiptOfResponse(p_cSeq_s, vc_response); // set headers via, cseq and authorization f_setHeaders_2ndREGISTER(p_cSeq_s); Loading @@ -3359,7 +3368,7 @@ group Registration { } [] SIPP.receive (mw_Response_Base(c_statusLine200, vc_callId, p_cSeq_s)) -> value vc_response { tc_ack.stop; tc_resp.stop; f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response); f_getServiceRouteMapIntoRouteInRegistration(p_cSeq_s, vc_response); log ("Authorization was not requested as expected"); Loading Loading @@ -3406,12 +3415,12 @@ group Registration { { // receiving 401 Unauthorized response. // and Re-send REGISTER request with Authorization header tc_ack.start(PX_SIP_TACK); tc_resp.start(PX_SIP_TRESP); alt { [] SIPP.receive (mw_Response_Base(c_statusLine401, vc_callIdReg, p_cSeq)) -> value vc_response { tc_ack.stop; tc_resp.stop; // set headers via, cseq and authorization f_setHeaders_2ndREGISTER(p_cSeq); v_request := m_REGISTER_Request_expires(vc_requestUri, vc_callIdReg, Loading @@ -3425,7 +3434,7 @@ group Registration { } [] SIPP.receive (mw_Response_Base(c_statusLine200, vc_callIdReg, p_cSeq))-> value vc_response { tc_ack.stop; tc_resp.stop; f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response); log ("Authorization was not requested as expected"); } Loading Loading @@ -3871,9 +3880,11 @@ group DefaultsTestStep [] 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_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 } Loading Loading @@ -3901,6 +3912,7 @@ group DefaultsTestStep { 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); } Loading @@ -3909,6 +3921,7 @@ group DefaultsTestStep { 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); } Loading Loading @@ -3940,12 +3953,12 @@ group DefaultsTestStep var Response v_Response; var Request v_Request := valueof (vc_requestFor407); tc_ack.start (PX_SIP_TACK); tc_resp.start (PX_SIP_TRESP); alt { [] SIPP.receive (mw_Response_Base((c_statusLine401,c_statusLine407), vc_callId, vc_cSeq)) -> value v_Response { tc_ack.stop; tc_resp.stop; // get tag from To header if available vc_to := v_Response.msgHeader.toField; if (vc_cSeq.method == "INVITE"){ Loading ttcn/LibSip_Templates.ttcn +60 −28 Original line number Diff line number Diff line Loading @@ -645,7 +645,14 @@ module LibSip_Templates { fieldName := REQUIRE_E, optionsTags := {c_tagPrecond} }; } template SubscriptionState m_SubscriptionState_active := { fieldName := SUBSCRIPTION_STATE_E, subState := "active", substateParams := {{id:="expires",paramValue:="60000"}} } template Supported m_Supported_fromChange := { Loading Loading @@ -722,6 +729,12 @@ module LibSip_Templates toParams := * } template To mw_To(template SipUrl p_sipUrl) := { fieldName := TO_E, addressField := { nameAddr := {displayName := *, addrSpec := p_sipUrl}}, toParams:= * } template From mw_From(template SipUrl p_sipUrl) := { fieldName := FROM_E, addressField := { nameAddr := {displayName := *, addrSpec := p_sipUrl}}, Loading Loading @@ -809,6 +822,13 @@ module LibSip_Templates routeBody := p_routeBody }; template StatusLine mw_statusLine(template integer p_statusCode) := { sipVersion:=c_sipNameVersion, statusCode:=p_statusCode, reasonPhrase:=? }; template Supported mw_Supported_100rel_prec := { fieldName:=SUPPORTED_E, Loading Loading @@ -1306,9 +1326,6 @@ group base_templates{ requestLine := { requestUri := p_requestUri // { // hostPort:= p_requestUri.hostPort // } }, msgHeader := { Loading Loading @@ -1343,10 +1360,7 @@ group base_templates{ { requestLine := { requestUri := { hostPort:= p_requestUri.hostPort } requestUri := p_requestUri }, msgHeader := { Loading Loading @@ -1397,22 +1411,16 @@ group base_templates{ { requestLine := { requestUri := { hostPort:= p_requestUri.hostPort } requestUri := p_requestUri }, msgHeader := { callId := p_callId, //* contentLength := {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))}, //* contentType := {fieldName := CONTENT_TYPE_E, mediaType := c_sdpAplication}, cSeq := {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "NOTIFY"}, fromField := p_from, toField := p_to, via := p_via }//* , //* messageBody := p_mb } } template PRACK_Request m_PRACK_Request_Base (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, Loading @@ -1421,10 +1429,7 @@ group base_templates{ { requestLine := { requestUri := { hostPort:= p_requestUri.hostPort } requestUri := p_requestUri }, msgHeader := { Loading @@ -1445,10 +1450,7 @@ group base_templates{ { requestLine := { requestUri := { hostPort:= p_requestUri.hostPort } requestUri := p_requestUri }, msgHeader := { Loading Loading @@ -1532,10 +1534,7 @@ group base_templates{ { requestLine := { requestUri := { hostPort:= p_requestUri.hostPort } requestUri := p_requestUri }, msgHeader := { Loading Loading @@ -1841,6 +1840,25 @@ group request_send { } } template NOTIFY_Request m_NOTIFY_Request_contact ( SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, From p_from, To p_to, Via p_via, Contact p_contact ) modifies m_NOTIFY_Request_Base := { msgHeader := { contact := p_contact, event := m_Event_reg, subscriptionState := m_SubscriptionState_active } } template NOTIFY_Request m_NOTIFY_Request_sipfrag ( SipUrl p_requestUri, CallId p_callId, Loading Loading @@ -1986,6 +2004,20 @@ group response_send { } } template Response m_Response_Contact ( StatusLine p_statusLine, CallId p_callId, CSeq p_cSeq, From p_from, To p_to, Via p_via, Contact p_contact ) modifies m_Response_Base:= { msgHeader := { contact := p_contact } } template Response m_Response_ext (StatusLine p_statusLine, CallId p_callId, CSeq p_cSeq, From p_from, To p_to, Via p_via, template Route p_route, template RecordRoute p_recordroute) modifies m_Response_Base:= { Loading Loading
ttcn/LibSip_SIPTypesAndValues.ttcn +14 −4 Original line number Diff line number Diff line Loading @@ -174,6 +174,16 @@ group AuthorizationConstants { } //end group AuthorizationConstants group PChargingVectorConstants { const charstring c_icid := "icid-value"; const charstring c_icid_value := "123abc"; const charstring c_icid_generated_at := "icid-generated-at"; const charstring c_orig_ioi := "orig-ioi"; const charstring c_term_ioi := "term-ioi"; } //end group PChargingVectorConstants group HeaderFieldConstants { const CallId c_empty_CallId := Loading
ttcn/LibSip_Steps.ttcn +84 −71 Original line number Diff line number Diff line Loading @@ -1152,8 +1152,15 @@ group SetHeaders { viaBody := {valueof(m_ViaBody_currIpaddr(vc_branch, vc_userprofile))} }; if(ischosen(vc_response.msgHeader.wwwAuthenticate.challenge.otherChallenge)) // Extract challenge and calculate credentials for a response. { v_challenge := vc_response.msgHeader.wwwAuthenticate.challenge.otherChallenge.authParams; } else { v_challenge := vc_response.msgHeader.wwwAuthenticate.challenge.digestCln; } // Increment CSeq sequence number vc_cSeq.seqNumber := vc_cSeq.seqNumber + 1; Loading Loading @@ -1316,7 +1323,8 @@ group SetHeaders { { f_setHeadersGeneral(p_cSeq_s, "NOTIFY"); // cseq, contact, branch, via vc_callId := { fieldName:=CALL_ID_E, callid:=f_getRndCallId(p_cSeq_s) & c_AT & vc_userprofile.currIpaddr }; //after SUBSCRIBE message callid shall be same //vc_callId := { fieldName:=CALL_ID_E, callid:=f_getRndCallId(p_cSeq_s) & c_AT & vc_userprofile.currIpaddr }; vc_cancel_To := vc_to; vc_caller_To := vc_to; Loading Loading @@ -1418,7 +1426,7 @@ group SetHeaders { vc_cancel_To := p_Request.msgHeader.toField; if (ispresent(p_Request.msgHeader.contact)) { if (ispresent(p_Request.msgHeader.contact) and (not ischosen(p_Request.msgHeader.contact.contactBody.wildcard))) { vc_reqHostPort := f_getContactAddr(p_Request.msgHeader.contact.contactBody.contactAddresses[0]); } Loading Loading @@ -2468,15 +2476,15 @@ group AwaitingMessage { { var Request v_request; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_register)-> value v_request sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfREGISTER(v_request); } [] tc_resp.timeout [] tc_wait.timeout { setverdict (fail); f_componentStop(); Loading @@ -2489,16 +2497,16 @@ group AwaitingMessage { * @desc function awaits SUBSCRIBE * @param p_register expected SUBSCRIBE request */ function f_awaitingSUBSCRIBE(in template SUBSCRIBE_Request p_register) runs on SipComponent function f_awaitingSUBSCRIBE(in template SUBSCRIBE_Request p_subscribe) runs on SipComponent { var Request v_request; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_register)-> value v_request sender vc_sent_label [] SIPP.receive(p_subscribe)-> value v_request sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfSUBSCRIBE(v_request); } } Loading @@ -2513,19 +2521,19 @@ group AwaitingMessage { { var Request v_request; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_register)-> value v_request sender vc_sent_label { tc_resp.stop; tc_wait.stop; vc_request := v_request; f_setHeadersOnReceiptOfREGISTER(v_request); //Answer to the Request if (p_reply) {f_send200OK();}; } [] tc_resp.timeout [] tc_wait.timeout { setverdict (fail); f_componentStop(); Loading @@ -2542,12 +2550,12 @@ group AwaitingMessage { function f_awaitingOkResponse(inout CSeq p_cSeq_s) runs on SipComponent { tc_ack.start(PX_SIP_TACK); tc_resp.start(PX_SIP_TRESP); alt { [] SIPP.receive (mw_Response_Base(c_statusLine200, vc_callId, p_cSeq_s)) -> value vc_response { tc_ack.stop; tc_resp.stop; f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response); setverdict(pass) } Loading @@ -2561,14 +2569,14 @@ group AwaitingMessage { */ function f_awaitingResponse(in template Response p_Response) runs on SipComponent { tc_ack.start(PX_SIP_TACK); tc_resp.start(PX_SIP_TRESP); alt { [] SIPP.receive (p_Response) -> value vc_response { tc_ack.stop; tc_resp.stop; f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response); setverdict(pass) //setverdict(pass) } } } //end f_awaitingResponse Loading @@ -2580,11 +2588,12 @@ group AwaitingMessage { */ function f_awaitingResponseSendACK(in template Response p_Response) runs on SipComponent { tc_ack.start(PX_SIP_TACK); tc_resp.start(PX_SIP_TRESP); alt { [] SIPP.receive (p_Response) -> value vc_response { tc_ack.stop; tc_resp.stop; f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response); LibSip_Steps.f_setHeadersACK(); f_SendACK(m_ACK_Request_Base(vc_requestUri, vc_callId, vc_cSeq, vc_from, vc_to, vc_via)); setverdict(pass); } Loading @@ -2598,17 +2607,17 @@ group AwaitingMessage { */ function f_awaitingResponsePassOnTimeout(in template Response p_Response) runs on SipComponent { tc_ack.start(PX_SIP_TACK); tc_resp.start(PX_SIP_TRESP); alt { [] SIPP.receive (p_Response) -> value vc_response { tc_ack.stop; tc_resp.stop; f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response); vc_boo_response:=true; //setverdict(pass) } [] tc_ack.timeout [] tc_resp.timeout { vc_boo_response:=false; //setverdict (pass) Loading @@ -2620,17 +2629,17 @@ group AwaitingMessage { * @desc await INFO request * reply with 200 OK */ function f_awaitingINFO_sendReply(in template INFO_Request p_MSG) runs on SipComponent function f_awaitingINFO_sendReply(in template INFO_Request p_info) runs on SipComponent { var INFO_Request v_MSG; var INFO_Request v_request; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label [] SIPP.receive(p_info)-> value v_request sender vc_sent_label { tc_resp.stop; f_setHeadersOnReceiptOfRequest(v_MSG); tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_request); //Answer to the INFO f_send200OK(); } Loading Loading @@ -2738,12 +2747,12 @@ group AwaitingMessage { { var BYE_Request v_BYE_Request; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { []SIPP.receive (p_BYE) -> value v_BYE_Request sender vc_sent_label { tc_resp.stop; tc_wait.stop; vc_ignore_bye:= true; f_setHeadersOnReceiptOfBYE(v_BYE_Request); //f_send200OK(); Loading @@ -2761,12 +2770,12 @@ group AwaitingMessage { { var BYE_Request v_BYE_Request; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { []SIPP.receive (p_BYE) -> value v_BYE_Request sender vc_sent_label { tc_resp.stop; tc_wait.stop; vc_ignore_bye:= true; f_setHeadersOnReceiptOfBYE(v_BYE_Request); f_send200OK(); Loading @@ -2783,18 +2792,18 @@ group AwaitingMessage { { var BYE_Request v_BYE_Request; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { []SIPP.receive (p_BYE) -> value v_BYE_Request sender vc_sent_label { tc_resp.stop; tc_wait.stop; vc_ignore_bye:= true; vc_boo_request := true; f_setHeadersOnReceiptOfBYE(v_BYE_Request); f_send200OK(); } [] tc_resp.timeout [] tc_wait.timeout { vc_boo_request := false; } Loading @@ -2810,12 +2819,12 @@ group AwaitingMessage { { var CANCEL_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { []SIPP.receive (p_CANCEL) -> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); } } Loading @@ -2827,17 +2836,17 @@ group AwaitingMessage { { var MESSAGE_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); } [] SIPP.receive(mw_MESSAGE_Request_Base)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); log("Received MESSAGE not as expected!"); setverdict (fail); Loading @@ -2853,12 +2862,12 @@ group AwaitingMessage { { var MESSAGE_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(mw_MESSAGE_Request_Base)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); //Answer to the MESSAGE f_send200OK(); Loading @@ -2874,12 +2883,12 @@ group AwaitingMessage { { var MESSAGE_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); //Answer to the MESSAGE //f_send200OK(); Loading @@ -2887,7 +2896,7 @@ group AwaitingMessage { f_send200OK(); //setverdict (pass); } [] tc_resp.timeout [] tc_wait.timeout { vc_boo_request := false; //setverdict (pass); Loading @@ -2903,12 +2912,12 @@ group AwaitingMessage { { var NOTIFY_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_getRouteMapIntoRecordRoute(vc_cSeq, v_MSG); f_setHeadersOnReceiptOfRequest(v_MSG); //Answer to the NOTIFY Loading @@ -2925,12 +2934,12 @@ group AwaitingMessage { { var PRACK_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); //Answer to the PRACK f_send200OK(); Loading @@ -2947,12 +2956,12 @@ group AwaitingMessage { { var PUBLISH_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); //Answer to the PUBLISH f_send200OK(); Loading @@ -2968,12 +2977,12 @@ group AwaitingMessage { { var UPDATE_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); } } Loading @@ -2987,12 +2996,12 @@ group AwaitingMessage { { var UPDATE_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); //Answer to the UPDATE f_send200OK(); Loading @@ -3009,12 +3018,12 @@ group AwaitingMessage { { var REFER_Request v_MSG; tc_resp.start(PX_SIP_TRESP); tc_wait.start(PX_SIP_TWAIT); alt { [] SIPP.receive(p_MSG)-> value v_MSG sender vc_sent_label { tc_resp.stop; tc_wait.stop; f_setHeadersOnReceiptOfRequest(v_MSG); } } Loading Loading @@ -3340,12 +3349,12 @@ group Registration { { // receiving 401 Unauthorized response. // and Re-send REGISTER request with Authorization header tc_ack.start(PX_SIP_TACK); tc_resp.start(PX_SIP_TRESP); alt { [] SIPP.receive (mw_Response_Base(c_statusLine401, vc_callId, p_cSeq_s)) -> value vc_response { tc_ack.stop; tc_resp.stop; f_setHeadersOnReceiptOfResponse(p_cSeq_s, vc_response); // set headers via, cseq and authorization f_setHeaders_2ndREGISTER(p_cSeq_s); Loading @@ -3359,7 +3368,7 @@ group Registration { } [] SIPP.receive (mw_Response_Base(c_statusLine200, vc_callId, p_cSeq_s)) -> value vc_response { tc_ack.stop; tc_resp.stop; f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response); f_getServiceRouteMapIntoRouteInRegistration(p_cSeq_s, vc_response); log ("Authorization was not requested as expected"); Loading Loading @@ -3406,12 +3415,12 @@ group Registration { { // receiving 401 Unauthorized response. // and Re-send REGISTER request with Authorization header tc_ack.start(PX_SIP_TACK); tc_resp.start(PX_SIP_TRESP); alt { [] SIPP.receive (mw_Response_Base(c_statusLine401, vc_callIdReg, p_cSeq)) -> value vc_response { tc_ack.stop; tc_resp.stop; // set headers via, cseq and authorization f_setHeaders_2ndREGISTER(p_cSeq); v_request := m_REGISTER_Request_expires(vc_requestUri, vc_callIdReg, Loading @@ -3425,7 +3434,7 @@ group Registration { } [] SIPP.receive (mw_Response_Base(c_statusLine200, vc_callIdReg, p_cSeq))-> value vc_response { tc_ack.stop; tc_resp.stop; f_setHeadersOnReceiptOfResponse(vc_cSeq, vc_response); log ("Authorization was not requested as expected"); } Loading Loading @@ -3871,9 +3880,11 @@ group DefaultsTestStep [] 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_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 } Loading Loading @@ -3901,6 +3912,7 @@ group DefaultsTestStep { 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); } Loading @@ -3909,6 +3921,7 @@ group DefaultsTestStep { 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); } Loading Loading @@ -3940,12 +3953,12 @@ group DefaultsTestStep var Response v_Response; var Request v_Request := valueof (vc_requestFor407); tc_ack.start (PX_SIP_TACK); tc_resp.start (PX_SIP_TRESP); alt { [] SIPP.receive (mw_Response_Base((c_statusLine401,c_statusLine407), vc_callId, vc_cSeq)) -> value v_Response { tc_ack.stop; tc_resp.stop; // get tag from To header if available vc_to := v_Response.msgHeader.toField; if (vc_cSeq.method == "INVITE"){ Loading
ttcn/LibSip_Templates.ttcn +60 −28 Original line number Diff line number Diff line Loading @@ -645,7 +645,14 @@ module LibSip_Templates { fieldName := REQUIRE_E, optionsTags := {c_tagPrecond} }; } template SubscriptionState m_SubscriptionState_active := { fieldName := SUBSCRIPTION_STATE_E, subState := "active", substateParams := {{id:="expires",paramValue:="60000"}} } template Supported m_Supported_fromChange := { Loading Loading @@ -722,6 +729,12 @@ module LibSip_Templates toParams := * } template To mw_To(template SipUrl p_sipUrl) := { fieldName := TO_E, addressField := { nameAddr := {displayName := *, addrSpec := p_sipUrl}}, toParams:= * } template From mw_From(template SipUrl p_sipUrl) := { fieldName := FROM_E, addressField := { nameAddr := {displayName := *, addrSpec := p_sipUrl}}, Loading Loading @@ -809,6 +822,13 @@ module LibSip_Templates routeBody := p_routeBody }; template StatusLine mw_statusLine(template integer p_statusCode) := { sipVersion:=c_sipNameVersion, statusCode:=p_statusCode, reasonPhrase:=? }; template Supported mw_Supported_100rel_prec := { fieldName:=SUPPORTED_E, Loading Loading @@ -1306,9 +1326,6 @@ group base_templates{ requestLine := { requestUri := p_requestUri // { // hostPort:= p_requestUri.hostPort // } }, msgHeader := { Loading Loading @@ -1343,10 +1360,7 @@ group base_templates{ { requestLine := { requestUri := { hostPort:= p_requestUri.hostPort } requestUri := p_requestUri }, msgHeader := { Loading Loading @@ -1397,22 +1411,16 @@ group base_templates{ { requestLine := { requestUri := { hostPort:= p_requestUri.hostPort } requestUri := p_requestUri }, msgHeader := { callId := p_callId, //* contentLength := {fieldName := CONTENT_LENGTH_E, len:= f_MessageBodyLength(valueof(p_mb))}, //* contentType := {fieldName := CONTENT_TYPE_E, mediaType := c_sdpAplication}, cSeq := {fieldName:=CSEQ_E, seqNumber:= p_cSeq.seqNumber, method:= "NOTIFY"}, fromField := p_from, toField := p_to, via := p_via }//* , //* messageBody := p_mb } } template PRACK_Request m_PRACK_Request_Base (SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, Loading @@ -1421,10 +1429,7 @@ group base_templates{ { requestLine := { requestUri := { hostPort:= p_requestUri.hostPort } requestUri := p_requestUri }, msgHeader := { Loading @@ -1445,10 +1450,7 @@ group base_templates{ { requestLine := { requestUri := { hostPort:= p_requestUri.hostPort } requestUri := p_requestUri }, msgHeader := { Loading Loading @@ -1532,10 +1534,7 @@ group base_templates{ { requestLine := { requestUri := { hostPort:= p_requestUri.hostPort } requestUri := p_requestUri }, msgHeader := { Loading Loading @@ -1841,6 +1840,25 @@ group request_send { } } template NOTIFY_Request m_NOTIFY_Request_contact ( SipUrl p_requestUri, CallId p_callId, CSeq p_cSeq, From p_from, To p_to, Via p_via, Contact p_contact ) modifies m_NOTIFY_Request_Base := { msgHeader := { contact := p_contact, event := m_Event_reg, subscriptionState := m_SubscriptionState_active } } template NOTIFY_Request m_NOTIFY_Request_sipfrag ( SipUrl p_requestUri, CallId p_callId, Loading Loading @@ -1986,6 +2004,20 @@ group response_send { } } template Response m_Response_Contact ( StatusLine p_statusLine, CallId p_callId, CSeq p_cSeq, From p_from, To p_to, Via p_via, Contact p_contact ) modifies m_Response_Base:= { msgHeader := { contact := p_contact } } template Response m_Response_ext (StatusLine p_statusLine, CallId p_callId, CSeq p_cSeq, From p_from, To p_to, Via p_via, template Route p_route, template RecordRoute p_recordroute) modifies m_Response_Base:= { Loading