msilo.c File Reference

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
#include "../../sr_module.h"
#include "../../dprint.h"
#include "../../ut.h"
#include "../../timer.h"
#include "../../mem/shm_mem.h"
#include "../../db/db.h"
#include "../../parser/parse_from.h"
#include "../../parser/parse_content.h"
#include "../../parser/contact/parse_contact.h"
#include "../../parser/parse_allow.h"
#include "../../parser/parse_methods.h"
#include "../../resolve.h"
#include "../../usr_avp.h"
#include "../../mod_fix.h"
#include "../tm/tm_load.h"
#include "ms_msg_list.h"
#include "msfuncs.h"

Include dependency graph for msilo.c:

Go to the source code of this file.

Defines

#define MAX_DEL_KEYS   1
#define MS_BUF1_SIZE   1024
#define NR_KEYS   10
#define S_TABLE_VERSION   5
#define SET_STR_VAL(_str, _res, _r, _c)

Functions

int check_message_support (struct sip_msg *msg)
static int child_init (int)
void destroy (void)
void m_clean_silo (unsigned int ticks, void *)
static int m_dump (struct sip_msg *, char *, char *)
void m_send_ontimer (unsigned int ticks, void *)
static int m_store (struct sip_msg *, char *, char *)
static void m_tm_callback (struct cell *t, int type, struct tmcb_params *ps)
static int mod_init (void)
int ms_reset_stime (int mid)

Variables

static cmd_export_t cmds []
static db_con_tdb_con = NULL
struct module_exports exports
msg_list ml = NULL
int ms_add_date = 1
int ms_check_time = 60
int ms_clean_period = 10
char * ms_contact = NULL
void ** ms_contact_sp = NULL
char * ms_content_type = NULL
void ** ms_content_type_sp = NULL
static str ms_db_table = str_init("silo")
static str ms_db_url = str_init(DEFAULT_DB_URL)
int ms_expire_time = 259200
char * ms_from = NULL
void ** ms_from_sp = NULL
int ms_max_messages = 0
char * ms_offline_message = NULL
void ** ms_offline_message_sp = NULL
str ms_outbound_proxy = {NULL, 0}
str ms_reminder = {NULL, 0}
int ms_send_time = 0
int_str ms_snd_time_avp_name
static str ms_snd_time_avp_param = {NULL, 0}
unsigned short ms_snd_time_avp_type
int ms_use_contact = 1
str msg_type = str_init("MESSAGE")
static db_func_t msilo_dbf
static param_export_t params []
static str sc_body = str_init("body")
static str sc_ctype = str_init("ctype")
static str sc_exp_time = str_init("exp_time")
static str sc_from = str_init("src_addr")
static str sc_inc_time = str_init("inc_time")
static str sc_mid = str_init("id")
static str sc_snd_time = str_init("snd_time")
static str sc_to = str_init("dst_addr")
static str sc_uri_host = str_init("domain")
static str sc_uri_user = str_init("username")
struct tm_binds tmb


Define Documentation

#define MAX_DEL_KEYS   1

Definition at line 72 of file msilo.c.

Referenced by m_clean_silo().

#define MS_BUF1_SIZE   1024

Referenced by m_store().

#define NR_KEYS   10

#define S_TABLE_VERSION   5

Definition at line 111 of file msilo.c.

Referenced by mod_init().

#define SET_STR_VAL ( _str,
_res,
_r,
_c   ) 

Definition at line 86 of file msilo.c.

Referenced by m_dump(), and m_send_ontimer().


Function Documentation

int check_message_support ( struct sip_msg msg  ) 

static int child_init ( int  rank  )  [static]

Initialize children

Definition at line 417 of file msilo.c.

References db_func::init, LM_CRIT, LM_DBG, LM_ERR, and db_func::use_table.

void destroy ( void   ) 

destroy function

void m_clean_silo ( unsigned int  ticks,
void *  param 
)

static int m_dump ( struct sip_msg msg,
char *  owner,
char *  str2 
) [static]

void m_send_ontimer ( unsigned int  ticks,
void *  param 
)

static int m_store ( struct sip_msg msg,
char *  owner,
char *  s2 
) [static]

void m_tm_callback ( struct cell t,
int  type,
struct tmcb_params ps 
) [static]

TM callback function

TM callback function - delete message from database if was sent OK

Definition at line 1146 of file msilo.c.

References tmcb_params::code, LM_DBG, LM_ERR, MS_MSG_DONE, MS_MSG_ERRO, msg_list_set_flag(), NULL, and tmcb_params::param.

Referenced by m_dump(), and m_send_ontimer().

static int mod_init ( void   )  [static]

int ms_reset_stime ( int  mid  ) 


Variable Documentation

cmd_export_t cmds[] [static]

Definition at line 172 of file msilo.c.

db_con_t* db_con = NULL [static]

database connection

Definition at line 114 of file msilo.c.

module exports

Definition at line 233 of file msilo.c.

msg_list ml = NULL

precessed msg list - used for dumping the messages

Definition at line 118 of file msilo.c.

Referenced by msg_list_init().

int ms_add_date = 1

Definition at line 144 of file msilo.c.

Referenced by m_build_body().

int ms_check_time = 60

Definition at line 140 of file msilo.c.

Referenced by m_clean_silo(), and mod_init().

int ms_clean_period = 10

Definition at line 142 of file msilo.c.

Referenced by m_clean_silo().

char* ms_contact = NULL

Definition at line 131 of file msilo.c.

Referenced by m_store(), and mod_init().

void** ms_contact_sp = NULL

Definition at line 135 of file msilo.c.

Referenced by m_store(), and mod_init().

char* ms_content_type = NULL

Definition at line 132 of file msilo.c.

Referenced by mod_init().

void** ms_content_type_sp = NULL

Definition at line 136 of file msilo.c.

Referenced by m_store(), and mod_init().

str ms_db_table = str_init("silo") [static]

Definition at line 126 of file msilo.c.

str ms_db_url = str_init(DEFAULT_DB_URL) [static]

parameters

Definition at line 125 of file msilo.c.

int ms_expire_time = 259200

Definition at line 139 of file msilo.c.

Referenced by m_store().

char* ms_from = NULL

Definition at line 130 of file msilo.c.

Referenced by m_store(), and mod_init().

void** ms_from_sp = NULL

Definition at line 134 of file msilo.c.

Referenced by m_store(), and mod_init().

int ms_max_messages = 0

Definition at line 145 of file msilo.c.

Referenced by m_store().

char* ms_offline_message = NULL

Definition at line 133 of file msilo.c.

Referenced by m_store(), and mod_init().

void** ms_offline_message_sp = NULL

Definition at line 137 of file msilo.c.

Referenced by m_store(), and mod_init().

str ms_outbound_proxy = {NULL, 0}

Definition at line 128 of file msilo.c.

str ms_reminder = {NULL, 0}

Definition at line 127 of file msilo.c.

int ms_send_time = 0

Definition at line 141 of file msilo.c.

Referenced by mod_init().

Definition at line 148 of file msilo.c.

str ms_snd_time_avp_param = {NULL, 0} [static]

Definition at line 147 of file msilo.c.

unsigned short ms_snd_time_avp_type

Definition at line 149 of file msilo.c.

Referenced by m_store(), and mod_init().

int ms_use_contact = 1

Definition at line 143 of file msilo.c.

Referenced by m_store().

str msg_type = str_init("MESSAGE")

db_func_t msilo_dbf [static]

Definition at line 115 of file msilo.c.

param_export_t params[] [static]

Definition at line 183 of file msilo.c.

str sc_body = str_init("body") [static]

Definition at line 80 of file msilo.c.

str sc_ctype = str_init("ctype") [static]

Definition at line 81 of file msilo.c.

str sc_exp_time = str_init("exp_time") [static]

Definition at line 82 of file msilo.c.

str sc_from = str_init("src_addr") [static]

Definition at line 76 of file msilo.c.

str sc_inc_time = str_init("inc_time") [static]

Definition at line 83 of file msilo.c.

str sc_mid = str_init("id") [static]

Definition at line 75 of file msilo.c.

str sc_snd_time = str_init("snd_time") [static]

Definition at line 84 of file msilo.c.

str sc_to = str_init("dst_addr") [static]

Definition at line 77 of file msilo.c.

str sc_uri_host = str_init("domain") [static]

Definition at line 79 of file msilo.c.

str sc_uri_user = str_init("username") [static]

Definition at line 78 of file msilo.c.

struct tm_binds tmb

TM bind

Definition at line 121 of file msilo.c.


Generated on Wed May 23 20:00:41 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6