error.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2001-2003 FhG Fokus
  5. *
  6. * This file is part of ser, a free SIP server.
  7. *
  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
  12. *
  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:
  16. * [email protected]
  17. *
  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.
  22. *
  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
  26. */
  27. #ifndef error_h
  28. #define error_h
  29. #define E_OK 0
  30. #define E_UNSPEC -1
  31. #define E_OUT_OF_MEM -2
  32. #define E_BAD_RE -3
  33. /* #define E_BAD_ADDRESS -4 */
  34. #define E_BUG -5
  35. #define E_CFG -6
  36. #define E_NO_SOCKET -7
  37. /* unresolvable topmost Via */
  38. #define E_BAD_VIA -8
  39. /* incomplete transaction tuple */
  40. #define E_BAD_TUPEL -9
  41. /* script programming error */
  42. #define E_SCRIPT -10
  43. /* error in execution of external tools */
  44. #define E_EXEC -11
  45. /* too many branches demanded */
  46. #define E_TOO_MANY_BRANCHES -12
  47. #define E_BAD_TO -13
  48. /* invalid params */
  49. #define E_INVALID_PARAMS -14
  50. #define E_Q_INV_CHAR -15 /* Invalid character in q */
  51. #define E_Q_EMPTY -16 /* Empty q */
  52. #define E_Q_TOO_BIG -17 /* q too big (> 1) */
  53. #define E_Q_DEC_MISSING -18 /* Decimal part missing */
  54. #define E_SEND -477
  55. /* unresolvable next-hop address */
  56. #define E_BAD_ADDRESS -478
  57. /* unparseable URI */
  58. #define E_BAD_URI -479
  59. /* bad protocol, like */
  60. #define E_BAD_PROTO -480
  61. /* malformed request */
  62. #define E_BAD_REQ -400
  63. #define E_CANCELED -487 /* transaction already canceled */
  64. /* error in server */
  65. #define E_BAD_SERVER -500
  66. #define E_ADM_PROHIBITED -510
  67. #define E_BLACKLISTED -520
  68. #define MAX_REASON_LEN 128
  69. #include "str.h"
  70. /* processing status of the last command */
  71. extern int ser_error;
  72. extern int prev_ser_error;
  73. struct sip_msg;
  74. /* ser error -> SIP error */
  75. int err2reason_phrase( int ser_error, int *sip_error,
  76. char *phrase, int etl, char *signature );
  77. /* SIP error core -> SIP text */
  78. char *error_text( int code );
  79. /* return pkg_malloc-ed reply status in status->s */
  80. void get_reply_status( str *status, struct sip_msg *reply, int code );
  81. #endif