Daniel-Constantin Mierla writes:

> The function can be added, should be easy to extract the code from the
> rpc command function.

How about the tm.c patch below?  Or should the function be placed in
some other tm/.c file and if so, which one?

-- Juha

-----------------------------------

*** /usr/src/orig/kamailio/src/modules/tm/tm.c  2020-03-06 00:13:15.534078140 
+0200
--- tm.c        2020-03-06 00:45:26.405625701 +0200
***************
*** 208,213 ****
--- 207,213 ----
                char* pnexthop, char* psock, char *phdrs, char* pbody);
  static int w_t_get_status_code(sip_msg_t* msg, char *p1, char *p2);
  
+ static int t_clean(struct sip_msg* msg, char* key, char* value);
  
  /* by default the fr timers avps are not set, so that the avps won't be
   * searched for nothing each time a new transaction is created */
***************
*** 411,416 ****
--- 411,417 ----
                REQUEST_ROUTE | FAILURE_ROUTE},
        {"t_next_contact_flow", t_next_contact_flow,            0, 0, 0,
                REQUEST_ROUTE },
+       {"t_clean", t_clean, 0, 0, 0, ANY_ROUTE },
  
        /* not applicable from the script */
        {"load_tm",            (cmd_function)load_tm,           NO_SCRIPT,   0, 
0, 0},
***************
*** 2952,2957 ****
--- 2909,2921 ----
        return ki_t_relay_to_proxy_flags(msg, NULL, rflags);
  }
  
+ /* script function to clean active but very old transactions */
+ static int t_clean(struct sip_msg* msg, char* key, char* value)
+ {
+       tm_clean_lifetime();
+       return 1;
+ }
+ 
  /**
   *
   */


_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to