Wed Aug 15 01:24:22 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_DISCONNECTING,
00028    AJI_DISCONNECTED,
00029    AJI_CONNECTING,
00030    AJI_CONNECTED
00031 };
00032 
00033 enum {
00034    AJI_AUTOPRUNE = (1 << 0),
00035    AJI_AUTOREGISTER = (1 << 1)
00036 };
00037 
00038 enum aji_btype {
00039    AJI_USER=0,
00040    AJI_TRANS=1,
00041    AJI_UTRANS=2
00042 };
00043 
00044 struct aji_version {
00045    char version[50];
00046    int jingle;
00047    struct aji_capabilities *parent;
00048    struct aji_version *next;
00049 };
00050 
00051 struct aji_capabilities {
00052    char node[200];
00053    struct aji_version *versions;
00054    struct aji_capabilities *next;
00055 };
00056 
00057 struct aji_resource {
00058    int status;
00059    char resource[80];
00060    char *description;
00061    struct aji_version *cap;
00062    int priority;
00063    struct aji_resource *next;
00064 };
00065 
00066 struct aji_message {
00067    char *from;
00068    char *message;
00069    char id[25];
00070    time_t arrived;
00071    AST_LIST_ENTRY(aji_message) list;
00072 };
00073 
00074 struct aji_buddy {
00075    ASTOBJ_COMPONENTS(struct aji_buddy);
00076    struct aji_resource *resources;
00077    unsigned int flags;
00078 };
00079 
00080 struct aji_buddy_container {
00081    ASTOBJ_CONTAINER_COMPONENTS(struct aji_buddy);
00082 };
00083 
00084 struct aji_transport_container {
00085    ASTOBJ_CONTAINER_COMPONENTS(struct aji_transport);
00086 };
00087 
00088 struct aji_client {
00089    ASTOBJ_COMPONENTS(struct aji_client);
00090    char password[160];
00091    char user[160];
00092    char serverhost[160];
00093    char context[100];
00094    char statusmessage[256];
00095    char sid[10]; /* Session ID */
00096    char mid[6]; /* Message ID */
00097    iksid *jid;
00098    iksparser *p;
00099    iksfilter *f;
00100    ikstack *stack;
00101    enum aji_state state;
00102    int port;
00103    int debug;
00104    int usetls;
00105    int forcessl;
00106    int usesasl;
00107    int keepalive;
00108    int allowguest;
00109    int timeout;
00110    int message_timeout;
00111    int authorized;
00112    unsigned int flags;
00113    int component; /* 0 client,  1 component */
00114    struct aji_buddy_container buddies;
00115    AST_LIST_HEAD(messages,aji_message) messages;
00116    void *jingle;
00117    pthread_t thread;
00118 };
00119 
00120 struct aji_client_container{
00121    ASTOBJ_CONTAINER_COMPONENTS(struct aji_client);
00122 };
00123 
00124 int ast_aji_send(struct aji_client *client, const char *address, const char *message);
00125 int ast_aji_disconnect(struct aji_client *client);
00126 int ast_aji_check_roster(void);
00127 void ast_aji_increment_mid(char *mid);
00128 int ast_aji_create_chat(struct aji_client *client,char *room, char *server, char *topic);
00129 int ast_aji_invite_chat(struct aji_client *client, char *user, char *room, char *message);
00130 int ast_aji_join_chat(struct aji_client *client,char *room);
00131 struct aji_client *ast_aji_get_client(const char *name);
00132 struct aji_client_container *ast_aji_get_clients(void);
00133 
00134 #endif

Generated on Wed Aug 15 01:24:22 2007 for Asterisk - the Open Source PBX by  doxygen 1.5.3