Пример #1
0
/**
 * mi and worker process init
 */
static int mi_child_init(void)
{
	/* db handler initialization */
	if(pdt_init_db()<0)
	{
		LM_ERR("failed to connect to database\n");
		return -1;
	}

	return 0;
}
Пример #2
0
/* each child get a new connection to the database */
static int child_init(int rank)
{
	if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
		return 0; /* do nothing for the main process */

	if(pdt_init_db()<0)
	{
		LM_ERR("cannot initialize database connection\n");
		return -1;
	}
	LM_DBG("#%d: database connection opened successfully\n", rank);
	return 0;
}