From 5b9f22c0f45e6970e47a972f26eeac920860b4d7 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Fri, 20 Jan 2023 12:16:03 +0100 Subject: [PATCH] topoh: added mod param use_mode - if set to 1, the module is initialized only for use as a library, via inter-module api functions - default: 0 - initialized for use to process sip messages --- src/modules/topoh/topoh_mod.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/modules/topoh/topoh_mod.c b/src/modules/topoh/topoh_mod.c index 8f244d62120..c1b2dc51e93 100644 --- a/src/modules/topoh/topoh_mod.c +++ b/src/modules/topoh/topoh_mod.c @@ -82,6 +82,7 @@ int th_param_mask_mode = 0; int th_sanity_checks = 0; int th_uri_prefix_checks = 0; int th_mask_addr_myself = 0; +int _th_use_mode = 0; sanity_api_t scb; @@ -116,6 +117,7 @@ static param_export_t params[]={ {"uri_prefix_checks", PARAM_INT, &th_uri_prefix_checks}, {"event_callback", PARAM_STR, &_th_eventrt_callback}, {"event_mode", PARAM_INT, &_th_eventrt_mode}, + {"use_mode", PARAM_INT, &_th_use_mode}, {0,0,0} }; @@ -147,6 +149,12 @@ static int mod_init(void) sip_uri_t puri; char buri[MAX_URI_SIZE]; + if(_th_use_mode==1) { + /* use in library mode, not for processing sip messages */ + th_mask_init(); + return 0; + } + _th_eventrt_outgoing = route_lookup(&event_rt, _th_eventrt_outgoing_name.s); if(_th_eventrt_outgoing<0 || event_rt.rlist[_th_eventrt_outgoing]==NULL) {