2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 1999 - 2005, Digium, Inc.
6 * Matt O'Gorman <mogorman@digium.com>
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
19 #ifndef _ASTERISK_JABBER_H
20 #define _ASTERISK_JABBER_H
23 #include "asterisk/astobj.h"
24 #include "asterisk/linkedlists.h"
27 * As per RFC 3920 - section 3.1, the maximum length for a full Jabber ID
29 * The ABNF syntax for jid :
30 * jid = [node "@" ] domain [ "/" resource ]
31 * Each allowable portion of a JID (node identifier, domain identifier,
32 * and resource identifier) MUST NOT be more than 1023 bytes in length,
33 * resulting in a maximum total size (including the '@' and '/' separators)
36 #define AJI_MAX_JIDLEN 3071
37 #define AJI_MAX_RESJIDLEN 1023
47 AJI_AUTOPRUNE
= (1 << 0),
48 AJI_AUTOREGISTER
= (1 << 1)
60 struct aji_capabilities
*parent
;
61 struct aji_version
*next
;
64 struct aji_capabilities
{
66 struct aji_version
*versions
;
67 struct aji_capabilities
*next
;
72 char resource
[AJI_MAX_RESJIDLEN
];
74 struct aji_version
*cap
;
76 struct aji_resource
*next
;
84 AST_LIST_ENTRY(aji_message
) list
;
88 ASTOBJ_COMPONENTS_FULL(struct aji_buddy
, AJI_MAX_JIDLEN
, 1);
89 struct aji_resource
*resources
;
93 struct aji_buddy_container
{
94 ASTOBJ_CONTAINER_COMPONENTS(struct aji_buddy
);
97 struct aji_transport_container
{
98 ASTOBJ_CONTAINER_COMPONENTS(struct aji_transport
);
102 ASTOBJ_COMPONENTS(struct aji_client
);
104 char user
[AJI_MAX_JIDLEN
];
105 char serverhost
[AJI_MAX_RESJIDLEN
];
106 char statusmessage
[256];
107 char sid
[10]; /* Session ID */
108 char mid
[6]; /* Message ID */
113 enum aji_state state
;
125 int component
; /* 0 client, 1 component */
126 struct aji_buddy_container buddies
;
127 AST_LIST_HEAD(messages
,aji_message
) messages
;
132 struct aji_client_container
{
133 ASTOBJ_CONTAINER_COMPONENTS(struct aji_client
);
136 int ast_aji_send(struct aji_client
*client
, const char *address
, const char *message
);
137 int ast_aji_disconnect(struct aji_client
*client
);
138 int ast_aji_check_roster(void);
139 void ast_aji_increment_mid(char *mid
);
140 int ast_aji_create_chat(struct aji_client
*client
,char *room
, char *server
, char *topic
);
141 int ast_aji_invite_chat(struct aji_client
*client
, char *user
, char *room
, char *message
);
142 int ast_aji_join_chat(struct aji_client
*client
,char *room
);
143 struct aji_client
*ast_aji_get_client(const char *name
);
144 struct aji_client_container
*ast_aji_get_clients(void);