00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef _XJAB_WORKER_H_
00033 #define _XJAB_WORKER_H_
00034
00035 #include "../../str.h"
00036 #include "../../lib/srdb1/db.h"
00037 #include "../../locking.h"
00038 #include "../../modules/tm/tm_load.h"
00039
00040 #include "xjab_util.h"
00041 #include "tree234.h"
00042
00043
00044 typedef struct _xj_jalias
00045 {
00046 int size;
00047 str *jdm;
00048 char dlm;
00049 str *proxy;
00050 str *a;
00051 char *d;
00052 } t_xj_jalias, *xj_jalias;
00053
00054 typedef struct _xj_worker
00055 {
00056 int pid;
00057 int wpipe;
00058 int rpipe;
00059 int nr;
00060 tree234 *sip_ids;
00061 } t_xj_worker, *xj_worker;
00062
00063 typedef struct _xj_wlist
00064 {
00065 int len;
00066 int maxj;
00067 int cachet;
00068 int delayt;
00069 int sleept;
00070 gen_lock_set_t *sems;
00071 xj_jalias aliases;
00072 xj_worker workers;
00073 } t_xj_wlist, *xj_wlist;
00074
00075
00076
00077 xj_wlist xj_wlist_init(int **, int, int, int, int, int);
00078 int xj_wlist_set_pid(xj_wlist, int, int);
00079 int xj_wlist_get(xj_wlist, xj_jkey, xj_jkey*);
00080 int xj_wlist_check(xj_wlist, xj_jkey, xj_jkey*);
00081 int xj_wlist_set_flag(xj_wlist, xj_jkey, int);
00082 void xj_wlist_del(xj_wlist, xj_jkey, int);
00083 void xj_wlist_free(xj_wlist);
00084 int xj_wlist_set_aliases(xj_wlist, char *, char *, char *);
00085 int xj_wlist_check_aliases(xj_wlist, str*);
00086 int xj_wlist_clean_jobs(xj_wlist, int, int);
00087
00088 int xj_worker_process(xj_wlist, char*, int, char*, int, db1_con_t*, db_func_t*);
00089
00090 int xj_address_translation(str *src, str *dst, xj_jalias als, int flag);
00091 int xj_manage_jab(char *buf, int len, int *pos, xj_jalias als, xj_jcon jbc);
00092
00093 void xj_sig_handler(int s);
00094
00095
00096
00097 int xj_send_sip_msg(str *, str *, str *, str *, int *);
00098 int xj_send_sip_msgz(str *,str *, str *, char *, int *);
00099 void xj_tuac_callback( struct cell *t, int type, struct tmcb_params *ps);
00100 void xj_worker_check_jcons(xj_wlist, xj_jcon_pool, int, fd_set*);
00101 void xj_worker_check_qmsg(xj_wlist, xj_jcon_pool);
00102 void xj_worker_check_watcher(xj_wlist, xj_jcon_pool, xj_jcon, xj_sipmsg);
00103
00104 #endif
00105