Module: kamailio
Branch: master
Commit: 5b9f22c0f45e6970e47a972f26eeac920860b4d7
URL: 
https://github.com/kamailio/kamailio/commit/5b9f22c0f45e6970e47a972f26eeac920860b4d7

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2023-01-20T12:22:55+01:00

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

---

Modified: src/modules/topoh/topoh_mod.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/5b9f22c0f45e6970e47a972f26eeac920860b4d7.diff
Patch: 
https://github.com/kamailio/kamailio/commit/5b9f22c0f45e6970e47a972f26eeac920860b4d7.patch

---

diff --git a/src/modules/topoh/topoh_mod.c b/src/modules/topoh/topoh_mod.c
index 8f244d6212..c1b2dc51e9 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) {

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to [email protected]

Reply via email to