2 * Copyright (C) 2006 iptelorg GmbH
4 * This file is part of Kamailio, a free SIP server.
6 * Kamailio is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version
11 * Kamailio is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 * \brief Kamailio core :: Non-sip callbacks
23 * non-sip callbacks, called whenever a message with protocol != SIP/2.0
24 * is received (the message must have at least a sip like first line or
25 * else they will be dropped before this callbacks are called
32 #ifndef _nonsip_hooks_h
33 #define _nonsip_hooks_h
35 #include "parser/msg_parser.h" /* sip_msg */
37 #define MAX_NONSIP_HOOKS 1
39 enum nonsip_msg_returns{ NONSIP_MSG_ERROR=-1, NONSIP_MSG_DROP=0,
40 NONSIP_MSG_PASS, NONSIP_MSG_ACCEPT };
43 char* name; /* must be !=0, it has only "debugging" value */
44 /* called each time a sip like request (from the first line point of view)
45 * with protocol/version != SIP/2.0 is received
46 * return: 0 - drop message immediately, >0 - continue with other hooks,
47 * <0 - error (drop message)
49 int (*on_nonsip_req)(struct sip_msg* msg);
50 /* called before ser shutdown (last minute cleanups) */
51 void (*destroy)(void);
55 int init_nonsip_hooks(void);
56 void destroy_nonsip_hooks(void);
57 int register_nonsip_msg_hook(struct nonsip_hook *h);
58 int nonsip_msg_run_hooks(struct sip_msg* msg);