error.h
a15c363f
 /*
53c7e0f1
  * Copyright (C) 2001-2003 FhG Fokus
7dd0b342
  *
02ca141b
  * This file is part of Kamailio, a free SIP server.
7dd0b342
  *
02ca141b
  * Kamailio is free software; you can redistribute it and/or modify
7dd0b342
  * 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
  *
02ca141b
  * Kamailio is distributed in the hope that it will be useful,
7dd0b342
  * 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 
9e1ff448
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
a15c363f
  */
 
7dd0b342
 
a15c363f
 #ifndef error_h
 #define error_h
 
2f0f1a30
 #define E_OK           0
3e429f5c
 #define E_UNSPEC      -1
a15c363f
 #define E_OUT_OF_MEM  -2
 #define E_BAD_RE      -3
1400b772
 /* #define E_BAD_ADDRESS -4 */
a15c363f
 #define E_BUG         -5
3e429f5c
 #define E_CFG         -6
1400b772
 #define E_NO_SOCKET		-7
53c7e0f1
 /* unresolvable topmost Via */
caf80ae6
 #define E_BAD_VIA		-8
53c7e0f1
 /* incomplete transaction tuple */
caf80ae6
 #define E_BAD_TUPEL		-9
 /* script programming error */
 #define E_SCRIPT		-10
53c7e0f1
 /* error in execution of external tools */
30449150
 #define E_EXEC			-11
 /* too many branches demanded */
 #define E_TOO_MANY_BRANCHES -12
d5191539
 #define E_BAD_TO	-13
ff979952
 /* invalid params */
 #define E_INVALID_PARAMS -14
1400b772
 
0b4b7601
 #define E_Q_INV_CHAR    -15 /* Invalid character in q */
 #define E_Q_EMPTY       -16 /* Empty q */
 #define E_Q_TOO_BIG     -17 /* q too big (> 1) */
 #define E_Q_DEC_MISSING -18 /* Decimal part missing */
 
 
e1b83239
 
1400b772
 #define E_SEND		  -477
53c7e0f1
 /* unresolvable next-hop address */
1400b772
 #define E_BAD_ADDRESS -478
 /* unparseable URI */
 #define E_BAD_URI 	  -479
f2e456c3
 /* bad protocol, like */
 #define E_BAD_PROTO	  -480
53c7e0f1
 /* malformed request */
1400b772
 #define E_BAD_REQ	  -400
 
e1b83239
 #define E_CANCELED      -487 /* transaction already canceled */
 
30449150
 /* error in server */
 #define E_BAD_SERVER	  -500
dcb59e67
 #define E_ADM_PROHIBITED  -510
 #define E_BLACKLISTED	  -520
30449150
 
 
1400b772
 #define MAX_REASON_LEN	128
 
caf80ae6
 #include "str.h"
 
1400b772
 /* processing status of the last command */
 extern int ser_error;
 extern int prev_ser_error;
 
caf80ae6
 struct sip_msg;
 
 /* ser error -> SIP error */
1400b772
 int err2reason_phrase( int ser_error, int *sip_error, 
                 char *phrase, int etl, char *signature );
a15c363f
 
caf80ae6
 /* SIP error core -> SIP text */
 char *error_text( int code );
 
 /* return pkg_malloc-ed reply status in status->s */
 void get_reply_status( str *status, struct sip_msg *reply, int code );
a15c363f
 
 #endif