xmpp.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * $Id$
  3. *
  4. * XMPP Module
  5. * This file is part of Kamailio, a free SIP server.
  6. *
  7. * Copyright (C) 2006 Voice Sistem S.R.L.
  8. *
  9. * Kamailio 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. * Kamailio is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22. *
  23. * Author: Andreea Spirea
  24. *
  25. */
  26. /*! \file
  27. * \ingroup xmpp
  28. */
  29. #ifndef _MOD_XMPP_H
  30. #define _MOD_XMPP_H
  31. enum xmpp_pipe_cmd_type {
  32. XMPP_PIPE_SEND_PACKET = 1,
  33. XMPP_PIPE_SEND_MESSAGE = 2,
  34. XMPP_PIPE_SEND_PSUBSCRIBE = 4,
  35. XMPP_PIPE_SEND_PNOTIFY = 8
  36. };
  37. struct xmpp_pipe_cmd {
  38. enum xmpp_pipe_cmd_type type;
  39. char *from, *to, *body, *id;
  40. };
  41. /* configuration parameters */
  42. extern char domain_separator;
  43. extern char *gateway_domain;
  44. extern char *xmpp_domain;
  45. extern char *xmpp_host;
  46. extern int xmpp_port;
  47. extern char *xmpp_password;
  48. /* mod_xmpp.c */
  49. extern int xmpp_send_sip_msg(char *from, char *to, char *msg);
  50. extern void xmpp_free_pipe_cmd(struct xmpp_pipe_cmd *cmd);
  51. /* util.c */
  52. char *extract_domain(char *jid);
  53. char *random_secret(void);
  54. char *db_key(char *secret, char *domain, char *id);
  55. /* xmpp_server.c */
  56. int xmpp_server_child_process(int data_pipe);
  57. /* xmpp_component.c */
  58. int xmpp_component_child_process(int data_pipe);
  59. /* sha.c */
  60. char *shahash(const char *str);
  61. #endif