msg_rules.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (C) 2005 iptelorg GmbH
  3. *
  4. * This file is part of ser, a free SIP server.
  5. *
  6. * ser 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
  10. *
  11. * For a license to use the ser software under conditions
  12. * other than those described here, or to purchase support for this
  13. * software, please contact iptel.org by e-mail at the following addresses:
  14. * [email protected]
  15. *
  16. * ser is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  24. */
  25. #ifndef __MSG_RULES_H
  26. #define __MSG_RULES_H
  27. #include <cds/sstr.h>
  28. #include <xcap/xcap_client.h>
  29. #include <xcap/common_policy.h>
  30. typedef cp_ruleset_t msg_rules_t;
  31. /* Type defining action for pres_rules */
  32. typedef enum {
  33. msg_handling_block,
  34. /* msg_handling_confirm, */
  35. msg_handling_allow
  36. } msg_handling_t;
  37. int get_msg_rules(const str_t *username, const str_t *filename,
  38. xcap_query_params_t *xcap_params, msg_rules_t **dst);
  39. void free_msg_rules(cp_ruleset_t *r);
  40. void free_msg_actions(cp_actions_t *a);
  41. /* returns 0 if rule found, 1 if not found and -1 on error */
  42. int get_msg_rules_action(msg_rules_t *r, const str_t *wuri, msg_handling_t *dst_action);
  43. #endif