action.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * $Id$
  3. *
  4. *
  5. * Copyright (C) 2001-2003 FhG Fokus
  6. *
  7. * This file is part of ser, a free SIP server.
  8. *
  9. * ser is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version
  13. *
  14. * For a license to use the ser software under conditions
  15. * other than those described here, or to purchase support for this
  16. * software, please contact iptel.org by e-mail at the following addresses:
  17. * [email protected]
  18. *
  19. * ser is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to the Free Software
  26. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  27. */
  28. #ifndef action_h
  29. #define action_h
  30. #define USE_LONGJMP
  31. #include "route_struct.h"
  32. #include "parser/msg_parser.h"
  33. #ifdef USE_LONGJMP
  34. #include <setjmp.h>
  35. #endif
  36. struct run_act_ctx{
  37. int rec_lev;
  38. int run_flags;
  39. int last_retcode; /* return from last route */
  40. #ifdef USE_LONGJMP
  41. jmp_buf jmp_env;
  42. #endif
  43. };
  44. #define init_run_actions_ctx(ph) \
  45. do{\
  46. (ph)->rec_lev=(ph)->run_flags=(ph)->last_retcode=0; \
  47. }while(0)
  48. int do_action(struct run_act_ctx* c, struct action* a, struct sip_msg* msg);
  49. int run_actions(struct run_act_ctx* c, struct action* a, struct sip_msg* msg);
  50. #endif