Commit 9d34ecdb authored by YannGarcia's avatar YannGarcia
Browse files

Bug fixed in SipPort.cc

parent 3a63b5e5
Loading
Loading
Loading
Loading
+56 −4
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@
#include "sip_codec_bye_request.hh"
#include "sip_codec_ack_request.hh"
#include "sip_codec_subscribe_request.hh"
#include "sip_codec_notify_request.hh"
#include "sip_codec_info_request.hh"
#include "sip_codec_message_request.hh"
#include "sip_codec_message_body.hh"
#include "sip_codec_response.hh"
@@ -126,7 +128,24 @@ namespace LibSip__EncdecDeclarations {

  BITSTRING fx__enc__CANCEL__Request(const LibSip__SIPTypesAndValues::CANCEL__Request& p) { return BITSTRING(); }
  BITSTRING fx__enc__PRACK__Request(const LibSip__SIPTypesAndValues::PRACK__Request& p) { return BITSTRING(); }
  BITSTRING fx__enc__NOTIFY__Request(const LibSip__SIPTypesAndValues::NOTIFY__Request& p) { return BITSTRING(); }
  BITSTRING fx__enc__NOTIFY__Request(const LibSip__SIPTypesAndValues::NOTIFY__Request& p) {
    loggers::get_instance().log_msg(">>> fx__enc__NOTIFY__Request: ", p);

    float duration;
    std::string tag("fx__enc__NOTIFY__Request");
    loggers::get_instance().set_start_time(tag);

    OCTETSTRING os;
    sip_codec_notify_request codec;
    if (codec.encode(p, os) == -1) {
      loggers::get_instance().warning("fx__enc__NOTIFY__Request: -1 result code was returned");
      return int2bit(0, 1);
    }
    loggers::get_instance().set_stop_time(tag, duration);

    return oct2bit(os);
  }

  BITSTRING fx__enc__SUBSCRIBE__Request(const LibSip__SIPTypesAndValues::SUBSCRIBE__Request& p) {
    loggers::get_instance().log_msg(">>> fx__enc__SUBSCRIBE__Request: ", p);

@@ -166,7 +185,24 @@ namespace LibSip__EncdecDeclarations {
  BITSTRING fx__enc__PUBLISH__Request(const LibSip__SIPTypesAndValues::PUBLISH__Request& p) { return BITSTRING(); }
  BITSTRING fx__enc__UPDATE__Request(const LibSip__SIPTypesAndValues::UPDATE__Request& p) { return BITSTRING(); }
  BITSTRING fx__enc__REFER__Request(const LibSip__SIPTypesAndValues::REFER__Request& p) { return BITSTRING(); }
  BITSTRING fx__enc__INFO__Request(const LibSip__SIPTypesAndValues::INFO__Request& p) { return BITSTRING(); }
  BITSTRING fx__enc__INFO__Request(const LibSip__SIPTypesAndValues::INFO__Request& p) {
    loggers::get_instance().log_msg(">>> fx__enc__INFO__Request: ", p);

    float duration;
    std::string tag("fx__enc__INFO__Request");
    loggers::get_instance().set_start_time(tag);

    OCTETSTRING os;
    sip_codec_info_request codec;
    if (codec.encode(p, os) == -1) {
      loggers::get_instance().warning("fx__enc__INFO__Request: -1 result code was returned");
      return int2bit(0, 1);
    }
    loggers::get_instance().set_stop_time(tag, duration);

    return oct2bit(os);
  }

  
  BITSTRING fx__enc__Response(const LibSip__SIPTypesAndValues::Response& p) {
    loggers::get_instance().log_msg(">>> fx__enc__Response: ", p);
@@ -269,7 +305,15 @@ namespace LibSip__EncdecDeclarations {

  INTEGER fx__dec__CANCEL__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::CANCEL__Request& p) { return INTEGER(0); }
  INTEGER fx__dec__PRACK__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::PRACK__Request& p) { return INTEGER(0); }
  INTEGER fx__dec__NOTIFY__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::NOTIFY__Request& p) { return INTEGER(0); }
  INTEGER fx__dec__NOTIFY__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::NOTIFY__Request& p) {
    loggers::get_instance().log_msg(">>> fx__dec__NOTIFY__Request: ", pdu);

    OCTETSTRING os = bit2oct(pdu);
    sip_codec_notify_request codec;
    codec.decode(os, p);

    return 0;
  }

  INTEGER fx__dec__SUBSCRIBE__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::SUBSCRIBE__Request& p) {
    loggers::get_instance().log_msg(">>> fx__dec__SUBSCRIBE__Request: ", pdu);
@@ -294,7 +338,15 @@ namespace LibSip__EncdecDeclarations {
  INTEGER fx__dec__PUBLISH__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::PUBLISH__Request& p) { return INTEGER(0); }
  INTEGER fx__dec__UPDATE__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::UPDATE__Request& p) { return INTEGER(0); }
  INTEGER fx__dec__REFER__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::REFER__Request& p) { return INTEGER(0); }
  INTEGER fx__dec__INFO__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::INFO__Request& p) { return INTEGER(0); }
  INTEGER fx__dec__INFO__Request(BITSTRING& pdu, LibSip__SIPTypesAndValues::INFO__Request& p) {
    loggers::get_instance().log_msg(">>> fx__dec__INFO__Request: ", pdu);

    OCTETSTRING os = bit2oct(pdu);
    sip_codec_info_request codec;
    codec.decode(os, p);

    return 0;
  }

  INTEGER fx__dec__Response(BITSTRING& pdu, LibSip__SIPTypesAndValues::Response& p) {
    loggers::get_instance().log_msg(">>> fx__dec__Response: ", pdu);
+5 −1
Original line number Diff line number Diff line
@@ -97,11 +97,15 @@ namespace LibSip__Interface {
    if (p_ind.requestLine().method() == LibSip__SIPTypesAndValues::Method::INVITE__E) {
      incoming_message(LibSip__SIPTypesAndValues::INVITE__Request(p_ind.requestLine(), p_ind.msgHeader(), p_ind.messageBody(), p_ind.payload()));
    } else if (p_ind.requestLine().method() == LibSip__SIPTypesAndValues::Method::SUBSCRIBE__E) {
      incoming_message(LibSip__SIPTypesAndValues::INVITE__Request(p_ind.requestLine(), p_ind.msgHeader(), p_ind.messageBody(), p_ind.payload()));
      incoming_message(LibSip__SIPTypesAndValues::SUBSCRIBE__Request(p_ind.requestLine(), p_ind.msgHeader(), p_ind.messageBody(), p_ind.payload()));
    } else if (p_ind.requestLine().method() == LibSip__SIPTypesAndValues::Method::NOTIFY__E) {
      incoming_message(LibSip__SIPTypesAndValues::NOTIFY__Request(p_ind.requestLine(), p_ind.msgHeader(), p_ind.messageBody(), p_ind.payload()));
    } else if (p_ind.requestLine().method() == LibSip__SIPTypesAndValues::Method::BYE__E) {
      incoming_message(LibSip__SIPTypesAndValues::BYE__Request(p_ind.requestLine(), p_ind.msgHeader(), p_ind.messageBody(), p_ind.payload()));
    } else if (p_ind.requestLine().method() == LibSip__SIPTypesAndValues::Method::INFO__E) {
      incoming_message(LibSip__SIPTypesAndValues::INFO__Request(p_ind.requestLine(), p_ind.msgHeader(), p_ind.messageBody(), p_ind.payload()));
    } else if (p_ind.requestLine().method() == LibSip__SIPTypesAndValues::Method::OPTIONS__E) {
      incoming_message(LibSip__SIPTypesAndValues::OPTIONS__Request(p_ind.requestLine(), p_ind.msgHeader(), p_ind.messageBody(), p_ind.payload()));
    } else {
      incoming_message(p_ind);
    }
+15 −16
Original line number Diff line number Diff line
@@ -15,4 +15,3 @@ sources := \
        sip_codec_response.cc \
        sip_layer.cc
includes := .
+43 −44
Original line number Diff line number Diff line
[MODULE_PARAMETERS]
# This section shall contain the values of all parameters that are defined in your TTCN-3 modules.

# IUT roles
LibNg112_Pics.PICS_LIS_IUT  := false;
LibNg112_Pics.PICS_ECRF_IUT := false;
LibNg112_Pics.PICS_ESRP_IUT := true;
LibNg112_Pics.PICS_PSAP_IUT := false;

LibCommon_Time.PX_TAC := 30.0
LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0;
LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0;
@@ -14,8 +8,8 @@ LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0;
LibItsHttp_Pics.PICS_HEADER_HOST := "lis1.gridgears.plugtests.net" # Used for LIS
#LibItsHttp_Pics.PICS_HEADER_HOST := "ecrf1.gridgears.plugtests.net" # Used for ECRF

LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/held+xml;charset=utf-8"
#LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/lost+xml;charset=utf-8"
#LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/held+xml;charset=utf-8"
LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/lost+xml;charset=utf-8"

#LibNg112_Pics.PICS_HTTP_GET_REQUEST := false
#LibNg112_Pics.PICS_HTTP_POST_REQUEST := false
@@ -24,8 +18,8 @@ LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/held+xml;charset=utf-8"
LibSip_PIXITS.PX_SIP_REGISTRATION := true;
#LibSip_PIXITS.PX_SEED            := true;

LibSip_PIXITS.PX_PRESENCE_USER     := "sip:alice-06@plugtests.net"
LibSip_PIXITS.PX_PRESENCE_USER_POS := { 43.623013240241434, 7.046184539794921 }; // ALICE6 position
LibNg112_Pixits.PX_PRESENCE_USER     := "sip:alice-06@plugtests.net"
LibNg112_Pixits.PX_PRESENCE_USER_POS := { 43.623013240241434, 7.046184539794921 }; // ALICE6 position

[LOGGING]
# In this section you can specify the name of the log file and the classes of events
@@ -45,11 +39,13 @@ LogEventTypes:= Yes
# In this section you can specify parameters that are passed to Test Ports.

# ECRF
Ecrf.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server=ecrf1.gridgears.plugtests.net,use_ssl=1)"
#Ecrf.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server=ecrf1.gridgears.plugtests.net,use_ssl=1)"
Ecrf.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server_mode=1,local_port=8080,use_ssl=0)"

# SIP/PSAP
Ue.SIPP.params := "SIP/TCP(debug=1,server=esrp1.frequentis.plugtests.net,port=5071,use_ssl=0)"
Psap.SIPP.params := "SIP/TCP(debug=1,server_mode=1,local_port=5061,use_ssl=0)"
#Ue.SIPP.params := "SIP/TCP(debug=1,server=esrp1.frequentis.plugtests.net,port=5071,use_ssl=0)"
Ue.SIPP.params := "SIP/TCP(debug=1,server=127.0.0.1,port=5071,use_ssl=0)"
Psap.SIPP.params := "SIP/TCP(debug=1,server_mode=1,local_port=5062,use_ssl=0)"

[DEFINE]
# In this section you can create macro definitions,
@@ -74,68 +70,71 @@ Psap.SIPP.params := "SIP/TCP(debug=1,server_mode=1,local_port=5061,use_ssl=0)"

[EXECUTE]
# In this section you can specify what parts of your test suite you want to execute.
AtsNg112_TestControl.control
AtsESRP_TestControl.control

# "IUT successfully forwards an incoming SIP INVITE to the correct downstream element, based on the ECRF response"
#AtsESRP_TestCases.TC_ESRP_FIND_SERVICE_BV_01

# "IUT successfully responds with a Point when it receives a HTTP POST location request without location type"
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_01
#AtsESRP_TestCases.TC_LIS_HTTP_POST_BV_01
# "IUT successfully responds with a Circle when it receives a HTTP POST location request without location type"
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_02
#AtsESRP_TestCases.TC_LIS_HTTP_POST_BV_02
# "IUT successfully responds with a reference when it receives a HTTP POST location request with location type locationURI and exact attribute"
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_03
#AtsESRP_TestCases.TC_LIS_HTTP_POST_BV_03
# "IUT successfully responds with a reference and geodetic location when it receives a HTTP POST location request with location types locationURI and geodetic and exact attribute"
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_04
#AtsESRP_TestCases.TC_LIS_HTTP_POST_BV_04
# "IUT successfully responds with an error response when it receives a HTTP POST location request for an unknown device"
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_05
#AtsESRP_TestCases.TC_LIS_HTTP_POST_BV_05
# "IUT successfully responds with a CIVIC address when it receives a HTTP POST location request without location type"
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_06
#AtsESRP_TestCases.TC_LIS_HTTP_POST_BV_06
# "IUT successfully responds with an error response when it receives a HTTP POST location request with an unknown location type"
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_07
#AtsESRP_TestCases.TC_LIS_HTTP_POST_BV_07
# "IUT successfully returns the location when a locationURI is dereferenced"
#AtsNg112_TestCases.TC_LIS_HTTP_GET_BV_01
#AtsESRP_TestCases.TC_LIS_HTTP_GET_BV_01
# "IUT returns HTTP error 404 if it does not support HTTP GET method"
#AtsNg112_TestCases.TC_LIS_HTTP_GET_BV_02
#AtsESRP_TestCases.TC_LIS_HTTP_GET_BV_02
# "IUT successfully responds with a service URI for a Point in the service boundary"
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_01
#AtsESRP_TestCases.TC_ECRF_HTTP_POST_BV_01
# "IUT successfully responds with a service URI for a Circle in the service boundary"
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_02
#AtsESRP_TestCases.TC_ECRF_HTTP_POST_BV_02
# "IUT successfully responds with an error response for an unknown Service URN in the service boundary"
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_03
#AtsESRP_TestCases.TC_ECRF_HTTP_POST_BV_03
# "IUT successfully responds with an error response for an unrecognized location profile"
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_04
#AtsESRP_TestCases.TC_ECRF_HTTP_POST_BV_04
# "IUT successfully responds with service boundary by value if requested"
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_05
#AtsESRP_TestCases.TC_ECRF_HTTP_POST_BV_05
# "IUT successfully responds with service URI for a Circle that intersects service boundary"
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_06
#AtsESRP_TestCases.TC_ECRF_HTTP_POST_BV_06
# "IUT successfully responds with a service URI for a Circle that intersects multiple service boundaries"
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_07
#AtsESRP_TestCases.TC_ECRF_HTTP_POST_BV_07
# "IUT successfully responds with a service URI for a Circle in the service boundary with multiple services"
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_08
#AtsESRP_TestCases.TC_ECRF_HTTP_POST_BV_08
# "IUT successfully responds with configured service types for a ListServices request"
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_09
#AtsESRP_TestCases.TC_ECRF_HTTP_POST_BV_09
# "IUT successfully responds with configured service types for a ListServicesByLocation request"
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_10
#AtsESRP_TestCases.TC_ECRF_HTTP_POST_BV_10
# "IUT successfully responds with configured service types for a ListServices request without service element"
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_11
#AtsESRP_TestCases.TC_ECRF_HTTP_POST_BV_11
# "IUT successfully responds with configured service types for a ListServicesByLocation request without service element"
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_12
#AtsESRP_TestCases.TC_ECRF_HTTP_POST_BV_12
# "IUT successfully forwards an incoming SIP INVITE to the correct downstream element, based on the ECRF response"
AtsNg112_TestCases.TC_ESRP_SIP_INVITE_BV_01
#AtsESRP_TestCases.TC_ESRP_SIP_INVITE_BV_01
# "IUT successfully handles SIP INVITE with service urn and ULAW via UDP"
#AtsNg112_TestCases.TC_PSAP_SIP_INVITE_BV_01
#AtsESRP_TestCases.TC_PSAP_SIP_INVITE_BV_01
# "IUT successfully handles SIP INVITE with service urn and ULAW via UDP"
#AtsNg112_TestCases.TC_PSAP_SIP_INVITE_BV_02
#AtsESRP_TestCases.TC_PSAP_SIP_INVITE_BV_02
# "IUT successfully handles SIP INVITE with service urn via TCP"
#AtsNg112_TestCases.TC_PSAP_SIP_INVITE_BV_03
#AtsESRP_TestCases.TC_PSAP_SIP_INVITE_BV_03
# "IUT successfully handles SIP INVITE with SDP and PIDF-LO content"
#AtsNg112_TestCases.TC_PSAP_SIP_INVITE_BV_04
#AtsESRP_TestCases.TC_PSAP_SIP_INVITE_BV_04
# "IUT successfully handles SIP INVITE without service URN"
#AtsNg112_TestCases.TC_PSAP_SIP_INVITE_BV_05
#AtsESRP_TestCases.TC_PSAP_SIP_INVITE_BV_05
# "IUT successfully handles an incoming SIP BYE"
#AtsNg112_TestCases.TC_PSAP_SIP_INVITE_BV_06
#AtsESRP_TestCases.TC_PSAP_SIP_INVITE_BV_06
# "IUT successfully handles an incoming SIP MESSAGE"
#AtsNg112_TestCases.TC_PSAP_SIP_INVITE_BV_07
#AtsESRP_TestCases.TC_PSAP_SIP_INVITE_BV_07
# "IUT successfully handles an incoming SIP OPTION"
#AtsNg112_TestCases.TC_PSAP_SIP_INVITE_BV_08
#AtsESRP_TestCases.TC_PSAP_SIP_INVITE_BV_08

[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
+7 −7
Original line number Diff line number Diff line
@@ -72,19 +72,19 @@ system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debu
#AtsLIS_TestControl.control

# "IUT successfully responds with a Point when it receives a HTTP POST location request without location type"
AtsLIS_TestCases.TC_LIS_HTTP_POST_BV_01
AtsLIS_TestCases.TC_LIS_HELD_BV_01
# "IUT successfully responds with a Circle when it receives a HTTP POST location request without location type"
#AtsLIS_TestCases.TC_LIS_HTTP_POST_BV_02
#AtsLIS_TestCases.TC_LIS_HELD_BV_02
# "IUT successfully responds with a reference when it receives a HTTP POST location request with location type locationURI and exact attribute"
#AtsLIS_TestCases.TC_LIS_HTTP_POST_BV_03
#AtsLIS_TestCases.TC_LIS_HELD_BV_03
# "IUT successfully responds with a reference and geodetic location when it receives a HTTP POST location request with location types locationURI and geodetic and exact attribute"
#AtsLIS_TestCases.TC_LIS_HTTP_POST_BV_04
#AtsLIS_TestCases.TC_LIS_HELD_BV_04
# "IUT successfully responds with an error response when it receives a HTTP POST location request for an unknown device"
#AtsLIS_TestCases.TC_LIS_HTTP_POST_BV_05
#AtsLIS_TestCases.TC_LIS_HELD_BV_05
# "IUT successfully responds with a CIVIC address when it receives a HTTP POST location request without location type"
#AtsLIS_TestCases.TC_LIS_HTTP_POST_BV_06
#AtsLIS_TestCases.TC_LIS_HELD_BV_06
# "IUT successfully responds with an error response when it receives a HTTP POST location request with an unknown location type"
#AtsLIS_TestCases.TC_LIS_HTTP_POST_BV_07
#AtsLIS_TestCases.TC_LIS_HELD_BV_07
# "IUT successfully returns the location when a locationURI is dereferenced"
#AtsLIS_TestCases.TC_LIS_HTTP_GET_BV_01
# "IUT returns HTTP error 404 if it does not support HTTP GET method"
Loading