Mon May 14 04:42:56 2007

Asterisk developer's documentation


jabber.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 1999 - 2005, Digium, Inc.
00005  *
00006  * Matt O'Gorman <mogorman@digium.com>
00007  *
00008  * See http://www.asterisk.org for more information about
00009  * the Asterisk project. Please do not directly contact
00010  * any of the maintainers of this project for assistance;
00011  * the project provides a web site, mailing lists and IRC
00012  * channels for your use.
00013  *
00014  * This program is free software, distributed under the terms of
00015  * the GNU General Public License Version 2. See the LICENSE file
00016  * at the top of the source tree.
00017  */
00018 
00019 #ifndef _ASTERISK_JABBER_H
00020 #define _ASTERISK_JABBER_H
00021 
00022 #include <iksemel.h>
00023 #include "asterisk/astobj.h"
00024 #include "asterisk/linkedlists.h"
00025 
00026 enum aji_state {
00027    AJI_DISCONNECTED = 0,
00028    AJI_CONNECTING,
00029    AJI_CONNECTED
00030 };
00031 
00032 enum {
00033    AJI_AUTOPRUNE = (1 << 0),
00034    AJI_AUTOREGISTER = (1 << 1)
00035 };
00036 
00037 enum aji_btype {
00038    AJI_USER=0,
00039    AJI_TRANS=1,
00040    AJI_UTRANS=2
00041 };
00042 
00043 struct aji_version {
00044    char version[50];
00045    int jingle;
00046    struct aji_capabilities *parent;
00047    struct aji_version *next;
00048 };
00049 
00050 struct aji_capabilities {
00051    char node[200];
00052    struct aji_version *versions;
00053    struct aji_capabilities *next;
00054 };
00055 
00056 struct aji_resource {
00057    int status;
00058    char resource[80];
00059    char *description;
00060    struct aji_version *cap;
00061    int priority;
00062    struct aji_resource *next;
00063 };
00064 
00065 struct aji_message {
00066    char *from;
00067    char *message;
00068    char id[25];
00069    time_t arrived;
00070    AST_LIST_ENTRY(aji_message) list;
00071 };
00072 
00073 struct aji_buddy {
00074    ASTOBJ_COMPONENTS(struct aji_buddy);
00075    struct aji_resource *resources;
00076    unsigned int flags;
00077 };
00078 
00079 struct aji_buddy_container {
00080    ASTOBJ_CONTAINER_COMPONENTS(struct aji_buddy);
00081 };
00082 
00083 struct aji_transport_container {
00084    ASTOBJ_CONTAINER_COMPONENTS(struct aji_transport);
00085 };
00086 
00087 struct aji_client {
00088    ASTOBJ_COMPONENTS(struct aji_client);
00089    char password[160];
00090    char user[160];
00091    char serverhost[160];
00092    char context[100];
00093    char statusmessage[256];
00094    char sid[10]; /* Session ID */
00095    char mid[6]; /* Message ID */
00096    iksid *jid;
00097    iksparser *p;
00098    iksfilter *f;
00099    ikstack *stack;
00100    enum aji_state state;
00101    int port;
00102    int debug;
00103    int usetls;
00104    int forcessl;
00105    int usesasl;
00106    int keepalive;
00107    int allowguest;
00108    int timeout;
00109    int message_timeout;
00110    int authorized;
00111    unsigned int flags;
00112    int component; /* 0 client,  1 component */
00113    struct aji_buddy_container buddies;
00114    AST_LIST_HEAD(messages,aji_message) messages;
00115    void *jingle;
00116    pthread_t thread;
00117 };
00118 
00119 struct aji_client_container{
00120    ASTOBJ_CONTAINER_COMPONENTS(struct aji_client);
00121 };
00122 
00123 int ast_aji_send(struct aji_client *client, const char *address, const char *message);
00124 int ast_aji_disconnect(struct aji_client *client);
00125 int ast_aji_check_roster(void);
00126 void ast_aji_increment_mid(char *mid);
00127 int ast_aji_create_chat(struct aji_client *client,char *room, char *server, char *topic);
00128 int ast_aji_invite_chat(struct aji_client *client, char *user, char *room, char *message);
00129 int ast_aji_join_chat(struct aji_client *client,char *room);
00130 struct aji_client *ast_aji_get_client(const char *name);
00131 struct aji_client_container *ast_aji_get_clients(void);
00132 
00133 #endif

Generated on Mon May 14 04:42:56 2007 for Asterisk - the Open Source PBX by  doxygen 1.5.1