xmpp.h

Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * XMPP Module
00005  * This file is part of Kamailio, a free SIP server.
00006  *
00007  * Copyright (C) 2006 Voice Sistem S.R.L.
00008  *
00009  * Kamailio is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version
00013  *
00014  * Kamailio is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022  *
00023  * Author: Andreea Spirea
00024  *
00025  */
00026 
00031 #ifndef _MOD_XMPP_H
00032 #define _MOD_XMPP_H
00033 
00034 enum xmpp_pipe_cmd_type {
00035         XMPP_PIPE_SEND_PACKET     = 1,
00036         XMPP_PIPE_SEND_MESSAGE    = 2,
00037         XMPP_PIPE_SEND_PSUBSCRIBE = 4,
00038         XMPP_PIPE_SEND_PNOTIFY    = 8
00039 };
00040 
00041 struct xmpp_pipe_cmd {
00042         enum xmpp_pipe_cmd_type type;
00043         char *from, *to, *body, *id;
00044 };
00045 
00046 
00047 /* configuration parameters */
00048 extern char domain_separator;
00049 extern char *gateway_domain;
00050 extern char *xmpp_domain;
00051 extern char *xmpp_host;
00052 extern int xmpp_port;
00053 extern char *xmpp_password;
00054 
00055 /* mod_xmpp.c */
00056 extern int xmpp_send_sip_msg(char *from, char *to, char *msg);
00057 extern void xmpp_free_pipe_cmd(struct xmpp_pipe_cmd *cmd);
00058 
00059 /* util.c */
00060 char *extract_domain(char *jid);
00061 char *random_secret(void);
00062 char *db_key(char *secret, char *domain, char *id);
00063  
00064 
00065 /* xmpp_server.c */
00066 int xmpp_server_child_process(int data_pipe);
00067 
00068 /* xmpp_component.c */
00069 int xmpp_component_child_process(int data_pipe);
00070 
00071 /* sha.c */
00072 char *shahash(const char *str);
00073 
00074 #endif