[SR-Users] out of shm without any visible reason

Daniel-Constantin Mierla miconda at gmail.com
Fri Mar 6 07:08:40 CET 2020


It is ok, just add the documentation for the new function as well.

Cheers,
Daniel

On 05.03.20 23:48, Juha Heinanen wrote:
> 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;
> + }
> + 
>   /**
>    *
>    */
>
-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - March 9-11, 2020, Berlin - www.asipto.com
Kamailio World Conference - April 27-29, 2020, in Berlin -- www.kamailioworld.com




More information about the sr-users mailing list