512dcd98 |
/*
* $Id$
|
7dd0b342 |
*
|
53c7e0f1 |
* Copyright (C) 2001-2003 FhG Fokus
|
7dd0b342 |
*
* This file is part of ser, a free SIP server.
*
* ser is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version
*
* For a license to use the ser software under conditions
* other than those described here, or to purchase support for this
* software, please contact iptel.org by e-mail at the following addresses:
* info@iptel.org
*
* ser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
512dcd98 |
*/
|
7dd0b342 |
|
512dcd98 |
#ifndef route_h
#define route_h
#include <sys/types.h>
#include <regex.h>
#include <netdb.h>
|
a15c363f |
#include "config.h"
#include "error.h"
#include "route_struct.h"
|
20fded1f |
#include "action.h"
|
3881f12c |
#include "parser/msg_parser.h"
|
e8138515 |
#include "str_hash.h"
|
a15c363f |
/*#include "cfg_parser.h" */
|
512dcd98 |
|
93349b4e |
struct route_list{
struct action** rlist;
int idx; /* first empty entry */
|
8f0e1af3 |
int entries; /* total number of entries */
|
93349b4e |
struct str_hash_table names; /* name to route index mappings */
};
|
f20a56a2 |
/* main "script table" */
|
93349b4e |
extern struct route_list main_rt;
|
caf80ae6 |
/* main reply route table */
|
93349b4e |
extern struct route_list onreply_rt;
extern struct route_list failure_rt;
extern struct route_list branch_rt;
extern struct route_list onsend_rt;
|
512dcd98 |
|
93349b4e |
int init_routes();
void destroy_routes();
int route_get(struct route_list* rt, char* name);
|
bc5be349 |
int route_lookup(struct route_list* rt, char* name);
|
a15c363f |
|
f20a56a2 |
void push(struct action* a, struct action** head);
int add_actions(struct action* a, struct action** head);
|
93349b4e |
void print_rls();
|
f20a56a2 |
int fix_rls();
|
512dcd98 |
|
20fded1f |
int eval_expr(struct run_act_ctx* h, struct expr* e, struct sip_msg* msg);
|
512dcd98 |
|
ab7f82d2 |
/* fixup functions*/
int fix_actions(struct action* a);
int fix_expr(struct expr* exp);
|
512dcd98 |
#endif
|