4 * Copyright (C) 2006 iptelorg GmbH
6 * This file is part of ser, a free SIP server.
8 * ser is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version
13 * For a license to use the ser software under conditions
14 * other than those described here, or to purchase support for this
15 * software, please contact iptel.org by e-mail at the following addresses:
18 * ser is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 * non-sip callbacks, called whenever a message with protocol != SIP/2.0
29 * is received (the message must have at least a sip like first line or
30 * else they will be dropped before this callbacks are called
35 * 2006-11-29 created by andrei
39 #ifndef _nonsip_hooks_h
40 #define _nonsip_hooks_h
42 #include "parser/msg_parser.h" /* sip_msg */
44 #define MAX_NONSIP_HOOKS 1
46 enum nonsip_msg_returns{ NONSIP_MSG_ERROR=-1, NONSIP_MSG_DROP=0,
47 NONSIP_MSG_PASS, NONSIP_MSG_ACCEPT };
50 char* name; /* must be !=0, it has only "debugging" value */
51 /* called each time a sip like request (from the first line point of view)
52 * with protocol/version != SIP/2.0 is received
53 * return: 0 - drop message immediately, >0 - continue with other hooks,
54 * <0 - error (drop message)
56 int (*on_nonsip_req)(struct sip_msg* msg);
57 /* called before ser shutdown (last minute cleanups) */
58 void (*destroy)(void);
62 int init_nonsip_hooks();
63 void destroy_nonsip_hooks();
64 int register_nonsip_msg_hook(struct nonsip_hook *h);
65 int nonsip_msg_run_hooks(struct sip_msg* msg);