Commit 7edddc66 authored by garciay's avatar garciay
Browse files

Merge code with STF467

parent a27cb193
Loading
Loading
Loading
Loading
+39 −20
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ module LibSip_Steps {
                        { id := "uri", paramValue := v_uri },
                        { id := "nonce=""""", paramValue := omit }, // already enclosed to " characters
                        { id := "response=""""", paramValue := omit }, // already enclosed to " characters
                        { id := "algorithm=""""", paramValue := PX_AUTH_ALGORITHM } // already enclosed to " characters
                        { id := "algorithm", paramValue := PX_AUTH_ALGORITHM } // already enclosed to " characters
                    }
                };
            }
@@ -1071,8 +1071,9 @@ module LibSip_Steps {
            /**
             * @desc function sets header field for the next outgoing REGISTER message
             * @param p_cSeq_s CSeq parameter to be applied
             * @param p_emergency Set to true in case of emergency
             */
            function f_setHeaders_REGISTER(inout CSeq p_cSeq_s) runs on SipComponent  {
            function f_setHeaders_REGISTER(inout CSeq p_cSeq_s, boolean p_emergency := false) runs on SipComponent  {
                var SemicolonParam_List v_params;

                f_setHeadersGeneral(p_cSeq_s, "REGISTER"); //     cseq, contact, branch, via
@@ -1094,9 +1095,14 @@ module LibSip_Steps {
                vc_from := {fieldName := FROM_E, addressField := vc_to.addressField, fromParams := v_params};

                if (not vc_firstREGISTER_sent) {
                    if (p_emergency) {
                        v_params := { { "sos", omit } };
                        vc_contact.contactBody.contactAddresses[0].addressField.addrSpecUnion.urlParameters := v_params;
                    } else {
                        v_params := { { id := c_expiresId, paramValue := c_shortRegistration } };
                        vc_contact.contactBody.contactAddresses[0].contactParams := v_params;
                    }
                }

                vc_firstREGISTER_sent := true; //     f_setHeaders_Register is called in deREGISTER function
                vc_authorization := {fieldName := AUTHORIZATION_E, body := {f_calculatecCredentials_empty(vc_userprofile)}};
@@ -1231,8 +1237,16 @@ module LibSip_Steps {

                vc_caller_From := vc_from;

                if (ischosen(vc_requestUri.components.sip)) { // sip/sips call
                    vc_reqHostPort := vc_requestUri.components.sip.hostPort;
            } // end function f_setHeadersINVITE
                } else if (ischosen(vc_requestUri.components.urn)) { // Emergency call
                    vc_reqUrnUri := vc_requestUri.components.urn;
                } else {
                    log ("f_setHeadersINVITE: unsupported field: ", vc_requestUri);
                    setverdict(fail);
                }
                
      }             } // end function f_setHeadersINVITE

            /**
             * @desc setting of general and basic Update header fields in additon to the addresses (To, From, ReqUri)
@@ -3438,10 +3452,11 @@ module LibSip_Steps {
         * @param p_cSeq_s cseq parameter
         * @param p_register register template
         * @param p_auth flag indicating if authentication is needed
         * @param p_emergency Set to true in case of emergency call
         */
        function f_Registration(inout CSeq p_cSeq_s, out template(value) REGISTER_Request p_register, in boolean p_auth) runs on SipComponent  {
        function f_Registration(inout CSeq p_cSeq_s, out template(value) REGISTER_Request p_register, in boolean p_auth, in boolean p_emergency := false) runs on SipComponent  {
            if (PX_SIP_REGISTRATION) {
                f_setHeaders_REGISTER(p_cSeq_s); //     TODO need if p_register not set
                f_setHeaders_REGISTER(p_cSeq_s, p_emergency); //     TODO need if p_register not set
                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
@@ -4096,23 +4111,27 @@ module LibSip_Steps {
            //     catch 4xx response
            [] SIPP.receive(mw_Response_Base(mw_statusLine4xx, vc_callId, ?)) -> value v_response sender vc_sent_label {
                setverdict(fail);
                if(v_response.msgHeader.cSeq.method == "INVITE") {
                    v_cSeq := valueof(v_response.msgHeader.cSeq);
                    f_setHeadersOnReceiptOfResponse(v_cSeq, v_response); //     CSeq is mandatory
                    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));
                    //     TODO STF471 do we need an update here???
                    //     f_RemoveRegistration(p_cSeq_s);
                }
                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);
                if(v_response.msgHeader.cSeq.method == "INVITE") {
                    v_cSeq := valueof(v_response.msgHeader.cSeq);
                    f_setHeadersOnReceiptOfResponse(v_cSeq, v_response); //     CSeq is mandatory
                    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));
                    //     TODO STF471 do we need an update here???
                    //     f_RemoveRegistration(p_cSeq_s);
                }
                f_RemoveRegistration(vc_cSeq);
            }
            //     catch invalid REGISTER
+967 −436

File changed.

Preview size limit exceeded, changes collapsed.