ws_handshake.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (C) 2012-2013 Crocodile RCS Ltd
  3. *
  4. * This file is part of Kamailio, a free SIP server.
  5. *
  6. * Kamailio 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. * Kamailio is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. *
  20. * Exception: permission to copy, modify, propagate, and distribute a work
  21. * formed by combining OpenSSL toolkit software and the code in this file,
  22. * such as linking with software components and libraries released under
  23. * OpenSSL project license.
  24. *
  25. */
  26. #ifndef _WS_HANDSHAKE_H
  27. #define _WS_HANDSHAKE_H
  28. #include "../../sr_module.h"
  29. #include "../../parser/msg_parser.h"
  30. #include "ws_mod.h"
  31. #define DEFAULT_SUB_PROTOCOLS (SUB_PROTOCOL_SIP | SUB_PROTOCOL_MSRP)
  32. #define SUB_PROTOCOL_ALL (SUB_PROTOCOL_SIP | SUB_PROTOCOL_MSRP)
  33. extern int ws_sub_protocols;
  34. #define CORS_MODE_NONE 0
  35. #define CORS_MODE_ANY 1
  36. #define CORS_MODE_ORIGIN 2
  37. extern int ws_cors_mode;
  38. extern stat_var *ws_failed_handshakes;
  39. extern stat_var *ws_successful_handshakes;
  40. extern stat_var *ws_sip_successful_handshakes;
  41. extern stat_var *ws_msrp_successful_handshakes;
  42. int ws_handle_handshake(struct sip_msg *msg);
  43. struct mi_root *ws_mi_disable(struct mi_root *cmd, void *param);
  44. struct mi_root *ws_mi_enable(struct mi_root *cmd, void *param);
  45. #endif /* _WS_HANDSHAKE_H */