Codename Pineapple

Home page | Mailing list | Docs

Last updated: Sat Feb 3 05:00:49 2007

Asterisk developer's documentation :: Codename Pineapple


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    char channel[160];
00076    struct aji_resource *resources;
00077    enum aji_btype btype;
00078    unsigned int flags;
00079 };
00080 
00081 struct aji_buddy_container {
00082    ASTOBJ_CONTAINER_COMPONENTS(struct aji_buddy);
00083 };
00084 
00085 struct aji_transport_container {
00086    ASTOBJ_CONTAINER_COMPONENTS(struct aji_transport);
00087 };
00088 
00089 struct aji_client {
00090    ASTOBJ_COMPONENTS(struct aji_client);
00091    char password[160];
00092    char user[160];
00093    char serverhost[160];
00094    char context[100];
00095    char statusmessage[256];
00096    char sid[10]; /* Session ID */
00097    char mid[6]; /* Message ID */
00098    iksid *jid;
00099    iksparser *p;
00100    iksfilter *f;
00101    ikstack *stack;
00102    enum aji_state state;
00103    int port;
00104    int debug;
00105    int usetls;
00106    int forcessl;
00107    int usesasl;
00108    int keepalive;
00109    int allowguest;
00110    int timeout;
00111    int message_timeout;
00112    int authorized;
00113    unsigned int flags;
00114    int component; /* 0 client,  1 component */
00115    struct aji_buddy_container buddies;
00116    AST_LIST_HEAD(messages,aji_message) messages;
00117    void *jingle;
00118    pthread_t thread;
00119 };
00120 
00121 struct aji_client_container{
00122    ASTOBJ_CONTAINER_COMPONENTS(struct aji_client);
00123 };
00124 
00125 int ast_aji_send(struct aji_client *client, const char *address, const char *message);
00126 int ast_aji_disconnect(struct aji_client *client);
00127 int ast_aji_check_roster(void);
00128 void ast_aji_increment_mid(char *mid);
00129 int ast_aji_create_chat(struct aji_client *client,char *room, char *server, char *topic);
00130 int ast_aji_invite_chat(struct aji_client *client, char *user, char *room, char *message);
00131 int ast_aji_join_chat(struct aji_client *client,char *room);
00132 struct aji_client *ast_aji_get_client(const char *name);
00133 struct aji_client_container *ast_aji_get_clients(void);
00134 
00135 #endif

Asterisk is a trademark for Digium, inc.. | Edvina.net | Asterisk.org | This documentation was generated with Doxygen