diff --git a/include/call.hpp b/include/call.hpp index f5fa0728..07f54a15 100644 --- a/include/call.hpp +++ b/include/call.hpp @@ -77,8 +77,8 @@ class call : virtual public task, virtual public listener, public virtual socket public: /* These are wrappers for various circumstances, (private) init does the real work. */ //call(char * p_id, int userId, bool ipv6, bool isAutomatic); - call(const char *p_id, bool use_ipv6, int userId, struct sockaddr_storage *dest); - call(const char *p_id, SIPpSocket *socket, struct sockaddr_storage *dest); + call(scenario *call_scenario, const char *p_id, bool use_ipv6, int userId, struct sockaddr_storage *dest); + call(scenario *call_scenario, const char *p_id, SIPpSocket *socket, struct sockaddr_storage *dest); static call *add_call(int userId, bool ipv6, struct sockaddr_storage *dest); call(scenario * call_scenario, SIPpSocket *socket, struct sockaddr_storage *dest, const char * p_id, int userId, bool ipv6, bool isAutomatic, bool isInitCall); diff --git a/include/fileutil.h b/include/fileutil.h index 3b54ef7b..c2e502f5 100644 --- a/include/fileutil.h +++ b/include/fileutil.h @@ -22,7 +22,7 @@ extern "C" { #endif -char* find_file(const char* filename); +char* find_file(const char* filename, const char *basepath); #ifdef __cplusplus } diff --git a/include/scenario.hpp b/include/scenario.hpp index c35b7f4f..9b05995b 100644 --- a/include/scenario.hpp +++ b/include/scenario.hpp @@ -44,6 +44,7 @@ #define MODE_CLIENT 0 #define MODE_SERVER 1 +#define MODE_MIXED 2 #define MODE_3PCC_NONE 0 #define MODE_3PCC_CONTROLLER_A 2 @@ -190,6 +191,9 @@ class scenario int get_counter(const char *varName, const char *what); int get_rtd(const char *ptr, bool start); int find_var(const char *varName); + void setFileName(const char *fileName); + const std::string &getFileName() const { return fileName; } + const std::string &getPath() const { return path; } void addRtpTaskThreadID(pthread_t id); void removeRtpTaskThreadID(pthread_t id); @@ -205,6 +209,8 @@ class scenario str_int_map initLabelMap; str_int_map txnMap; + std::string fileName; + std::string path; bool found_timewait; @@ -232,6 +238,7 @@ class scenario /* There are external variable containing the current scenario */ extern scenario *main_scenario; +extern scenario *rx_scenario; extern scenario *ooc_scenario; extern scenario *aa_scenario; extern scenario *display_scenario; diff --git a/include/send_packets.h b/include/send_packets.h index 823319d1..027b8247 100644 --- a/include/send_packets.h +++ b/include/send_packets.h @@ -124,7 +124,7 @@ typedef struct { extern "C" { #endif - int parse_play_args(const char*, pcap_pkts*); + int parse_play_args(const char*, const char*, pcap_pkts*); int parse_dtmf_play_args(const char*, pcap_pkts*, uint16_t start_seq_no); void free_pcaps(pcap_pkts* pkts); void send_packets(play_args_t*); diff --git a/include/sipp.hpp b/include/sipp.hpp index 69695a3a..26e33a26 100644 --- a/include/sipp.hpp +++ b/include/sipp.hpp @@ -326,13 +326,14 @@ MAYBE_EXTERN double tls_version DEFVAL(0.0); MAYBE_EXTERN const char * bind_to_device_name DEFVAL(nullptr); #endif -MAYBE_EXTERN char* scenario_file DEFVAL(nullptr); -MAYBE_EXTERN char* scenario_path DEFVAL(nullptr); +MAYBE_EXTERN const char * scenario_file DEFVAL(nullptr); // extern field file management typedef std::map file_map; MAYBE_EXTERN file_map inFiles; typedef std::map file_index; +MAYBE_EXTERN char *rx_ip_file DEFVAL(nullptr); +MAYBE_EXTERN char *rx_default_file DEFVAL(nullptr); MAYBE_EXTERN char *ip_file DEFVAL(nullptr); MAYBE_EXTERN char *default_file DEFVAL(nullptr); diff --git a/src/actions.cpp b/src/actions.cpp index 6485030b..c5420571 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -539,7 +539,7 @@ void CAction::setPcapArgs(const char* P_value) if (P_value != nullptr) { M_pcapArgs = (pcap_pkts *) malloc(sizeof(*M_pcapArgs)); - if (parse_play_args(P_value, M_pcapArgs) == -1) { + if (parse_play_args(P_value, M_scenario->getPath().c_str(), M_pcapArgs) == -1) { ERROR("Play pcap error"); } if (access(M_pcapArgs->file, F_OK)) { @@ -712,7 +712,7 @@ void CAction::setRTPStreamActInfo(const char *P_value) // Lookup best file match if (pattern_mode == 0) { - found_file = find_file(argument_buf); + found_file = find_file(argument_buf, M_scenario->getPath().c_str()); if (found_file) { if (strlen(found_file) >= sizeof(M_rtpstream_actinfo.filename)) { ERROR("Filename/Pattern keyword %s is too long -- maximum supported length %zu", diff --git a/src/call.cpp b/src/call.cpp index aa5c6fa8..fdcf892a 100644 --- a/src/call.cpp +++ b/src/call.cpp @@ -785,14 +785,14 @@ unsigned long call::hash(const char * msg) } /******************* Call class implementation ****************/ -call::call(const char *p_id, bool use_ipv6, int userId, struct sockaddr_storage *dest) : listener(p_id, true) +call::call(scenario *call_scenario, const char *p_id, bool use_ipv6, int userId, struct sockaddr_storage *dest) : listener(p_id, true) { - init(main_scenario, nullptr, dest, p_id, userId, use_ipv6, false, false); + init(call_scenario, nullptr, dest, p_id, userId, use_ipv6, false, false); } -call::call(const char *p_id, SIPpSocket *socket, struct sockaddr_storage *dest) : listener(p_id, true) +call::call(scenario *call_scenario, const char *p_id, SIPpSocket *socket, struct sockaddr_storage *dest) : listener(p_id, true) { - init(main_scenario, socket, dest, p_id, 0 /* No User. */, socket->ss_ipv6, false /* Not Auto. */, false); + init(call_scenario, socket, dest, p_id, 0 /* No User. */, socket->ss_ipv6, false /* Not Auto. */, false); } call::call(scenario * call_scenario, SIPpSocket *socket, struct sockaddr_storage *dest, const char * p_id, int userId, bool ipv6, bool isAutomatic, bool isInitialization) : listener(p_id, true) @@ -6832,7 +6832,7 @@ void *send_wrapper(void *arg) class mockcall : public call { public: - mockcall(bool is_ipv6) : listener("//testing", true), call("///testing", is_ipv6, 0, nullptr) {} + mockcall(bool is_ipv6) : listener("//testing", true), call(main_scenario, "///testing", is_ipv6, 0, nullptr) {} /* Helpers to poke at protected internals */ void parse_media_addr(std::string const& msg) { get_remote_media_addr(msg); } diff --git a/src/fileutil.c b/src/fileutil.c index 38fadd5d..cdaa051f 100644 --- a/src/fileutil.c +++ b/src/fileutil.c @@ -22,8 +22,6 @@ #include #include -extern char* scenario_path; - int expand_user_path(const char* path, char* expanded_home_path /*The buffer*/, size_t buflen) { if (path[0] != '~') { /* We have nothing to expand here */ @@ -79,7 +77,7 @@ int expand_user_path(const char* path, char* expanded_home_path /*The buffer*/, return 1; } -char* find_file(const char* filename) +char* find_file(const char* filename, const char *basepath) { char tmppath[MAX_PATH]; tmppath[0] = '\0'; @@ -88,13 +86,13 @@ char* find_file(const char* filename) filepathptr = filename; } - if (filepathptr[0] == '/' || !*scenario_path) { + if (filepathptr[0] == '/' || !*basepath) { return strdup(filepathptr); } - size_t len = strlen(scenario_path) + strlen(filepathptr) + 1; + size_t len = strlen(basepath) + strlen(filepathptr) + 1; char* fullpath = malloc(len); - snprintf(fullpath, len, "%s%s", scenario_path, filepathptr); + snprintf(fullpath, len, "%s%s", basepath, filepathptr); if (access(fullpath, R_OK) < 0) { free(fullpath); diff --git a/src/scenario.cpp b/src/scenario.cpp index e0e3915b..63bad218 100644 --- a/src/scenario.cpp +++ b/src/scenario.cpp @@ -135,6 +135,7 @@ message::~message() /******** Global variables which compose the scenario file **********/ +scenario *rx_scenario; scenario *main_scenario; scenario *ooc_scenario; scenario *aa_scenario; @@ -409,6 +410,25 @@ void scenario::addRtpTaskThreadID(pthread_t id) threadIDs[id] = "threadID"; } +void scenario::setFileName(const char *name) +{ + const char* sep = strrchr(name, '/'); + if (sep) { + ++sep; // include slash + path = std::string(name, sep - name); + } else { + path.clear(); + sep = name; + } + const char* ext = strrchr(sep, '.'); + if (ext && strcmp(ext, ".xml") == 0) { + fileName = std::string(sep, ext - sep); + } else { + fileName = sep; + } + stats->setFileName(fileName.c_str(), ".csv"); +} + void scenario::removeRtpTaskThreadID(pthread_t id) { threadIDs.erase(id); @@ -696,6 +716,9 @@ scenario::scenario(char * filename, int deflt) stats = new CStat(); allocVars = new AllocVariableTable(userVariables); + if(filename) { + setFileName(filename); + } hidedefault = false; elem = xp_open_element(0); @@ -1247,7 +1270,9 @@ void scenario::computeSippMode() bool isRecvCmdFound = false; bool isSendCmdFound = false; - creationMode = -1; + if (creationMode != MODE_MIXED) { + creationMode = -1; + } sendMode = -1; thirdPartyMode = MODE_3PCC_NONE; diff --git a/src/screen.cpp b/src/screen.cpp index 7e53eece..bb15a2ad 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -80,6 +80,17 @@ void print_statistics(int last) } } +static bool display_client() +{ + return (creationMode == MODE_CLIENT) || ((creationMode == MODE_MIXED) && (display_scenario == main_scenario)); +} + +static bool display_server() +{ + return (creationMode == MODE_SERVER) || ((creationMode == MODE_MIXED) && (display_scenario == rx_scenario)); +} + + void ScreenPrinter::print_closing_stats() { M_last = true; get_lines(); @@ -220,6 +231,10 @@ void ScreenPrinter::get_lines() ERROR("Internal error: creationMode=%d, thirdPartyMode=%d", creationMode, thirdPartyMode); } + } else if((creationMode == MODE_MIXED) && (display_scenario == main_scenario)) { + lines.push_back("----------------Sipp Mixed Mode - main - call originating scenario------------"); + } else if((creationMode == MODE_MIXED) && (display_scenario == rx_scenario)) { + lines.push_back("-----------------Sipp Mixed mode - rx - call terminating screnario-------------"); } else { assert(creationMode == MODE_SERVER); switch (thirdPartyMode) { @@ -270,14 +285,14 @@ void ScreenPrinter::draw_scenario_screen() unsigned long long total_calls = display_scenario->stats->GetStat(CStat::CPT_C_IncomingCallCreated) + display_scenario->stats->GetStat(CStat::CPT_C_OutgoingCallCreated); - if (creationMode == MODE_SERVER) { + if (display_server()) { lines.push_back(" Port Total-time Total-calls Transport"); snprintf(buf, bufsiz, " %-5d %6lu.%02lu s %8llu %s", local_port, clock_tick / 1000, (clock_tick % 1000) / 10, total_calls, TRANSPORT_TO_STRING(transport)); lines.push_back(buf); } else { - assert(creationMode == MODE_CLIENT); + assert(display_client()); if (users >= 0) { lines.push_back(" Users (length) Port Total-time " "Total-calls Remote-host"); @@ -320,7 +335,7 @@ void ScreenPrinter::draw_scenario_screen() lines.push_back(buf); /* 2nd line */ - if (creationMode == MODE_SERVER) { + if (display_server()) { snprintf(left_buf, 40, "%llu calls", display_scenario->stats->GetStat(CStat::CPT_C_CurrentCall)); } else { @@ -342,7 +357,7 @@ void ScreenPrinter::draw_scenario_screen() /* 3rd line dead call msgs, and optional out-of-call msg */ snprintf(left_buf, 40, "%llu dead call msg (discarded)", display_scenario->stats->GetStat(CStat::CPT_G_C_DeadCallMsgs)); - if (creationMode == MODE_CLIENT) { + if (display_client()) { snprintf( buf, bufsiz, " %-38s %llu out-of-call msg (discarded)", left_buf, display_scenario->stats->GetStat(CStat::CPT_G_C_OutOfCallMsgs)); @@ -479,7 +494,7 @@ void ScreenPrinter::draw_scenario_screen() int buf_len = 0; if (SendingMessage* src = curmsg->send_scheme) { - if (creationMode == MODE_SERVER) { + if (display_server()) { if (src->isResponse()) { buf_len += snprintf(buf + buf_len, bufsiz - buf_len, " <---------- %-10d ", src->getCode()); @@ -527,7 +542,7 @@ void ScreenPrinter::draw_scenario_screen() : ""); } } else if (curmsg->recv_response) { - if (creationMode == MODE_SERVER) { + if (display_server()) { buf_len += snprintf(buf + buf_len, bufsiz - buf_len, " ----------> %-10d ", curmsg->recv_response); } else { @@ -570,7 +585,7 @@ void ScreenPrinter::draw_scenario_screen() } int len = strlen(desc) < 9 ? 9 : strlen(desc); - if (creationMode == MODE_SERVER) { + if (display_server()) { snprintf(left_buf, 40, " [%9s] Pause%*s", desc, 23 - len > 0 ? 23 - len : 0, ""); } else { @@ -583,7 +598,7 @@ void ScreenPrinter::draw_scenario_screen() curmsg->sessions, curmsg->nb_unexp); } else if (curmsg->recv_request) { - if (creationMode == MODE_SERVER) { + if (display_server()) { buf_len += snprintf(buf + buf_len, bufsiz - buf_len, " ----------> %-10s ", curmsg->recv_request); diff --git a/src/send_packets.c b/src/send_packets.c index 7ef6338b..9c92db27 100644 --- a/src/send_packets.c +++ b/src/send_packets.c @@ -93,9 +93,9 @@ float2timer(float time, struct timeval *tvp) tvp->tv_usec = n * 100000; } -int parse_play_args(const char* filename, pcap_pkts* pkts) +int parse_play_args(const char* filename, const char *basepath, pcap_pkts* pkts) { - pkts->file = find_file(filename); + pkts->file = find_file(filename, basepath); prepare_pkts(pkts->file, pkts); return 1; } diff --git a/src/sipp.cpp b/src/sipp.cpp index bbf0e467..5fbe3564 100644 --- a/src/sipp.cpp +++ b/src/sipp.cpp @@ -118,6 +118,8 @@ struct sipp_option { #define SIPP_OPTION_LFOVERWRITE 37 #define SIPP_OPTION_PLUGIN 38 #define SIPP_OPTION_NEED_SCTP 39 +#define SIPP_OPTION_RX_SCENARIO 40 +#define SIPP_OPTION_RX_INPUT_FILE 41 #define SIPP_HELP_TEXT_HEADER 255 /* Put each option, its help text, and type in this table. */ @@ -128,6 +130,9 @@ struct sipp_option options_table[] = { {"", "Scenario file options:", SIPP_HELP_TEXT_HEADER, nullptr, 0}, {"sd", "Dumps a default scenario (embedded in the SIPp executable)", SIPP_OPTION_SCENARIO, nullptr, 0}, {"sf", "Loads an alternate XML scenario file. To learn more about XML scenario syntax, use the -sd option to dump embedded scenarios. They contain all the necessary help.", SIPP_OPTION_SCENARIO, nullptr, 2}, + {"rxsf", "Loads an alternate receive xml scenario file as the second scenario - enabling a mixture of originating and terminating calls to be executed.\n" + "If this is included then the second scenario MUST be a server mode scenario, and the first scenario (specified in -sf / -sn) MUST be a client-mode scenario.\n" + "If both -snrx and -sfrx are ommitted then only a single scenario is executed.", SIPP_OPTION_RX_SCENARIO, nullptr, 2}, {"oocsf", "Load out-of-call scenario.", SIPP_OPTION_OOC_SCENARIO, nullptr, 2}, {"oocsn", "Load out-of-call scenario.", SIPP_OPTION_OOC_SCENARIO, nullptr, 2}, { @@ -144,6 +149,11 @@ struct sipp_option options_table[] = { "- '3pcc-A' : A side.\n" "- '3pcc-B' : B side.\n", SIPP_OPTION_SCENARIO, nullptr, 2 }, + { + "rxrn", "Use a default scenario (embedded in the sipp executable) for the second scenario - enabling a mixture of originating and terminating calls to be executed.\n" + "If this is included then the second scenario MUST be a server mode scenario, and the first scenario (specified in -sf / -sn) MUST be a client-mode scenario.\n" + "If both -snrx and -sfrx are ommitted then only a single scenario is executed.\n", SIPP_OPTION_RX_SCENARIO, nullptr, 2 + }, {"", "IP, port and protocol options:", SIPP_HELP_TEXT_HEADER, nullptr, 0}, { @@ -264,6 +274,9 @@ struct sipp_option options_table[] = { {"", "Injection file options:", SIPP_HELP_TEXT_HEADER, nullptr, 0}, + {"rxinf", "Inject values from an external CSV file during calls into the scenarios.\n" + "First line of this file say whether the data is to be read in sequence (SEQUENTIAL), random (RANDOM), or user (USER) order.\n" + "Each line corresponds to one call and has one or more ';' delimited data fields. Those fields can be referred as [field0], [field1], ... in the xml scenario file. Several CSV files can be used simultaneously (syntax: -inf f1.csv -inf f2.csv ...)", SIPP_OPTION_RX_INPUT_FILE, nullptr, 1}, {"inf", "Inject values from an external CSV file during calls into the scenarios.\n" "First line of this file say whether the data is to be read in sequence (SEQUENTIAL), random (RANDOM), or user (USER) order.\n" "Each line corresponds to one call and has one or more ';' delimited data fields. Those fields can be referred as [field0], [field1], ... in the xml scenario file. Several CSV files can be used simultaneously (syntax: -inf f1.csv -inf f2.csv ...)", SIPP_OPTION_INPUT_FILE, nullptr, 1}, @@ -1194,28 +1207,6 @@ static void sighandle_set() sigaction(SIGXFSZ, &action_file_size_exceeded, nullptr); // avoid core dump if the max file size is exceeded } -static void set_scenario(const char* name) -{ - free(scenario_file); - free(scenario_path); - - const char* sep = strrchr(name, '/'); - if (sep) { - ++sep; // include slash - scenario_path = strndup(name, sep - name); - } else { - scenario_path = strdup(""); - sep = name; - } - - const char* ext = strrchr(sep, '.'); - if (ext && strcmp(ext, ".xml") == 0) { - scenario_file = strndup(sep, ext - sep); - } else { - scenario_file = strdup(sep); - } -} - static int create_socket(struct sockaddr_storage* media_sa, int try_port, bool last_attempt, const char *type) { @@ -1568,6 +1559,28 @@ int main(int argc, char *argv[]) } } break; + case SIPP_OPTION_RX_INPUT_FILE: + { + REQUIRE_ARG(); + CHECK_PASS(); + FileContents *rxData = new FileContents(argv[argi]); + char *name = argv[argi]; + if (strrchr(name, '/')) { + name = strrchr(name, '/') + 1; + } else if (strrchr(name, '\\')) { + name = strrchr(name, '\\') + 1; + } + assert(name); + inFiles[name] = rxData; + /* By default, the first file is used for IP address input. */ + if (!rx_ip_file) { + rx_ip_file = name; + } + if (!rx_default_file) { + rx_default_file = name; + } + } + break; case SIPP_OPTION_INDEX_FILE: REQUIRE_ARG(); REQUIRE_ARG(); @@ -1741,17 +1754,14 @@ int main(int argc, char *argv[]) if (main_scenario) { ERROR("Internal error, main_scenario already set"); } else if (!strcmp(argv[argi - 1], "-sf")) { - set_scenario(argv[argi]); if (useLogf == 1) { rotate_logfile(); } main_scenario = new scenario(argv[argi], 0); - main_scenario->stats->setFileName(scenario_file, ".csv"); } else if (!strcmp(argv[argi - 1], "-sn")) { int i = find_scenario(argv[argi]); - set_scenario(argv[argi]); main_scenario = new scenario(0, i); - main_scenario->stats->setFileName(scenario_file, ".csv"); + main_scenario->setFileName(argv[argi]); } else if (!strcmp(argv[argi - 1], "-sd")) { int i = find_scenario(argv[argi]); fprintf(stdout, "%s", default_scenario[i]); @@ -1760,6 +1770,20 @@ int main(int argc, char *argv[]) ERROR("Internal error, I don't recognize %s as a scenario option", argv[argi] - 1); } break; + case SIPP_OPTION_RX_SCENARIO: + REQUIRE_ARG(); + CHECK_PASS(); + creationMode = MODE_MIXED; + if (!strcmp(argv[argi - 1], "-rxsf")) { + rx_scenario = new scenario(argv[argi], 0); + } else if (!strcmp(argv[argi - 1], "-rxsn")) { + int i = find_scenario(argv[argi]); + rx_scenario = new scenario(0, i); + rx_scenario->setFileName(argv[argi]); + } else { + ERROR("Internal error, I don't recognize %s as a scenario option\n", argv[argi] - 1); + } + break; case SIPP_OPTION_OOC_SCENARIO: REQUIRE_ARG(); CHECK_PASS(); @@ -1976,13 +2000,12 @@ int main(int argc, char *argv[]) } /* If no scenario was selected, choose the uac one */ - if (scenario_file == nullptr) { - assert(main_scenario == nullptr); + if (!main_scenario) { int i = find_scenario("uac"); - set_scenario("uac"); main_scenario = new scenario(0, i); - main_scenario->stats->setFileName(scenario_file, ".csv"); + main_scenario->setFileName("uac"); } + scenario_file = main_scenario->getFileName().c_str(); #ifdef USE_TLS if ((transport == T_TLS) && (TLS_init_context() != TLS_INIT_NORMAL)) { @@ -2221,7 +2244,5 @@ int main(int argc, char *argv[]) free(epollevents); #endif - free(scenario_file); - free(scenario_path); sipp_exit(EXIT_TEST_RES_UNKNOWN, rtp_errors, echo_errors); // MAIN EXIT PATH HERE...); } diff --git a/src/socket.cpp b/src/socket.cpp index 6d865e35..19233e40 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -175,6 +175,8 @@ static void process_set(char* what) display_scenario = main_scenario; } else if (!strcmp(rest, "ooc") && ooc_scenario) { display_scenario = ooc_scenario; + } else if (!strcmp(rest, "rx") && rx_scenario) { + display_scenario = rx_scenario; } else { WARNING("Unknown display scenario: %s", rest); } @@ -1119,12 +1121,13 @@ void process_message(SIPpSocket *socket, char *msg, ssize_t msg_size, struct soc msg_size, msg); } + // got as message not relating to a known call if (!listener_ptr) { if (thirdPartyMode == MODE_3PCC_CONTROLLER_B || thirdPartyMode == MODE_3PCC_A_PASSIVE || thirdPartyMode == MODE_MASTER_PASSIVE || thirdPartyMode == MODE_SLAVE) { // Adding a new OUTGOING call ! main_scenario->stats->computeStat(CStat::E_CREATE_OUTGOING_CALL); - call *new_ptr = new call(call_id, local_ip_is_ipv6, 0, use_remote_sending_addr ? &remote_sending_sockaddr : &remote_sockaddr); + call *new_ptr = new call(main_scenario, call_id, local_ip_is_ipv6, 0, use_remote_sending_addr ? &remote_sending_sockaddr : &remote_sockaddr); outbound_congestion = false; if ((socket != main_socket) && @@ -1161,7 +1164,18 @@ void process_message(SIPpSocket *socket, char *msg, ssize_t msg_size, struct soc // Adding a new INCOMING call ! main_scenario->stats->computeStat(CStat::E_CREATE_INCOMING_CALL); - listener_ptr = new call(call_id, socket, use_remote_sending_addr ? &remote_sending_sockaddr : src); + listener_ptr = new call(main_scenario, call_id, socket, use_remote_sending_addr ? &remote_sending_sockaddr : src); + } else if(creationMode == MODE_MIXED) { + /* Ignore quitting for now ... as this is triggered when all tx calls are active + if (quitting >= 1) { + CStat::globalStat(CStat::E_OUT_OF_CALL_MSGS); + TRACE_MSG("Discarded message for new calls while quitting\n"); + return; + } + */ + // Adding a new INCOMING call ! + rx_scenario->stats->computeStat(CStat::E_CREATE_INCOMING_CALL); + listener_ptr = new call(rx_scenario, call_id, socket, use_remote_sending_addr ? &remote_sending_sockaddr : src); } else { // mode != from SERVER and 3PCC Controller B // This is a message that is not relating to any known call if (ooc_scenario) { @@ -1219,6 +1233,7 @@ void process_message(SIPpSocket *socket, char *msg, ssize_t msg_size, struct soc if ((socket == localTwinSippSocket) || (socket == twinSippSocket) || (is_a_local_socket(socket))) { listener_ptr -> process_twinSippCom(msg); } else { + /* This is a message on a known call - process it */ listener_ptr -> process_incoming(msg, src); } }