cpl.c File Reference

#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#include "../../mem/shm_mem.h"
#include "../../mem/mem.h"
#include "../../sr_module.h"
#include "../../str.h"
#include "../../ut.h"
#include "../../dprint.h"
#include "../../data_lump_rpl.h"
#include "../../pvar.h"
#include "../../parser/parse_uri.h"
#include "../../parser/parse_from.h"
#include "../../parser/parse_content.h"
#include "../../parser/parse_disposition.h"
#include "../../db/db.h"
#include "../../mi/mi.h"
#include "../sl/sl_api.h"
#include "cpl_run.h"
#include "cpl_env.h"
#include "cpl_db.h"
#include "cpl_loader.h"
#include "cpl_parser.h"
#include "cpl_nonsig.h"
#include "loc_set.h"

Include dependency graph for cpl.c:

Go to the source code of this file.

Data Structures

struct  cpl_error

Defines

#define ACTION_PARAM   "action"
#define ACTION_PARAM_LEN   (sizeof(ACTION_PARAM)-1)
#define CONTENT_TYPE_HDR   ("Content-Type: application/cpl-xml"CRLF)
#define CONTENT_TYPE_HDR_LEN   (sizeof(CONTENT_TYPE_HDR)-1)
#define CPL_SCRIPT   "script"
#define CPL_SCRIPT_LEN   (sizeof(CPL_SCRIPT)-1)
#define MAX_PROXY_RECURSE   10
#define MAX_USERHOST_LEN   256
#define REMOVE_ACTION   "remove"
#define REMOVE_ACTION_LEN   (sizeof(REMOVE_ACTION)-1)
#define REMOVE_SCRIPT   0xcaca
#define STORE_ACTION   "store"
#define STORE_ACTION_LEN   (sizeof(STORE_ACTION)-1)
#define STORE_SCRIPT   0xbebe

Functions

static int build_user_AOR (str *username, str *domain, str *uh, int sip)
static int cpl_child_init (int rank)
static int cpl_exit (void)
static int cpl_init (void)
static MODULE_VERSION int cpl_invoke_script (struct sip_msg *msg, char *str, char *str2)
static void cpl_process (int rank)
static int cpl_process_register (struct sip_msg *msg, int no_rpl)
static int do_script_action (struct sip_msg *msg, int action)
static int do_script_download (struct sip_msg *msg)
static int fixup_cpl_run_script (void **param, int param_no)
static int get_dest_user (struct sip_msg *msg, str *username, str *domain)
static int get_orig_user (struct sip_msg *msg, str *username, str *domain)
static int mi_child_init (void)
static int w_process_register (struct sip_msg *msg, char *str, char *str2)
static int w_process_register_norpl (struct sip_msg *msg, char *str, char *str2)

Variables

static struct cpl_error bad_cpl = {400,str_init("Bad CPL script")}
static struct cpl_error bad_req = {400,str_init("Bad request")}
static cmd_export_t cmds []
struct cpl_enviroment cpl_env
static struct cpl_errorcpl_err = &bad_req
struct cpl_functions cpl_fct
static str cpl_ok_rpl = str_init("OK")
static proc_export_t cpl_procs []
static str db_table = str_init("cpl")
static str db_url = str_init(DEFAULT_DB_URL)
static char * dtd_file = 0
struct module_exports exports
static struct cpl_error intern_err = {500,str_init("Internal server error")}
static char * lookup_domain = 0
static mi_export_t mi_cmds []
static param_export_t params []
static str timer_avp = {NULL, 0}


Define Documentation

#define ACTION_PARAM   "action"

Definition at line 619 of file cpl.c.

Referenced by cpl_process_register().

#define ACTION_PARAM_LEN   (sizeof(ACTION_PARAM)-1)

Definition at line 620 of file cpl.c.

Referenced by cpl_process_register().

#define CONTENT_TYPE_HDR   ("Content-Type: application/cpl-xml"CRLF)

Definition at line 629 of file cpl.c.

Referenced by do_script_download(), and send_sip_msg_request().

#define CONTENT_TYPE_HDR_LEN   (sizeof(CONTENT_TYPE_HDR)-1)

Definition at line 630 of file cpl.c.

Referenced by do_script_download(), and send_sip_msg_request().

#define CPL_SCRIPT   "script"

Definition at line 617 of file cpl.c.

Referenced by cpl_process_register().

#define CPL_SCRIPT_LEN   (sizeof(CPL_SCRIPT)-1)

Definition at line 618 of file cpl.c.

Referenced by cpl_process_register().

#define MAX_PROXY_RECURSE   10

Definition at line 69 of file cpl.c.

Referenced by cpl_init().

#define MAX_USERHOST_LEN   256

Definition at line 70 of file cpl.c.

#define REMOVE_ACTION   "remove"

Definition at line 623 of file cpl.c.

Referenced by cpl_process_register().

#define REMOVE_ACTION_LEN   (sizeof(REMOVE_ACTION)-1)

Definition at line 624 of file cpl.c.

Referenced by cpl_process_register().

#define REMOVE_SCRIPT   0xcaca

Definition at line 626 of file cpl.c.

Referenced by cpl_process_register(), and do_script_action().

#define STORE_ACTION   "store"

Definition at line 621 of file cpl.c.

Referenced by cpl_process_register().

#define STORE_ACTION_LEN   (sizeof(STORE_ACTION)-1)

Definition at line 622 of file cpl.c.

Referenced by cpl_process_register().

#define STORE_SCRIPT   0xbebe

Definition at line 627 of file cpl.c.

Referenced by cpl_process_register(), and do_script_action().


Function Documentation

static int build_user_AOR ( str username,
str domain,
str uh,
int  sip 
) [inline, static]

static int cpl_child_init ( int  rank  )  [static]

Definition at line 393 of file cpl.c.

References cpl_db_init().

static int cpl_exit ( void   )  [static]

Definition at line 412 of file cpl.c.

References cpl_enviroment::orig_tz, _str::s, and shm_free.

static int cpl_init ( void   )  [static]

static int cpl_invoke_script ( struct sip_msg msg,
char *  str,
char *  str2 
) [static]

static void cpl_process ( int  rank  )  [static]

Definition at line 405 of file cpl.c.

References cpl_enviroment::cmd_pipe, cpl_aux_process(), and cpl_enviroment::log_dir.

static int cpl_process_register ( struct sip_msg msg,
int  no_rpl 
) [static]

static int do_script_action ( struct sip_msg msg,
int  action 
) [inline, static]

static int do_script_download ( struct sip_msg msg  )  [inline, static]

static int fixup_cpl_run_script ( void **  param,
int  param_no 
) [static]

static int get_dest_user ( struct sip_msg msg,
str username,
str domain 
) [inline, static]

static int get_orig_user ( struct sip_msg msg,
str username,
str domain 
) [inline, static]

static int mi_child_init ( void   )  [static]

Definition at line 399 of file cpl.c.

References cpl_db_init().

static int w_process_register ( struct sip_msg msg,
char *  str,
char *  str2 
) [static]

Definition at line 759 of file cpl.c.

References cpl_process_register().

static int w_process_register_norpl ( struct sip_msg msg,
char *  str,
char *  str2 
) [static]

Definition at line 766 of file cpl.c.

References cpl_process_register().


Variable Documentation

struct cpl_error bad_cpl = {400,str_init("Bad CPL script")} [static]

Definition at line 639 of file cpl.c.

struct cpl_error bad_req = {400,str_init("Bad request")} [static]

Definition at line 637 of file cpl.c.

cmd_export_t cmds[] [static]

Definition at line 127 of file cpl.c.

struct cpl_error* cpl_err = &bad_req [static]

Definition at line 641 of file cpl.c.

str cpl_ok_rpl = str_init("OK") [static]

Definition at line 97 of file cpl.c.

Initial value:

 {
   {"CPL Aux",  0,  0,  cpl_process, 1 },
   {0,0,0,0,0}
}

Definition at line 118 of file cpl.c.

str db_table = str_init("cpl") [static]

Definition at line 75 of file cpl.c.

str db_url = str_init(DEFAULT_DB_URL) [static]

Definition at line 74 of file cpl.c.

char* dtd_file = 0 [static]

Definition at line 76 of file cpl.c.

Referenced by cpl_init().

Definition at line 175 of file cpl.c.

struct cpl_error intern_err = {500,str_init("Internal server error")} [static]

Definition at line 638 of file cpl.c.

char* lookup_domain = 0 [static]

Definition at line 77 of file cpl.c.

Referenced by cpl_init().

mi_export_t mi_cmds[] [static]

Definition at line 165 of file cpl.c.

param_export_t params[] [static]

Definition at line 141 of file cpl.c.

str timer_avp = {NULL, 0} [static]

Definition at line 78 of file cpl.c.


Generated on Mon May 21 18:00:38 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6