Example #1
0
/*
 * destroy
 * called by opensips at exit time
 */
static void destroy(void)
{
	if(my_perl==NULL)
		return;
	unload_perl(my_perl);
	PERL_SYS_TERM();
	my_perl = NULL;
}
Example #2
0
/*
 * destroy
 * called by kamailio at exit time
 */
static void destroy(void)
{
    if(_ap_reset_cycles!=NULL)
        shm_free(_ap_reset_cycles);
    _ap_reset_cycles = NULL;

    if(my_perl==NULL)
        return;
    unload_perl(my_perl);
    PERL_SYS_TERM();
    my_perl = NULL;
}
Example #3
0
/*
 * reload function.
 * Reinitializes the interpreter. Works, but execution for _all_
 * children is difficult.
 */
int perl_reload(struct sip_msg *m, char *a, char *b) {

	PerlInterpreter *new_perl;

	new_perl = parser_init();

	if (new_perl) {
		unload_perl(my_perl);
		my_perl = new_perl;
#ifdef PERL_EXIT_DESTRUCT_END
		PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
#else
#warning Perl 5.8.x should be used. Please upgrade.
#warning This binary will be unsupported.
		PL_exit_flags |= PERL_EXIT_EXPECTED;
#endif
		return 1;
	} else {
		return 0;
	}

}