cpl_run.h

Go to the documentation of this file.
00001 /*
00002  * $Id: cpl_run.h 4518 2008-07-28 15:39:28Z henningw $
00003  *
00004  * Copyright (C) 2001-2003 FhG Fokus
00005  *
00006  * This file is part of Kamailio, a free SIP server.
00007  *
00008  * Kamailio is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version
00012  *
00013  * Kamailio is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  */
00022 
00023 #ifndef _CPL_RUN_H
00024 #define _CPL_RUN_H
00025 
00026 #include "../../str.h"
00027 #include "../../parser/msg_parser.h"
00028 
00029 #define SCRIPT_END               0
00030 #define SCRIPT_DEFAULT           1
00031 #define SCRIPT_TO_BE_CONTINUED   2
00032 #define SCRIPT_RUN_ERROR         -1
00033 #define SCRIPT_FORMAT_ERROR      -2
00034 
00035 #define CPL_RUN_OUTGOING               (1<<0)
00036 #define CPL_RUN_INCOMING               (1<<1)
00037 #define CPL_IS_STATEFUL                (1<<2)
00038 #define CPL_FORCE_STATEFUL             (1<<3)
00039 #define CPL_LOC_SET_MODIFIED           (1<<5)
00040 #define CPL_PROXY_DONE                 (1<<6)
00041 #define CPL_RURI_DUPLICATED            (1<<10)
00042 #define CPL_TO_DUPLICATED              (1<<11)
00043 #define CPL_FROM_DUPLICATED            (1<<12)
00044 #define CPL_SUBJECT_DUPLICATED         (1<<13)
00045 #define CPL_ORGANIZATION_DUPLICATED    (1<<14)
00046 #define CPL_USERAGENT_DUPLICATED       (1<<15)
00047 #define CPL_ACCEPTLANG_DUPLICATED      (1<<16)
00048 #define CPL_PRIORITY_DUPLICATED        (1<<17)
00049 
00050 #define STR_NOT_FOUND           ((str*)0xffffffff)
00051 
00052 
00053 struct cpl_interpreter {
00054    unsigned int flags;
00055    str user;              /* user */
00056    str script;            /* CPL script */
00057    char *ip;              /* instruction pointer */
00058    int recv_time;         /* receiving time stamp */
00059    struct sip_msg *msg;
00060    struct location *loc_set;     /* location set */
00061    /* pointers to the string-headers needed for switches; can point directly
00062     * into the sip_msg structure (if no proxy took places) or to private
00063     * buffers into shm_memory (after a proxy happend); if a hdr is copy into a
00064     * private buffer, a corresponding flag will be set (xxxx_DUPLICATED) */
00065    str *ruri;
00066    str *to;
00067    str *from;
00068    str *subject;
00069    str *organization;
00070    str *user_agent;
00071    str *accept_language;
00072    str *priority;
00073    /* grouped date the is needed when doing proxy */
00074    struct proxy_st {
00075       unsigned short ordering;
00076       unsigned short recurse;
00077       /* I have to know which will be the last location that will be proxy */
00078       struct location *last_to_proxy;
00079       /* shortcuts to the subnodes */
00080       char *busy;
00081       char *noanswer;
00082       char *redirect;
00083       char *failure;
00084       char *default_;
00085    }proxy;
00086 };
00087 
00088 struct cpl_interpreter* new_cpl_interpreter( struct sip_msg *msg, str *script);
00089 
00090 void free_cpl_interpreter(struct cpl_interpreter *intr);
00091 
00092 int cpl_run_script( struct cpl_interpreter *cpl_intr );
00093 
00094 #endif
00095 
00096 

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