00001 /* 00002 * $Id: error.h 4597 2008-08-06 11:04:06Z klaus_darilion $ 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 /*! 00024 * \file 00025 * \brief Error definitions 00026 */ 00027 00028 00029 #ifndef error_h 00030 #define error_h 00031 00032 #define E_UNSPEC -1 00033 #define E_OUT_OF_MEM -2 00034 #define E_BAD_RE -3 00035 /* #define E_BAD_ADDRESS -4 */ 00036 #define E_BUG -5 00037 #define E_CFG -6 00038 #define E_NO_SOCKET -7 00039 #define E_BAD_VIA -8 /*!< unresolvable topmost Via */ 00040 #define E_BAD_TUPEL -9 /*!< incomplete transaction tuple */ 00041 #define E_SCRIPT -10 /*!< script programming error */ 00042 #define E_EXEC -11 /*!< error in execution of external tools */ 00043 #define E_TOO_MANY_BRANCHES -12 /*!< too many branches demanded */ 00044 #define E_BAD_TO -13 00045 #define E_INVALID_PARAMS -14 /*!< invalid params */ 00046 #define E_Q_INV_CHAR -15 /*!< Invalid character in q */ 00047 #define E_Q_EMPTY -16 /*!< Empty q */ 00048 #define E_Q_TOO_BIG -17 /*!< q too big (> 1) */ 00049 #define E_Q_DEC_MISSING -18 /*!< Decimal part missing */ 00050 #define E_NO_DESTINATION -19 /*!< Decimal part missing */ 00051 00052 /* kamailio specific error codes */ 00053 #define E_IP_BLOCKED -473 /*!< destination filtered */ 00054 #define E_BAD_PROTO -474 /*!< bad protocol, like */ 00055 #define E_BAD_URI -475 /*!< unparseable URI */ 00056 #define E_BAD_ADDRESS -476 /*!< unresolvable next-hop address */ 00057 #define E_SEND -477 /*!< generic send error */ 00058 00059 #define E_BAD_REQ -400 /*!< generic malformed request */ 00060 00061 #define E_BAD_SERVER -500 /*!< error in server */ 00062 00063 00064 #define MAX_REASON_LEN 128 00065 00066 #include "str.h" 00067 00068 /*! \brief processing status of the last command */ 00069 extern int ser_error; 00070 extern int prev_ser_error; 00071 00072 struct sip_msg; 00073 00074 /*! \brief ser error -> SIP error */ 00075 int err2reason_phrase( int ser_error, int *sip_error, 00076 char *phrase, int etl, char *signature ); 00077 00078 /*! \brief SIP error core -> SIP text */ 00079 char *error_text( int code ); 00080 00081 /*! \brief return pkg_malloc-ed reply status in status->s */ 00082 void get_reply_status( str *status, struct sip_msg *reply, int code ); 00083 00084 #endif
1.5.6