Asterisk - The Open Source Telephony Project GIT-master-a63eec2
|
XMPP client and component module. More...
#include "asterisk.h"
#include <ctype.h>
#include <iksemel.h>
#include "asterisk/xmpp.h"
#include "asterisk/module.h"
#include "asterisk/manager.h"
#include "asterisk/app.h"
#include "asterisk/mwi.h"
#include "asterisk/message.h"
#include "asterisk/cli.h"
#include "asterisk/config_options.h"
#include "asterisk/json.h"
Go to the source code of this file.
Data Structures | |
struct | ast_xmpp_client_config |
XMPP Client Configuration. More... | |
struct | ast_xmpp_global_config |
XMPP Global Configuration. More... | |
struct | xmpp_config |
struct | xmpp_pak_handler |
Defined handlers for different PAK types. More... | |
struct | xmpp_state_handler |
Defined handlers for XMPP client states. More... | |
Macros | |
#define | BUDDY_BUCKETS 53 |
Number of buckets for buddies (per client) | |
#define | BUDDY_NOT_IN_ROSTER 7 |
#define | BUDDY_OFFLINE 6 |
#define | CLIENT_BUCKETS 53 |
Number of buckets for client connections. | |
#define | RESOURCE_BUCKETS 53 |
Number of buckets for resources (per buddy) | |
#define | STATUS_DISAPPEAR 6 |
Status for a disappearing buddy. | |
#define | XMPP_TLS_NS "urn:ietf:params:xml:ns:xmpp-tls" |
Namespace for TLS support. | |
Enumerations | |
enum | { XMPP_AUTOPRUNE = (1 << 0) , XMPP_AUTOREGISTER = (1 << 1) , XMPP_AUTOACCEPT = (1 << 2) , XMPP_DEBUG = (1 << 3) , XMPP_USETLS = (1 << 4) , XMPP_USESASL = (1 << 5) , XMPP_FORCESSL = (1 << 6) , XMPP_KEEPALIVE = (1 << 7) , XMPP_COMPONENT = (1 << 8) , XMPP_SEND_TO_DIALPLAN = (1 << 9) , XMPP_DISTRIBUTE_EVENTS = (1 << 10) } |
Supported general configuration flags. More... | |
enum | { XMPP_XEP0248 = (1 << 0) , XMPP_PUBSUB = (1 << 1) , XMPP_PUBSUB_AUTOCREATE = (1 << 2) } |
Supported pubsub configuration flags. More... | |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | acf_jabberreceive_read (struct ast_channel *chan, const char *name, char *data, char *buf, size_t buflen) |
static int | acf_jabberstatus_read (struct ast_channel *chan, const char *name, char *data, char *buf, size_t buflen) |
static | AO2_GLOBAL_OBJ_STATIC (globals) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
int | ast_xmpp_chatroom_invite (struct ast_xmpp_client *client, const char *user, const char *room, const char *message) |
Invite a user to an XMPP multi-user chatroom. | |
int | ast_xmpp_chatroom_join (struct ast_xmpp_client *client, const char *room, const char *nickname) |
Join an XMPP multi-user chatroom. | |
int | ast_xmpp_chatroom_leave (struct ast_xmpp_client *client, const char *room, const char *nickname) |
Leave an XMPP multi-user chatroom. | |
int | ast_xmpp_chatroom_send (struct ast_xmpp_client *client, const char *nickname, const char *address, const char *message) |
Send a message to an XMPP multi-user chatroom. | |
static void * | ast_xmpp_client_config_alloc (const char *cat) |
Allocator function for configuration. | |
static void | ast_xmpp_client_config_destructor (void *obj) |
Destructor function for configuration. | |
int | ast_xmpp_client_disconnect (struct ast_xmpp_client *client) |
Disconnect an XMPP client connection. | |
struct ast_xmpp_client * | ast_xmpp_client_find (const char *name) |
Find an XMPP client connection using a given name. | |
void | ast_xmpp_client_lock (struct ast_xmpp_client *client) |
Lock an XMPP client connection. | |
int | ast_xmpp_client_send (struct ast_xmpp_client *client, iks *stanza) |
Send an XML stanza out using an established XMPP client connection. | |
int | ast_xmpp_client_send_message (struct ast_xmpp_client *client, const char *user, const char *message) |
Send a message to a given user using an established XMPP client connection. | |
void | ast_xmpp_client_unlock (struct ast_xmpp_client *client) |
Unlock an XMPP client connection. | |
void | ast_xmpp_client_unref (struct ast_xmpp_client *client) |
Release XMPP client connection reference. | |
void | ast_xmpp_increment_mid (char *mid) |
Helper function which increments the message identifier. | |
static int | cached_devstate_cb (void *obj, void *arg, int flags) |
static int | client_bitfield_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
static int | client_buddy_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
static int | client_status_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
CONFIG_INFO_STANDARD (cfg_info, globals, xmpp_config_alloc,.files=ACO_FILES(&res_xmpp_conf),.post_apply_config=xmpp_config_post_apply,) | |
static int | delete_old_messages (struct ast_xmpp_client *client, char *from) |
static int | fetch_access_token (struct ast_xmpp_client_config *cfg) |
static int | get_buddy_status (struct ast_xmpp_client_config *clientcfg, char *screenname, char *resource) |
static int | global_bitfield_handler (const struct aco_option *opt, struct ast_variable *var, void *obj) |
static int | load_module (void) |
Load the module. | |
static int | manager_jabber_send (struct mansession *s, const struct message *m) |
static int | reload (void) |
static void | sleep_with_backoff (unsigned int *sleep_time) |
static int | unload_module (void) |
static int | xmpp_action_hook (void *data, int type, iks *node) |
Action hook for when things occur. | |
static int | xmpp_buddy_cmp (void *obj, void *arg, int flags) |
Comparator function for XMPP buddy. | |
static void | xmpp_buddy_destructor (void *obj) |
Destructor callback function for XMPP buddy. | |
static int | xmpp_buddy_hash (const void *obj, const int flags) |
Hashing function for XMPP buddy. | |
static char * | xmpp_cli_create_collection (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
Method to expose PubSub collection node creation via CLI. | |
static char * | xmpp_cli_create_leafnode (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
Method to expose PubSub leaf node creation via CLI. | |
static char * | xmpp_cli_delete_pubsub_node (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
Method to expose PubSub node deletion via CLI. | |
static char * | xmpp_cli_list_pubsub_nodes (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
Method to expose PubSub node list via CLI. | |
static char * | xmpp_cli_purge_pubsub_nodes (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
Method to purge PubSub nodes via CLI. | |
static struct ast_xmpp_client * | xmpp_client_alloc (const char *name) |
Allocator function for ast_xmpp_client. | |
static int | xmpp_client_authenticate (struct ast_xmpp_client *client, struct ast_xmpp_client_config *cfg, int type, iks *node) |
Internal function called when we need to authenticate. | |
static int | xmpp_client_authenticate_digest (struct ast_xmpp_client *client, struct ast_xmpp_client_config *cfg, int type, iks *node) |
Internal function called when we need to authenticate using non-SASL. | |
static int | xmpp_client_authenticate_sasl (struct ast_xmpp_client *client, struct ast_xmpp_client_config *cfg, int type, iks *node) |
Internal function called when we need to authenticate using SASL. | |
static int | xmpp_client_authenticating (struct ast_xmpp_client *client, struct ast_xmpp_client_config *cfg, int type, iks *node) |
Internal function called when we are authenticating. | |
static void | xmpp_client_change_state (struct ast_xmpp_client *client, int state) |
Internal function which changes the XMPP client state. | |
static int | xmpp_client_config_merge_buddies (void *obj, void *arg, int flags) |
static int | xmpp_client_config_post_apply (void *obj, void *arg, int flags) |
static struct ast_xmpp_buddy * | xmpp_client_create_buddy (struct ao2_container *container, const char *id) |
Internal function which creates a buddy on a client. | |
static void | xmpp_client_destructor (void *obj) |
Destructor callback function for XMPP client. | |
static void * | xmpp_client_find_or_create (const char *category) |
Look up existing client or create a new one. | |
static int | xmpp_client_receive (struct ast_xmpp_client *client, unsigned int timeout) |
Internal function which receives data from the XMPP client connection. | |
static int | xmpp_client_reconnect (struct ast_xmpp_client *client) |
Internal function used to reconnect an XMPP client to its server. | |
static int | xmpp_client_request_tls (struct ast_xmpp_client *client, struct ast_xmpp_client_config *cfg, int type, iks *node) |
Internal function called when we need to request TLS support. | |
static int | xmpp_client_requested_tls (struct ast_xmpp_client *client, struct ast_xmpp_client_config *cfg, int type, iks *node) |
Internal function called when we receive a response to our TLS initiation request. | |
static int | xmpp_client_send_disco_info_request (struct ast_xmpp_client *client, const char *to, const char *from) |
Helper function which sends a discovery information request to a user. | |
static int | xmpp_client_send_message (struct ast_xmpp_client *client, int group, const char *nick, const char *address, const char *message) |
Internal function used to send a message to a user or chatroom. | |
static int | xmpp_client_send_raw_message (struct ast_xmpp_client *client, const char *message) |
Internal function which sends a raw message. | |
static int | xmpp_client_service_discovery_get_hook (void *data, ikspak *pak) |
Hook function called when client receives a service discovery get message. | |
static int | xmpp_client_service_discovery_result_hook (void *data, ikspak *pak) |
Hook function called when client receives a service discovery result message. | |
static int | xmpp_client_set_group_presence (struct ast_xmpp_client *client, const char *room, int level, const char *nick) |
static void | xmpp_client_set_presence (struct ast_xmpp_client *client, const char *to, const char *from, int level, const char *desc) |
Internal function which changes the presence status of an XMPP client. | |
static int | xmpp_client_subscribe_user (void *obj, void *arg, int flags) |
Callback function which subscribes to a user if needed. | |
static void * | xmpp_client_thread (void *data) |
XMPP client connection thread. | |
static int | xmpp_client_unsubscribe_user (struct ast_xmpp_client *client, const char *user) |
Helper function which unsubscribes a user and removes them from the roster. | |
static int | xmpp_component_authenticate (struct ast_xmpp_client *client, struct ast_xmpp_client_config *cfg, int type, iks *node) |
Internal function called when we should authenticate as a component. | |
static int | xmpp_component_authenticating (struct ast_xmpp_client *client, struct ast_xmpp_client_config *cfg, int type, iks *node) |
Internal function called when we authenticated as a component. | |
static int | xmpp_component_register_get_hook (void *data, ikspak *pak) |
Hook function called when the component is queried about registration. | |
static int | xmpp_component_register_set_hook (void *data, ikspak *pak) |
Hook function called when someone registers to the component. | |
static int | xmpp_component_service_discovery_get_hook (void *data, ikspak *pak) |
Hook function called when component receives a service discovery get message. | |
static int | xmpp_component_service_discovery_items_hook (void *data, ikspak *pak) |
Hook function called when we receive a service discovery items request. | |
static void * | xmpp_config_alloc (void) |
Allocator for XMPP configuration. | |
static int | xmpp_config_cmp (void *obj, void *arg, int flags) |
Comparator function for configuration. | |
static void | xmpp_config_destructor (void *obj) |
Destructor for XMPP configuration. | |
static void * | xmpp_config_find (struct ao2_container *tmp_container, const char *category) |
Find function for configuration. | |
static void | xmpp_config_post_apply (void) |
static int | xmpp_config_prelink (void *newitem) |
static int | xmpp_connect_hook (void *data, ikspak *pak) |
Hook function called when client finishes authenticating with the server. | |
static char * | xmpp_do_set_debug (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static void | xmpp_init_event_distribution (struct ast_xmpp_client *client) |
Initialize collections for event distribution. | |
static int | xmpp_io_recv (struct ast_xmpp_client *client, char *buffer, size_t buf_len, int timeout) |
Internal function which polls on an XMPP client and receives data. | |
static int | xmpp_is_secure (struct ast_xmpp_client *client) |
Helper function which returns whether an XMPP client connection is secure or not. | |
static int | xmpp_join_exec (struct ast_channel *chan, const char *data) |
Application to join a chat room. | |
static int | xmpp_leave_exec (struct ast_channel *chan, const char *data) |
Application to leave a chat room. | |
static void | xmpp_log_hook (void *data, const char *xmpp, size_t size, int incoming) |
Logging hook function. | |
static void | xmpp_message_destroy (struct ast_xmpp_message *message) |
Destroy function for XMPP messages. | |
static int | xmpp_pak_message (struct ast_xmpp_client *client, struct ast_xmpp_client_config *cfg, iks *node, ikspak *pak) |
Internal function called when a message is received. | |
static int | xmpp_pak_presence (struct ast_xmpp_client *client, struct ast_xmpp_client_config *cfg, iks *node, ikspak *pak) |
Internal function called when a presence message is received. | |
static int | xmpp_pak_s10n (struct ast_xmpp_client *client, struct ast_xmpp_client_config *cfg, iks *node, ikspak *pak) |
Internal function called when a subscription message is received. | |
static int | xmpp_ping_request (struct ast_xmpp_client *client, const char *to, const char *from) |
Helper function which sends a ping request to a server. | |
static iks * | xmpp_pubsub_build_node_config (iks *pubsub, const char *node_type, const char *collection_name) |
static iks * | xmpp_pubsub_build_node_request (struct ast_xmpp_client *client, const char *collection) |
Build the a node request. | |
static iks * | xmpp_pubsub_build_publish_skeleton (struct ast_xmpp_client *client, const char *node, const char *event_type, unsigned int cachable) |
Build the skeleton of a publish. | |
static void | xmpp_pubsub_create_affiliations (struct ast_xmpp_client *client, const char *node) |
Add Owner affiliations for pubsub node. | |
static void | xmpp_pubsub_create_collection (struct ast_xmpp_client *client, const char *collection_name) |
Create a PubSub collection node. | |
static void | xmpp_pubsub_create_leaf (struct ast_xmpp_client *client, const char *collection_name, const char *leaf_name) |
Create a PubSub leaf node. | |
static void | xmpp_pubsub_create_node (struct ast_xmpp_client *client, const char *node_type, const char *name, const char *collection_name) |
Create a pubsub node. | |
static void | xmpp_pubsub_delete_node (struct ast_xmpp_client *client, const char *node_name) |
Delete a PubSub node. | |
static int | xmpp_pubsub_delete_node_list (void *data, ikspak *pak) |
Delete pubsub item lists. | |
static void | xmpp_pubsub_devstate_cb (void *data, struct stasis_subscription *sub, struct stasis_message *msg) |
Callback function for device state events. | |
static int | xmpp_pubsub_handle_error (void *data, ikspak *pak) |
static int | xmpp_pubsub_handle_event (void *data, ikspak *pak) |
Callback for handling PubSub events. | |
static iks * | xmpp_pubsub_iq_create (struct ast_xmpp_client *client, const char *type) |
Create an IQ packet. | |
static void | xmpp_pubsub_mwi_cb (void *data, struct stasis_subscription *sub, struct stasis_message *msg) |
Callback function for MWI events. | |
static void | xmpp_pubsub_publish_device_state (struct ast_xmpp_client *client, const char *device, const char *device_state, unsigned int cachable) |
Publish device state to a PubSub node. | |
static void | xmpp_pubsub_publish_mwi (struct ast_xmpp_client *client, const char *mailbox, const char *oldmsgs, const char *newmsgs) |
Publish MWI to a PubSub node. | |
static void | xmpp_pubsub_purge_nodes (struct ast_xmpp_client *client, const char *collection_name) |
static int | xmpp_pubsub_receive_node_list (void *data, ikspak *pak) |
Receive pubsub item lists. | |
static void | xmpp_pubsub_request_nodes (struct ast_xmpp_client *client, const char *collection) |
Request item list from pubsub. | |
static void | xmpp_pubsub_subscribe (struct ast_xmpp_client *client, const char *node) |
Subscribe to a PubSub node. | |
static void | xmpp_pubsub_unsubscribe (struct ast_xmpp_client *client, const char *node) |
Unsubscribe from a PubSub node. | |
static int | xmpp_resource_cmp (void *obj, void *arg, int flags) |
Comparator function for XMPP resource. | |
static void | xmpp_resource_destructor (void *obj) |
Destructor callback function for XMPP resource. | |
static int | xmpp_resource_hash (const void *obj, const int flags) |
Hashing function for XMPP resource. | |
static int | xmpp_resource_immediate (void *obj, void *arg, int flags) |
Internal astobj2 callback function which returns the first resource, which is the highest priority one. | |
static int | xmpp_resource_is_available (void *obj, void *arg, int flags) |
Callback function which returns when the resource is available. | |
static int | xmpp_roster_hook (void *data, ikspak *pak) |
Hook function called when roster is received from server. | |
static int | xmpp_send_cb (const struct ast_msg *msg, const char *to, const char *from) |
static int | xmpp_send_exec (struct ast_channel *chan, const char *data) |
static int | xmpp_send_stream_header (struct ast_xmpp_client *client, const struct ast_xmpp_client_config *cfg, const char *to) |
Helper function which sends an XMPP stream header to the server. | |
static int | xmpp_sendgroup_exec (struct ast_channel *chan, const char *data) |
Application to send a message to a groupchat. | |
static char * | xmpp_show_buddies (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | xmpp_show_clients (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
XMPP client and component module.
Iksemel http://code.google.com/p/iksemel/
A reference module for interfacting Asterisk directly as a client or component with an XMPP/Jabber compliant server.
This module is based upon the original res_jabber as done by Matt O'Gorman.
Definition in file res_xmpp.c.
#define BUDDY_BUCKETS 53 |
Number of buckets for buddies (per client)
Definition at line 558 of file res_xmpp.c.
#define BUDDY_NOT_IN_ROSTER 7 |
Definition at line 1757 of file res_xmpp.c.
#define BUDDY_OFFLINE 6 |
Definition at line 1756 of file res_xmpp.c.
#define CLIENT_BUCKETS 53 |
Number of buckets for client connections.
Definition at line 555 of file res_xmpp.c.
#define RESOURCE_BUCKETS 53 |
Number of buckets for resources (per buddy)
Definition at line 561 of file res_xmpp.c.
#define STATUS_DISAPPEAR 6 |
Status for a disappearing buddy.
Definition at line 567 of file res_xmpp.c.
#define XMPP_TLS_NS "urn:ietf:params:xml:ns:xmpp-tls" |
Namespace for TLS support.
Definition at line 564 of file res_xmpp.c.
anonymous enum |
Supported general configuration flags.
Enumerator | |
---|---|
XMPP_AUTOPRUNE | |
XMPP_AUTOREGISTER | |
XMPP_AUTOACCEPT | |
XMPP_DEBUG | |
XMPP_USETLS | |
XMPP_USESASL | |
XMPP_FORCESSL | |
XMPP_KEEPALIVE | |
XMPP_COMPONENT | |
XMPP_SEND_TO_DIALPLAN | |
XMPP_DISTRIBUTE_EVENTS |
Definition at line 533 of file res_xmpp.c.
anonymous enum |
Supported pubsub configuration flags.
Enumerator | |
---|---|
XMPP_XEP0248 | |
XMPP_PUBSUB | |
XMPP_PUBSUB_AUTOCREATE |
Definition at line 548 of file res_xmpp.c.
|
static |
Definition at line 4832 of file res_xmpp.c.
|
static |
Definition at line 4832 of file res_xmpp.c.
|
static |
Definition at line 2062 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, args, AST_APP_ARG, ast_autoservice_start(), ast_autoservice_stop(), ast_channel_name(), ast_cond_timedwait, ast_copy_string(), ast_debug, AST_DECLARE_APP_ARGS, AST_LIST_EMPTY, AST_LIST_LOCK, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, AST_LIST_UNLOCK, ast_log, ast_mutex_lock, ast_mutex_unlock, AST_NONSTANDARD_APP_ARGS, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), ast_tv(), ast_tvadd(), ast_tvdiff_ms(), ast_tvdiff_sec(), ast_tvnow(), buf, globals, LOG_NOTICE, LOG_WARNING, ast_xmpp_message::message, message_received_condition, messagelock, name, NULL, RAII_VAR, xmpp_config_find(), XMPP_MAX_JIDLEN, and xmpp_message_destroy().
|
static |
Definition at line 1795 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log, AST_NONSTANDARD_APP_ARGS, AST_STANDARD_APP_ARGS, ast_strlen_zero(), buf, get_buddy_status(), globals, LOG_ERROR, LOG_WARNING, NULL, RAII_VAR, and xmpp_config_find().
|
static |
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 4832 of file res_xmpp.c.
int ast_xmpp_chatroom_invite | ( | struct ast_xmpp_client * | client, |
const char * | user, | ||
const char * | room, | ||
const char * | message | ||
) |
Invite a user to an XMPP multi-user chatroom.
client | Pointer to the client |
user | JID of the user |
room | Name of the chatroom |
message | Message to send with the invitation |
0 | on success |
-1 | on failure |
Definition at line 1072 of file res_xmpp.c.
References ast_xmpp_client_lock(), ast_xmpp_client_send(), ast_xmpp_client_unlock(), ast_xmpp_increment_mid(), done, ast_xmpp_client::mid, and NULL.
int ast_xmpp_chatroom_join | ( | struct ast_xmpp_client * | client, |
const char * | room, | ||
const char * | nickname | ||
) |
Join an XMPP multi-user chatroom.
client | Pointer to the client |
room | Name of the chatroom |
nickname | Nickname to use |
0 | on success |
-1 | on failure |
Definition at line 1139 of file res_xmpp.c.
References xmpp_client_set_group_presence().
Referenced by xmpp_join_exec().
int ast_xmpp_chatroom_leave | ( | struct ast_xmpp_client * | client, |
const char * | room, | ||
const char * | nickname | ||
) |
Leave an XMPP multi-user chatroom.
client | Pointer to the client |
room | Name of the chatroom |
nickname | Nickname being used |
0 | on success |
-1 | on failure |
Definition at line 1149 of file res_xmpp.c.
References xmpp_client_set_group_presence().
Referenced by xmpp_leave_exec().
int ast_xmpp_chatroom_send | ( | struct ast_xmpp_client * | client, |
const char * | nickname, | ||
const char * | address, | ||
const char * | message | ||
) |
Send a message to an XMPP multi-user chatroom.
client | Pointer to the client |
nickname | Nickname to use |
address | Address of the room |
message | Message itself |
0 | on success |
-1 | on failure |
Definition at line 1144 of file res_xmpp.c.
References xmpp_client_send_message().
Referenced by xmpp_sendgroup_exec().
|
static |
Allocator function for configuration.
Definition at line 806 of file res_xmpp.c.
References ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_ref, ast_string_field_init, ast_string_field_set, ast_xmpp_client_config_destructor(), ast_xmpp_client_config::buddies, BUDDY_BUCKETS, ast_xmpp_client_config::client, name, NULL, xmpp_buddy_cmp(), xmpp_buddy_hash(), and xmpp_client_find_or_create().
|
static |
Destructor function for configuration.
Definition at line 658 of file res_xmpp.c.
References ao2_cleanup, ast_string_field_free_memory, ast_xmpp_client_config::buddies, and ast_xmpp_client_config::client.
Referenced by ast_xmpp_client_config_alloc().
int ast_xmpp_client_disconnect | ( | struct ast_xmpp_client * | client | ) |
Disconnect an XMPP client connection.
client | Pointer to the client |
0 | on success |
-1 | on failure |
Definition at line 3654 of file res_xmpp.c.
References AST_PTHREADT_NULL, ast_xmpp_client::device_state_sub, ast_xmpp_client::mwi_sub, NULL, ast_xmpp_client::parser, stasis_unsubscribe_and_join(), ast_xmpp_client::thread, xmpp_client_change_state(), xmpp_pubsub_unsubscribe(), XMPP_STATE_DISCONNECTED, and XMPP_STATE_DISCONNECTING.
Referenced by xmpp_client_config_post_apply(), xmpp_client_destructor(), xmpp_client_reconnect(), and xmpp_client_thread().
struct ast_xmpp_client * ast_xmpp_client_find | ( | const char * | name | ) |
Find an XMPP client connection using a given name.
name | Name of the client connection |
non-NULL | on success |
NULL | on failure |
Definition at line 1010 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ao2_ref, globals, name, NULL, RAII_VAR, and xmpp_config_find().
Referenced by custom_connection_handler().
void ast_xmpp_client_lock | ( | struct ast_xmpp_client * | client | ) |
Lock an XMPP client connection.
client | Pointer to the client |
Definition at line 1028 of file res_xmpp.c.
References ao2_lock.
Referenced by ast_xmpp_chatroom_invite(), xmpp_client_authenticate_digest(), xmpp_client_authenticating(), xmpp_client_send_disco_info_request(), xmpp_component_register_set_hook(), xmpp_pak_message(), xmpp_ping_request(), and xmpp_pubsub_iq_create().
int ast_xmpp_client_send | ( | struct ast_xmpp_client * | client, |
iks * | stanza | ||
) |
Send an XML stanza out using an established XMPP client connection.
client | Pointer to the client |
stanza | Pointer to the Iksemel stanza |
0 | on success |
-1 | on failure |
Definition at line 2663 of file res_xmpp.c.
References xmpp_client_send_raw_message().
Referenced by ast_xmpp_chatroom_invite(), jingle_send_error_response(), jingle_send_response(), jingle_send_session_action(), jingle_send_session_info(), jingle_send_session_terminate(), jingle_send_transport_info(), xmpp_client_authenticate_digest(), xmpp_client_authenticate_sasl(), xmpp_client_authenticating(), xmpp_client_send_disco_info_request(), xmpp_client_send_message(), xmpp_client_service_discovery_get_hook(), xmpp_client_set_group_presence(), xmpp_client_set_presence(), xmpp_client_subscribe_user(), xmpp_client_unsubscribe_user(), xmpp_component_register_get_hook(), xmpp_component_register_set_hook(), xmpp_component_service_discovery_get_hook(), xmpp_component_service_discovery_items_hook(), xmpp_connect_hook(), xmpp_pak_s10n(), xmpp_ping_request(), xmpp_pubsub_create_affiliations(), xmpp_pubsub_create_node(), xmpp_pubsub_delete_node(), xmpp_pubsub_handle_error(), xmpp_pubsub_publish_device_state(), xmpp_pubsub_publish_mwi(), xmpp_pubsub_purge_nodes(), xmpp_pubsub_request_nodes(), xmpp_pubsub_subscribe(), and xmpp_pubsub_unsubscribe().
int ast_xmpp_client_send_message | ( | struct ast_xmpp_client * | client, |
const char * | user, | ||
const char * | message | ||
) |
Send a message to a given user using an established XMPP client connection.
client | Pointer to the client |
user | User the message should be sent to |
message | The message to send |
0 | on success |
-1 | on failure |
Definition at line 1067 of file res_xmpp.c.
References NULL, and xmpp_client_send_message().
Referenced by jingle_sendtext(), manager_jabber_send(), xmpp_send_cb(), and xmpp_send_exec().
void ast_xmpp_client_unlock | ( | struct ast_xmpp_client * | client | ) |
Unlock an XMPP client connection.
client | Pointer to the client |
Definition at line 1033 of file res_xmpp.c.
References ao2_unlock.
Referenced by ast_xmpp_chatroom_invite(), xmpp_client_authenticate_digest(), xmpp_client_authenticating(), xmpp_client_send_disco_info_request(), xmpp_component_register_set_hook(), xmpp_pak_message(), xmpp_ping_request(), and xmpp_pubsub_iq_create().
void ast_xmpp_client_unref | ( | struct ast_xmpp_client * | client | ) |
Release XMPP client connection reference.
client | Pointer to the client |
Definition at line 1023 of file res_xmpp.c.
References ao2_ref.
Referenced by jingle_endpoint_destructor(), and jingle_session_destructor().
void ast_xmpp_increment_mid | ( | char * | mid | ) |
Helper function which increments the message identifier.
mid | Pointer to a string containing the message identifier |
Definition at line 1154 of file res_xmpp.c.
Referenced by ast_xmpp_chatroom_invite(), jingle_send_session_action(), jingle_send_session_info(), jingle_send_session_terminate(), jingle_send_transport_info(), xmpp_client_authenticate_digest(), xmpp_client_authenticating(), xmpp_client_send_disco_info_request(), xmpp_component_register_set_hook(), xmpp_ping_request(), and xmpp_pubsub_iq_create().
|
static |
Definition at line 1700 of file res_xmpp.c.
References ast_xmpp_client::device_state_sub, and xmpp_pubsub_devstate_cb().
Referenced by xmpp_init_event_distribution().
|
static |
Definition at line 4654 of file res_xmpp.c.
References ast_set2_flag, ast_true(), ast_xmpp_client_config::flags, ast_xmpp_client_config::mod_flags, var, XMPP_AUTOACCEPT, XMPP_AUTOPRUNE, XMPP_AUTOREGISTER, XMPP_COMPONENT, XMPP_DEBUG, XMPP_DISTRIBUTE_EVENTS, XMPP_FORCESSL, XMPP_KEEPALIVE, XMPP_SEND_TO_DIALPLAN, XMPP_USESASL, and XMPP_USETLS.
Referenced by load_module().
|
static |
Definition at line 4719 of file res_xmpp.c.
References ao2_find, ao2_ref, ast_xmpp_client_config::buddies, OBJ_KEY, var, and xmpp_client_create_buddy().
Referenced by load_module().
|
static |
Definition at line 4690 of file res_xmpp.c.
References ast_xmpp_client_config::status, and var.
Referenced by load_module().
CONFIG_INFO_STANDARD | ( | cfg_info | , |
globals | , | ||
xmpp_config_alloc | , | ||
. | files = ACO_FILES(&res_xmpp_conf) , |
||
. | post_apply_config = xmpp_config_post_apply |
||
) |
|
static |
Definition at line 2221 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, AST_LIST_LOCK, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, AST_LIST_UNLOCK, ast_tvdiff_sec(), ast_tvnow(), ast_xmpp_message::from, globals, ast_xmpp_message::list, ast_xmpp_client::messages, ast_xmpp_client::name, NULL, RAII_VAR, xmpp_config_find(), and xmpp_message_destroy().
Referenced by xmpp_pak_message().
|
static |
Definition at line 3953 of file res_xmpp.c.
References ast_asprintf, ast_debug, ast_free, ast_func_read(), ast_json_load_string(), ast_json_object_get(), ast_json_string_get(), ast_json_unref(), ast_log, ast_string_field_set, error(), LOG_ERROR, ast_xmpp_client_config::name, NULL, ast_xmpp_client_config::oauth_clientid, ast_xmpp_client_config::oauth_secret, RAII_VAR, ast_xmpp_client_config::refresh_token, and url.
Referenced by xmpp_client_reconnect().
|
static |
Definition at line 1759 of file res_xmpp.c.
References ao2_callback, ao2_cleanup, ao2_find, ast_strlen_zero(), ast_xmpp_client::buddies, BUDDY_NOT_IN_ROSTER, BUDDY_OFFLINE, ast_xmpp_client_config::client, OBJ_KEY, ast_xmpp_buddy::resources, status, ast_xmpp_resource::status, xmpp_resource_cmp(), and xmpp_resource_immediate().
Referenced by acf_jabberstatus_read().
|
static |
Definition at line 4631 of file res_xmpp.c.
References ast_set2_flag, ast_true(), debug, global, var, XMPP_AUTOACCEPT, XMPP_AUTOPRUNE, XMPP_AUTOREGISTER, XMPP_PUBSUB_AUTOCREATE, and XMPP_XEP0248.
Referenced by load_module().
|
static |
Load the module.
Module loading including tests for configuration or dependencies. This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails tests return AST_MODULE_LOAD_FAILURE. If the module can not load the configuration file or other non-critical problem return AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
Definition at line 4748 of file res_xmpp.c.
References ACO_EXACT, aco_info_destroy(), aco_info_init(), aco_option_register, aco_option_register_custom, aco_process_config(), ACO_PROCESS_ERROR, app_ajijoin, app_ajileave, app_ajisend, app_ajisendgroup, ARRAY_LEN, ast_cli_register_multiple, ast_cond_init, ast_custom_function_register, ast_eid_default, ast_eid_is_empty(), ast_log, ast_manager_register_xml, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_msg_tech_register(), ast_mutex_init, ast_register_application_xml, client_bitfield_handler(), client_buddy_handler(), client_options, client_status_handler(), EVENT_FLAG_SYSTEM, FLDSET, global_bitfield_handler(), global_options, jabberreceive_function, jabberstatus_function, LOG_WARNING, manager_jabber_send(), message_received_condition, messagelock, msg_tech, NULL, OPT_STRINGFIELD_T, OPT_UINT_T, priority, STRFLDSET, xmpp_cli, xmpp_join_exec(), xmpp_leave_exec(), xmpp_send_exec(), and xmpp_sendgroup_exec().
|
static |
Definition at line 4053 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ast_strlen_zero(), ast_xmpp_client_send_message(), astman_append(), astman_get_header(), astman_send_ack(), astman_send_error(), globals, NULL, RAII_VAR, and xmpp_config_find().
Referenced by load_module().
|
static |
Definition at line 4817 of file res_xmpp.c.
References aco_process_config(), ACO_PROCESS_ERROR, and AST_MODULE_LOAD_DECLINE.
|
static |
Definition at line 3845 of file res_xmpp.c.
Referenced by xmpp_client_thread().
|
static |
Definition at line 4610 of file res_xmpp.c.
References aco_info_destroy(), ao2_global_obj_release, app_ajijoin, app_ajileave, app_ajisend, app_ajisendgroup, app_ajistatus, ARRAY_LEN, ast_cli_unregister_multiple(), ast_cond_destroy, ast_custom_function_unregister(), ast_manager_unregister(), ast_msg_tech_unregister(), ast_mutex_destroy, ast_unregister_application(), globals, jabberreceive_function, jabberstatus_function, message_received_condition, messagelock, msg_tech, and xmpp_cli.
|
static |
Action hook for when things occur.
Definition at line 3584 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ARRAY_LEN, ast_log, ast_test_flag, xmpp_state_handler::component, ast_xmpp_client::filter, globals, handler(), LOG_ERROR, ast_xmpp_client::name, NULL, RAII_VAR, ast_xmpp_client::state, type, xmpp_pak_handler::type, XMPP_COMPONENT, xmpp_config_find(), XMPP_MAX_ATTRLEN, xmpp_pak_handlers, XMPP_STATE_DISCONNECTING, and xmpp_state_handlers.
Referenced by xmpp_client_config_post_apply().
|
static |
Comparator function for XMPP buddy.
Definition at line 716 of file res_xmpp.c.
References CMP_MATCH, CMP_STOP, ast_xmpp_buddy::id, and OBJ_KEY.
Referenced by ast_xmpp_client_config_alloc(), and xmpp_client_alloc().
|
static |
Destructor callback function for XMPP buddy.
Definition at line 991 of file res_xmpp.c.
References ao2_ref, and ast_xmpp_buddy::resources.
Referenced by xmpp_client_create_buddy().
|
static |
Hashing function for XMPP buddy.
Definition at line 707 of file res_xmpp.c.
References ast_str_hash(), ast_xmpp_buddy::id, and OBJ_KEY.
Referenced by ast_xmpp_client_config_alloc(), and xmpp_client_alloc().
|
static |
Method to expose PubSub collection node creation via CLI.
Definition at line 4347 of file res_xmpp.c.
References a, ao2_cleanup, ao2_global_obj_ref, ast_cli(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, globals, name, NULL, RAII_VAR, ast_cli_entry::usage, xmpp_config_find(), and xmpp_pubsub_create_collection().
|
static |
Method to expose PubSub leaf node creation via CLI.
Definition at line 4387 of file res_xmpp.c.
References a, ao2_cleanup, ao2_global_obj_ref, ast_cli(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, globals, name, NULL, RAII_VAR, ast_cli_entry::usage, xmpp_config_find(), and xmpp_pubsub_create_leaf().
|
static |
Method to expose PubSub node deletion via CLI.
e | pointer to ast_cli_entry structure |
cmd | |
a | pointer to ast_cli_args structure |
Definition at line 4309 of file res_xmpp.c.
References a, ao2_cleanup, ao2_global_obj_ref, ast_cli(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, globals, name, NULL, RAII_VAR, ast_cli_entry::usage, xmpp_config_find(), and xmpp_pubsub_delete_node().
|
static |
Method to expose PubSub node list via CLI.
e | pointer to ast_cli_entry structure |
cmd | |
a | pointer to ast_cli_args structure |
Definition at line 4178 of file res_xmpp.c.
References a, ao2_cleanup, ao2_global_obj_ref, ast_cli(), CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, globals, name, NULL, RAII_VAR, ast_cli_entry::usage, xmpp_config_find(), and xmpp_pubsub_request_nodes().
|
static |
Method to purge PubSub nodes via CLI.
e | pointer to ast_cli_entry structure |
cmd | |
a | pointer to ast_cli_args structure |
Definition at line 4264 of file res_xmpp.c.
References a, ao2_cleanup, ao2_global_obj_ref, ast_cli(), ast_test_flag, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, globals, name, NULL, RAII_VAR, ast_cli_entry::usage, xmpp_config_find(), xmpp_pubsub_delete_node(), xmpp_pubsub_purge_nodes(), and XMPP_XEP0248.
|
static |
Allocator function for ast_xmpp_client.
Definition at line 739 of file res_xmpp.c.
References ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_ref, ast_copy_string(), ast_endpoint_create(), AST_LIST_HEAD_INIT, ast_log, AST_PTHREADT_NULL, ast_string_field_init, ast_string_field_set, ast_xmpp_client::buddies, BUDDY_BUCKETS, ast_xmpp_client::endpoint, LOG_ERROR, ast_xmpp_client::messages, ast_xmpp_client::mid, name, NULL, ast_xmpp_client::stack, ast_xmpp_client::thread, ast_xmpp_client::timeout, xmpp_buddy_cmp(), xmpp_buddy_hash(), xmpp_client_change_state(), xmpp_client_destructor(), and XMPP_STATE_DISCONNECTED.
Referenced by xmpp_client_find_or_create().
|
static |
Internal function called when we need to authenticate.
Definition at line 2886 of file res_xmpp.c.
References ast_test_flag, ast_xmpp_client_config::flags, type, xmpp_client_authenticate_digest(), xmpp_client_authenticate_sasl(), and XMPP_USESASL.
|
static |
Internal function called when we need to authenticate using non-SASL.
Definition at line 2783 of file res_xmpp.c.
References ast_log, ast_sha1_hash(), ast_xmpp_client_lock(), ast_xmpp_client_send(), ast_xmpp_client_unlock(), ast_xmpp_increment_mid(), buf, ast_xmpp_client::filter, ast_xmpp_client::jid, LOG_ERROR, ast_xmpp_client::mid, ast_xmpp_client::name, NULL, ast_xmpp_client_config::password, xmpp_client_change_state(), xmpp_connect_hook(), and XMPP_STATE_AUTHENTICATING.
Referenced by xmpp_client_authenticate().
|
static |
Internal function called when we need to authenticate using SASL.
Definition at line 2821 of file res_xmpp.c.
References ast_base64encode(), ast_log, ast_strdupa, ast_strlen_zero(), ast_xmpp_client_send(), base64, ast_xmpp_client::jid, len(), LOG_ERROR, ast_xmpp_client::name, ast_xmpp_client::parser, ast_xmpp_client_config::password, ast_xmpp_client_config::refresh_token, strsep(), xmpp_client_change_state(), xmpp_is_secure(), and XMPP_STATE_AUTHENTICATING.
Referenced by xmpp_client_authenticate().
|
static |
Internal function called when we are authenticating.
Definition at line 2892 of file res_xmpp.c.
References ast_log, ast_xmpp_client_lock(), ast_xmpp_client_send(), ast_xmpp_client_unlock(), ast_xmpp_increment_mid(), ast_xmpp_client::filter, ast_xmpp_client::jid, LOG_ERROR, ast_xmpp_client::mid, ast_xmpp_client::name, xmpp_connect_hook(), and xmpp_send_stream_header().
|
static |
Internal function which changes the XMPP client state.
Definition at line 725 of file res_xmpp.c.
References AST_ENDPOINT_OFFLINE, AST_ENDPOINT_ONLINE, ast_endpoint_set_state(), ast_xmpp_client::endpoint, ast_xmpp_client::state, XMPP_STATE_CONNECTED, and XMPP_STATE_DISCONNECTED.
Referenced by ast_xmpp_client_disconnect(), xmpp_client_alloc(), xmpp_client_authenticate_digest(), xmpp_client_authenticate_sasl(), xmpp_client_reconnect(), xmpp_client_request_tls(), xmpp_client_requested_tls(), xmpp_component_authenticate(), xmpp_component_authenticating(), xmpp_connect_hook(), and xmpp_roster_hook().
|
static |
Definition at line 3937 of file res_xmpp.c.
References ao2_find, ao2_link, ao2_ref, ast_xmpp_buddy::id, and OBJ_KEY.
Referenced by xmpp_client_config_post_apply().
|
static |
Definition at line 3992 of file res_xmpp.c.
References ao2_callback, ao2_cleanup, ao2_global_obj_ref, ast_copy_flags, ast_log, ast_pthread_create_background, ast_strlen_zero(), ast_test_flag, ast_xmpp_client_disconnect(), ast_xmpp_client::buddies, ast_xmpp_client_config::buddies, ast_xmpp_client_config::client, ast_flags::flags, ast_xmpp_client_config::flags, globals, ast_xmpp_client::jid, LOG_ERROR, ast_xmpp_client_config::mod_flags, ast_xmpp_client_config::name, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, ast_xmpp_client::parser, RAII_VAR, ast_xmpp_client::reconnect, ast_xmpp_client::stack, ast_xmpp_client::state, ast_xmpp_client_config::status, ast_xmpp_client_config::statusmsg, ast_xmpp_client::thread, ast_xmpp_client_config::user, xmpp_action_hook(), XMPP_AUTOACCEPT, XMPP_AUTOPRUNE, XMPP_AUTOREGISTER, xmpp_client_config_merge_buddies(), xmpp_client_set_presence(), xmpp_client_subscribe_user(), xmpp_client_thread(), XMPP_COMPONENT, xmpp_log_hook(), and XMPP_STATE_CONNECTED.
Referenced by xmpp_config_post_apply().
|
static |
Internal function which creates a buddy on a client.
Definition at line 2292 of file res_xmpp.c.
References ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_link, ao2_ref, ast_copy_string(), container, ast_xmpp_buddy::id, NULL, RESOURCE_BUCKETS, ast_xmpp_buddy::resources, ast_xmpp_buddy::subscribe, xmpp_buddy_destructor(), xmpp_resource_cmp(), and xmpp_resource_hash().
Referenced by client_buddy_handler(), xmpp_pak_s10n(), and xmpp_roster_hook().
|
static |
Destructor callback function for XMPP client.
Definition at line 680 of file res_xmpp.c.
References ao2_cleanup, ast_endpoint_shutdown(), AST_LIST_HEAD_DESTROY, AST_LIST_REMOVE_HEAD, ast_xmpp_client_disconnect(), ast_xmpp_client::buddies, ast_xmpp_client::endpoint, ast_xmpp_client::filter, ast_xmpp_message::list, ast_xmpp_message::message, ast_xmpp_client::messages, NULL, ast_xmpp_client::stack, and xmpp_message_destroy().
Referenced by xmpp_client_alloc().
|
static |
Look up existing client or create a new one.
Definition at line 792 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ao2_ref, globals, NULL, RAII_VAR, xmpp_client_alloc(), and xmpp_config_find().
Referenced by ast_xmpp_client_config_alloc().
|
static |
Internal function which receives data from the XMPP client connection.
Definition at line 3777 of file res_xmpp.c.
References ast_debug, ast_log, buf, c, IKS_NET_EXPIRED, ast_xmpp_client::jid, len(), LOG_WARNING, ast_xmpp_client::name, NET_IO_BUF_SIZE, ast_xmpp_client::parser, xmpp_io_recv(), xmpp_log_hook(), and xmpp_ping_request().
Referenced by xmpp_client_thread().
|
static |
Internal function used to reconnect an XMPP client to its server.
Definition at line 3693 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ast_debug, ast_log, ast_strlen_zero(), ast_test_flag, ast_xmpp_client_disconnect(), fetch_access_token(), ast_xmpp_client::filter, globals, ast_xmpp_client::jid, LOG_ERROR, ast_xmpp_client::name, NULL, ast_xmpp_client::parser, RAII_VAR, S_OR, ast_xmpp_client::timeout, xmpp_client_change_state(), XMPP_COMPONENT, xmpp_config_find(), XMPP_STATE_AUTHENTICATE, XMPP_STATE_REQUEST_TLS, and XMPP_USETLS.
Referenced by xmpp_client_thread().
|
static |
Internal function called when we need to request TLS support.
Definition at line 2669 of file res_xmpp.c.
References ast_log, LOG_ERROR, ast_xmpp_client::name, ast_xmpp_client::parser, xmpp_client_change_state(), xmpp_is_secure(), XMPP_STATE_AUTHENTICATE, and XMPP_STATE_REQUESTED_TLS.
|
static |
Internal function called when we receive a response to our TLS initiation request.
Definition at line 2713 of file res_xmpp.c.
References ast_debug, ast_free, ast_log, ast_xmpp_client::jid, LOG_ERROR, ast_xmpp_client::name, ast_xmpp_client::parser, xmpp_client_change_state(), xmpp_send_stream_header(), and XMPP_STATE_AUTHENTICATE.
|
static |
Helper function which sends a discovery information request to a user.
Definition at line 3321 of file res_xmpp.c.
References ast_xmpp_client_lock(), ast_xmpp_client_send(), ast_xmpp_client_unlock(), ast_xmpp_increment_mid(), and ast_xmpp_client::mid.
Referenced by xmpp_pak_presence().
|
static |
Internal function used to send a message to a user or chatroom.
Definition at line 1039 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ast_strlen_zero(), ast_test_flag, ast_xmpp_client_send(), globals, ast_xmpp_client::jid, ast_xmpp_client::name, NULL, RAII_VAR, XMPP_COMPONENT, xmpp_config_find(), and XMPP_MAX_JIDLEN.
Referenced by ast_xmpp_chatroom_send(), and ast_xmpp_client_send_message().
|
static |
Internal function which sends a raw message.
Definition at line 2618 of file res_xmpp.c.
References len(), ast_xmpp_client::parser, ast_xmpp_client::state, xmpp_is_secure(), xmpp_log_hook(), and XMPP_STATE_DISCONNECTED.
Referenced by ast_xmpp_client_send(), xmpp_component_authenticate(), and xmpp_send_stream_header().
|
static |
Hook function called when client receives a service discovery get message.
Definition at line 2472 of file res_xmpp.c.
References ast_log, ast_xmpp_client_send(), end, ast_xmpp_client::jid, LOG_ERROR, ast_xmpp_client::name, and NULL.
Referenced by xmpp_connect_hook().
|
static |
Hook function called when client receives a service discovery result message.
Definition at line 2532 of file res_xmpp.c.
References ao2_callback, ao2_find, ao2_lock, ao2_ref, ao2_unlock, ast_xmpp_client::buddies, OBJ_KEY, ast_xmpp_resource::resource, ast_xmpp_buddy::resources, and xmpp_resource_cmp().
Referenced by xmpp_component_authenticating(), and xmpp_connect_hook().
|
static |
Definition at line 1103 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ast_test_flag, ast_xmpp_client_send(), done, globals, ast_xmpp_client::jid, ast_xmpp_client::name, NULL, RAII_VAR, S_OR, XMPP_COMPONENT, xmpp_config_find(), and XMPP_MAX_JIDLEN.
Referenced by ast_xmpp_chatroom_join(), and ast_xmpp_chatroom_leave().
|
static |
Internal function which changes the presence status of an XMPP client.
Definition at line 2434 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ast_log, ast_strlen_zero(), ast_xmpp_client_send(), desc, done, globals, LOG_ERROR, ast_xmpp_client::name, NULL, priority, RAII_VAR, and xmpp_config_find().
Referenced by xmpp_client_config_post_apply(), xmpp_connect_hook(), xmpp_pak_presence(), and xmpp_pak_s10n().
|
static |
Callback function which subscribes to a user if needed.
Definition at line 2355 of file res_xmpp.c.
References ast_log, ast_xmpp_client_send(), ast_xmpp_buddy::id, LOG_WARNING, ast_xmpp_client::name, and ast_xmpp_buddy::subscribe.
Referenced by xmpp_client_config_post_apply(), and xmpp_roster_hook().
|
static |
XMPP client connection thread.
Definition at line 3857 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ast_debug, ast_log, ast_test_flag, ast_xmpp_client_disconnect(), globals, IKS_NET_EXPIRED, ast_xmpp_client::jid, LOG_ERROR, LOG_WARNING, ast_xmpp_client::name, NULL, RAII_VAR, sleep_with_backoff(), ast_xmpp_client::state, ast_xmpp_client::timeout, xmpp_client_receive(), xmpp_client_reconnect(), xmpp_config_find(), XMPP_KEEPALIVE, xmpp_ping_request(), XMPP_STATE_CONNECTED, and XMPP_STATE_DISCONNECTING.
Referenced by xmpp_client_config_post_apply().
|
static |
Helper function which unsubscribes a user and removes them from the roster.
Definition at line 2318 of file res_xmpp.c.
References ast_log, ast_xmpp_client_send(), done, item, ast_xmpp_client::jid, LOG_WARNING, ast_xmpp_client::name, and NULL.
Referenced by xmpp_roster_hook().
|
static |
Internal function called when we should authenticate as a component.
Definition at line 2953 of file res_xmpp.c.
References ast_log, ast_sha1_hash(), LOG_ERROR, ast_xmpp_client::name, ast_xmpp_client_config::password, xmpp_client_change_state(), xmpp_client_send_raw_message(), and XMPP_STATE_AUTHENTICATING.
|
static |
Internal function called when we authenticated as a component.
Definition at line 3219 of file res_xmpp.c.
References ast_log, ast_xmpp_client::filter, LOG_ERROR, ast_xmpp_client::name, xmpp_client_change_state(), xmpp_client_service_discovery_result_hook(), xmpp_component_register_get_hook(), xmpp_component_register_set_hook(), xmpp_component_service_discovery_get_hook(), xmpp_component_service_discovery_items_hook(), and XMPP_STATE_CONNECTED.
|
static |
Hook function called when the component is queried about registration.
Definition at line 3060 of file res_xmpp.c.
References ao2_cleanup, ao2_find, ao2_global_obj_ref, ao2_ref, ast_log, ast_xmpp_client_send(), ast_xmpp_client::buddies, done, error(), globals, LOG_ERROR, LOG_WARNING, ast_xmpp_client::name, NULL, OBJ_KEY, RAII_VAR, and xmpp_config_find().
Referenced by xmpp_component_authenticating().
|
static |
Hook function called when someone registers to the component.
Definition at line 3121 of file res_xmpp.c.
References ast_log, ast_xmpp_client_lock(), ast_xmpp_client_send(), ast_xmpp_client_unlock(), ast_xmpp_increment_mid(), done, ast_xmpp_client::jid, LOG_ERROR, LOG_WARNING, ast_xmpp_client::mid, ast_xmpp_client::name, and NULL.
Referenced by xmpp_component_authenticating().
|
static |
Hook function called when component receives a service discovery get message.
Definition at line 2973 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ast_debug, ast_log, ast_xmpp_client_send(), commands, done, globals, item, LOG_ERROR, LOG_WARNING, ast_xmpp_client::name, NULL, RAII_VAR, version, and xmpp_config_find().
Referenced by xmpp_component_authenticating().
|
static |
Hook function called when we receive a service discovery items request.
Definition at line 3168 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ast_log, ast_xmpp_client_send(), done, globals, item, LOG_ERROR, LOG_WARNING, ast_xmpp_client::name, NULL, RAII_VAR, and xmpp_config_find().
Referenced by xmpp_component_authenticating().
|
static |
Allocator for XMPP configuration.
Definition at line 853 of file res_xmpp.c.
References ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_list, ao2_ref, xmpp_config::clients, error(), xmpp_config::global, NULL, xmpp_config_cmp(), and xmpp_config_destructor().
|
static |
Comparator function for configuration.
Definition at line 845 of file res_xmpp.c.
References CMP_MATCH, CMP_STOP, ast_xmpp_client_config::flags, match(), ast_xmpp_client_config::name, and OBJ_KEY.
Referenced by xmpp_config_alloc().
|
static |
Destructor for XMPP configuration.
Definition at line 837 of file res_xmpp.c.
References ao2_cleanup, xmpp_config::clients, and xmpp_config::global.
Referenced by xmpp_config_alloc().
|
static |
Find function for configuration.
Definition at line 786 of file res_xmpp.c.
References ao2_find, and OBJ_KEY.
Referenced by acf_jabberreceive_read(), acf_jabberstatus_read(), ast_xmpp_client_find(), delete_old_messages(), manager_jabber_send(), xmpp_action_hook(), xmpp_cli_create_collection(), xmpp_cli_create_leafnode(), xmpp_cli_delete_pubsub_node(), xmpp_cli_list_pubsub_nodes(), xmpp_cli_purge_pubsub_nodes(), xmpp_client_find_or_create(), xmpp_client_reconnect(), xmpp_client_send_message(), xmpp_client_set_group_presence(), xmpp_client_set_presence(), xmpp_client_thread(), xmpp_component_register_get_hook(), xmpp_component_service_discovery_get_hook(), xmpp_component_service_discovery_items_hook(), xmpp_config_prelink(), xmpp_connect_hook(), xmpp_init_event_distribution(), xmpp_join_exec(), xmpp_leave_exec(), xmpp_log_hook(), xmpp_pubsub_iq_create(), xmpp_roster_hook(), xmpp_send_cb(), xmpp_send_exec(), and xmpp_sendgroup_exec().
|
static |
Definition at line 922 of file res_xmpp.c.
References ao2_callback, ao2_cleanup, ao2_global_obj_ref, globals, NULL, OBJ_MULTIPLE, OBJ_NODATA, RAII_VAR, and xmpp_client_config_post_apply().
|
static |
Definition at line 877 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ast_log, ast_strlen_zero(), ast_test_flag, ast_xmpp_client_config::client, ast_xmpp_client_config::flags, globals, LOG_ERROR, ast_xmpp_client_config::name, NULL, ast_xmpp_client_config::oauth_clientid, ast_xmpp_client_config::oauth_secret, ast_xmpp_client_config::password, ast_xmpp_client_config::port, ast_xmpp_client_config::priority, RAII_VAR, ast_xmpp_client::reconnect, ast_xmpp_client_config::refresh_token, ast_xmpp_client_config::server, ast_xmpp_client_config::user, XMPP_COMPONENT, and xmpp_config_find().
|
static |
Hook function called when client finishes authenticating with the server.
Definition at line 2562 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ast_log, ast_test_flag, ast_xmpp_client_send(), ast_xmpp_client::filter, globals, ast_xmpp_client::jid, LOG_ERROR, ast_xmpp_client::name, NULL, RAII_VAR, ast_xmpp_client::stack, xmpp_client_change_state(), xmpp_client_service_discovery_get_hook(), xmpp_client_service_discovery_result_hook(), xmpp_client_set_presence(), xmpp_config_find(), xmpp_connect_hook(), XMPP_DISTRIBUTE_EVENTS, xmpp_init_event_distribution(), xmpp_roster_hook(), and XMPP_STATE_ROSTER.
Referenced by xmpp_client_authenticate_digest(), xmpp_client_authenticating(), and xmpp_connect_hook().
|
static |
Definition at line 4429 of file res_xmpp.c.
References a, ast_cli_entry::args, ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, debug, NULL, and ast_cli_entry::usage.
|
static |
Initialize collections for event distribution.
client | the configured XMPP client we use to connect to a XMPP server |
Definition at line 1712 of file res_xmpp.c.
References ao2_callback, ao2_cleanup, ao2_global_obj_ref, ast_device_state_cache(), ast_device_state_message_type(), ast_device_state_topic_all(), ast_mwi_state_type(), ast_mwi_topic_all(), cached_devstate_cb(), ast_xmpp_client::device_state_sub, ast_xmpp_client::filter, globals, ast_xmpp_client::mwi_sub, ast_xmpp_client::name, NULL, OBJ_NODATA, RAII_VAR, stasis_cache_dump(), stasis_subscribe, stasis_subscribe_pool, stasis_subscription_accept_message_type(), STASIS_SUBSCRIPTION_FILTER_SELECTIVE, stasis_subscription_set_filter(), stasis_unsubscribe(), xmpp_config_find(), xmpp_pubsub_devstate_cb(), xmpp_pubsub_handle_error(), xmpp_pubsub_handle_event(), xmpp_pubsub_mwi_cb(), xmpp_pubsub_subscribe(), and xmpp_pubsub_unsubscribe().
Referenced by xmpp_connect_hook().
|
static |
Internal function which polls on an XMPP client and receives data.
Definition at line 3743 of file res_xmpp.c.
References ast_poll, len(), ast_xmpp_client::parser, and xmpp_is_secure().
Referenced by xmpp_client_receive().
|
static |
Helper function which returns whether an XMPP client connection is secure or not.
Definition at line 1001 of file res_xmpp.c.
Referenced by xmpp_client_authenticate_sasl(), xmpp_client_request_tls(), xmpp_client_send_raw_message(), and xmpp_io_recv().
|
static |
Application to join a chat room.
chan | ast_channel |
data | Data is sender|jid|nickname. |
0 | success |
-1 | error |
Definition at line 1847 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, app_ajijoin, args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), ast_test_flag, ast_xmpp_chatroom_join(), globals, LOG_ERROR, NULL, RAII_VAR, XMPP_COMPONENT, xmpp_config_find(), and XMPP_MAX_RESJIDLEN.
Referenced by load_module().
|
static |
Application to leave a chat room.
chan | ast_channel |
data | Data is sender|jid|nickname. |
0 | success |
-1 | error |
Definition at line 1906 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, app_ajileave, args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), ast_test_flag, ast_xmpp_chatroom_leave(), globals, LOG_ERROR, NULL, RAII_VAR, XMPP_COMPONENT, xmpp_config_find(), and XMPP_MAX_RESJIDLEN.
Referenced by load_module().
|
static |
Logging hook function.
Definition at line 2600 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ast_test_flag, ast_verbose, debug, globals, ast_xmpp_client::name, NULL, RAII_VAR, xmpp_config_find(), and XMPP_DEBUG.
Referenced by xmpp_client_config_post_apply(), xmpp_client_receive(), and xmpp_client_send_raw_message().
|
static |
Destroy function for XMPP messages.
Definition at line 667 of file res_xmpp.c.
References ast_free.
Referenced by acf_jabberreceive_read(), delete_old_messages(), and xmpp_client_destructor().
|
static |
Internal function called when a message is received.
Definition at line 3246 of file res_xmpp.c.
References ao2_cleanup, ao2_find, ast_calloc, ast_cond_broadcast, ast_copy_string(), ast_debug, AST_LIST_INSERT_HEAD, AST_LIST_LOCK, AST_LIST_UNLOCK, ast_msg_alloc(), ast_msg_destroy(), ast_msg_queue(), ast_msg_set_body(), ast_msg_set_context(), ast_msg_set_endpoint(), ast_msg_set_from(), ast_msg_set_tech(), ast_msg_set_to(), ast_msg_set_var(), ast_mutex_lock, ast_mutex_unlock, ast_strdup, ast_strlen_zero(), ast_test_flag, ast_tvnow(), ast_xmpp_client_lock(), ast_xmpp_client_unlock(), ast_xmpp_client::buddies, ast_xmpp_client_config::context, delete_old_messages(), ast_xmpp_client_config::flags, ast_xmpp_buddy::id, ast_xmpp_message::message, message_received_condition, messagelock, ast_xmpp_client::messages, ast_xmpp_client::name, NULL, OBJ_KEY, OBJ_NOLOCK, S_OR, ast_xmpp_client_config::user, and XMPP_SEND_TO_DIALPLAN.
|
static |
Internal function called when a presence message is received.
Definition at line 3392 of file res_xmpp.c.
References ao2_alloc, ao2_callback, ao2_find, ao2_link_flags, ao2_lock, ao2_ref, ao2_unlink_flags, ao2_unlock, ast_copy_string(), AST_DEVICE_NOT_INUSE, AST_DEVICE_UNAVAILABLE, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), ast_free, ast_log, ast_strdup, ast_strlen_zero(), ast_test_flag, ast_xmpp_client::buddies, EVENT_FLAG_USER, ast_xmpp_client_config::flags, ast_xmpp_buddy::id, ast_xmpp_client::jid, LOG_ERROR, LOG_WARNING, manager_event, ast_xmpp_client::name, NULL, OBJ_KEY, OBJ_NOLOCK, ast_xmpp_resource::resource, ast_xmpp_buddy::resources, S_OR, status, ast_xmpp_client_config::status, STATUS_DISAPPEAR, ast_xmpp_client_config::statusmsg, type, xmpp_client_send_disco_info_request(), xmpp_client_set_presence(), XMPP_COMPONENT, xmpp_resource_cmp(), xmpp_resource_destructor(), and xmpp_resource_is_available().
|
static |
Internal function called when a subscription message is received.
Definition at line 3521 of file res_xmpp.c.
References ao2_find, ao2_lock, ao2_ref, ao2_unlock, ast_log, ast_test_flag, ast_xmpp_client_send(), ast_xmpp_client::buddies, ast_xmpp_client_config::flags, ast_xmpp_client::jid, LOG_ERROR, LOG_WARNING, ast_xmpp_client::name, NULL, OBJ_KEY, OBJ_NOLOCK, status, ast_xmpp_client_config::status, ast_xmpp_client_config::statusmsg, XMPP_AUTOREGISTER, xmpp_client_create_buddy(), xmpp_client_set_presence(), and XMPP_COMPONENT.
|
static |
Helper function which sends a ping request to a server.
Definition at line 3358 of file res_xmpp.c.
References ast_debug, ast_xmpp_client_lock(), ast_xmpp_client_send(), ast_xmpp_client_unlock(), ast_xmpp_increment_mid(), ast_xmpp_client::mid, and ast_xmpp_client::name.
Referenced by xmpp_client_receive(), and xmpp_client_thread().
|
static |
Definition at line 1243 of file res_xmpp.c.
Referenced by xmpp_pubsub_create_node().
|
static |
Build the a node request.
client | the configured XMPP client we use to connect to a XMPP server |
collection | name of the collection for request |
Definition at line 4103 of file res_xmpp.c.
References ast_xmpp_client_config::client, NULL, request(), and xmpp_pubsub_iq_create().
Referenced by xmpp_pubsub_purge_nodes(), and xmpp_pubsub_request_nodes().
|
static |
Build the skeleton of a publish.
client | the configured XMPP client we use to connect to a XMPP server |
node | Name of the node that will be published to |
event_type,cachable |
Definition at line 1206 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, AST_DEVSTATE_NOT_CACHABLE, ast_test_flag, globals, item, NULL, options, publish, RAII_VAR, request(), xmpp_pubsub_iq_create(), and XMPP_XEP0248.
Referenced by xmpp_pubsub_publish_device_state(), and xmpp_pubsub_publish_mwi().
|
static |
Add Owner affiliations for pubsub node.
client | the configured XMPP client we use to connect to a XMPP server |
node | the name of the node to which to add affiliations |
Definition at line 1290 of file res_xmpp.c.
References ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_log, ast_xmpp_client_send(), ast_xmpp_client::buddies, ast_xmpp_buddy::id, LOG_ERROR, ast_xmpp_client::name, and xmpp_pubsub_iq_create().
Referenced by xmpp_pubsub_create_node().
|
static |
Create a PubSub collection node.
client | the configured XMPP client we use to connect to a XMPP server |
collection_name | The name to use for this collection |
Definition at line 1373 of file res_xmpp.c.
References NULL, and xmpp_pubsub_create_node().
Referenced by xmpp_cli_create_collection(), and xmpp_pubsub_handle_error().
|
static |
Create a PubSub leaf node.
client | the configured XMPP client we use to connect to a XMPP server |
collection_name | |
leaf_name | The name to use for this collection |
Definition at line 1385 of file res_xmpp.c.
References xmpp_pubsub_create_node().
Referenced by xmpp_cli_create_leafnode(), and xmpp_pubsub_handle_error().
|
static |
Create a pubsub node.
client | the configured XMPP client we use to connect to a XMPP server |
node_type | the type of node to create |
name | the name of the node to create |
collection_name |
Definition at line 1327 of file res_xmpp.c.
References ast_xmpp_client_send(), name, xmpp_pubsub_build_node_config(), xmpp_pubsub_create_affiliations(), and xmpp_pubsub_iq_create().
Referenced by xmpp_pubsub_create_collection(), xmpp_pubsub_create_leaf(), xmpp_pubsub_handle_error(), and xmpp_pubsub_publish_device_state().
|
static |
Delete a PubSub node.
client | the configured XMPP client we use to connect to a XMPP server |
node_name | the name of the node to delete |
Definition at line 1351 of file res_xmpp.c.
References ast_xmpp_client_send(), request(), and xmpp_pubsub_iq_create().
Referenced by xmpp_cli_delete_pubsub_node(), xmpp_cli_purge_pubsub_nodes(), and xmpp_pubsub_delete_node_list().
|
static |
Delete pubsub item lists.
data | pointer to ast_xmpp_client structure |
pak | response from pubsub diso::items query |
IKS_FILTER_EAT |
Definition at line 4225 of file res_xmpp.c.
References ast_log, item, ast_xmpp_client::jid, LOG_WARNING, NULL, and xmpp_pubsub_delete_node().
Referenced by xmpp_pubsub_purge_nodes().
|
static |
Callback function for device state events.
data | void pointer to ast_client structure |
sub,msg |
Definition at line 1491 of file res_xmpp.c.
References ast_device_state_message_type(), ast_devstate_str(), ast_eid_cmp(), ast_eid_default, ast_device_state_message::cachable, ast_device_state_message::device, ast_device_state_message::eid, stasis_message_data(), stasis_subscription_is_subscribed(), ast_device_state_message::state, sub, and xmpp_pubsub_publish_device_state().
Referenced by cached_devstate_cb(), and xmpp_init_event_distribution().
|
static |
Definition at line 1632 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ast_debug, ast_log, ast_test_flag, ast_xmpp_client_send(), error(), globals, LOG_ERROR, NULL, RAII_VAR, request(), xmpp_pubsub_create_collection(), xmpp_pubsub_create_leaf(), xmpp_pubsub_create_node(), xmpp_pubsub_iq_create(), and XMPP_XEP0248.
Referenced by xmpp_init_event_distribution().
|
static |
Callback for handling PubSub events.
data | void pointer to ast_xmpp_client structure |
pak | A pak |
IKS_FILTER_EAT |
Definition at line 1586 of file res_xmpp.c.
References ast_debug, AST_DEVSTATE_CACHABLE, AST_DEVSTATE_NOT_CACHABLE, ast_devstate_val(), ast_eid_cmp(), ast_eid_default, ast_log, ast_publish_device_state_full(), ast_publish_mwi_state_full(), ast_str_to_eid(), item, LOG_ERROR, NULL, and strsep().
Referenced by xmpp_init_event_distribution().
|
static |
Create an IQ packet.
client | the configured XMPP client we use to connect to a XMPP server |
type | the type of IQ packet to create |
Definition at line 1174 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ast_strlen_zero(), ast_xmpp_client_lock(), ast_xmpp_client_unlock(), ast_xmpp_increment_mid(), globals, ast_xmpp_client::jid, ast_xmpp_client::mid, ast_xmpp_client::name, NULL, RAII_VAR, request(), type, and xmpp_config_find().
Referenced by xmpp_pubsub_build_node_request(), xmpp_pubsub_build_publish_skeleton(), xmpp_pubsub_create_affiliations(), xmpp_pubsub_create_node(), xmpp_pubsub_delete_node(), xmpp_pubsub_handle_error(), xmpp_pubsub_subscribe(), and xmpp_pubsub_unsubscribe().
|
static |
Callback function for MWI events.
data | void pointer to ast_client structure |
sub,msg |
Definition at line 1464 of file res_xmpp.c.
References ast_eid_cmp(), ast_eid_default, ast_mwi_state_type(), ast_mwi_state::eid, ast_mwi_state::new_msgs, ast_mwi_state::old_msgs, stasis_message_data(), stasis_subscription_is_subscribed(), sub, ast_mwi_state::uniqueid, and xmpp_pubsub_publish_mwi().
Referenced by xmpp_init_event_distribution().
|
static |
Publish device state to a PubSub node.
client | the configured XMPP client we use to connect to a XMPP server |
device | the name of the device whose state to publish |
device_state | the state to publish |
cachable |
Definition at line 1429 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ast_eid_default, ast_eid_to_str(), ast_test_flag, ast_xmpp_client_send(), globals, NULL, RAII_VAR, request(), XMPP_PUBSUB_AUTOCREATE, xmpp_pubsub_build_publish_skeleton(), xmpp_pubsub_create_node(), and XMPP_XEP0248.
Referenced by xmpp_pubsub_devstate_cb().
|
static |
Publish MWI to a PubSub node.
client | the configured XMPP client we use to connect to a XMPP server |
mailbox | The mailbox identifier |
oldmsgs | Old messages |
newmsgs | New Messages |
Definition at line 1398 of file res_xmpp.c.
References AST_DEVSTATE_CACHABLE, ast_eid_default, ast_eid_to_str(), ast_xmpp_client_send(), request(), and xmpp_pubsub_build_publish_skeleton().
Referenced by xmpp_pubsub_mwi_cb().
|
static |
Definition at line 4246 of file res_xmpp.c.
References ast_xmpp_client_send(), ast_xmpp_client::filter, ast_xmpp_client::mid, request(), xmpp_pubsub_build_node_request(), and xmpp_pubsub_delete_node_list().
Referenced by xmpp_cli_purge_pubsub_nodes().
|
static |
Receive pubsub item lists.
data | pointer to ast_xmpp_client structure |
pak | response from pubsub diso::items query |
IKS_FILTER_EAT |
Definition at line 4127 of file res_xmpp.c.
References ast_verbose, item, ast_xmpp_client::jid, ast_xmpp_client::name, and NULL.
Referenced by xmpp_pubsub_request_nodes().
|
static |
Request item list from pubsub.
client | the configured XMPP client we use to connect to a XMPP server |
collection | name of the collection for request |
Definition at line 4154 of file res_xmpp.c.
References ast_log, ast_xmpp_client_send(), ast_xmpp_client::filter, LOG_ERROR, ast_xmpp_client::mid, ast_xmpp_client::name, request(), xmpp_pubsub_build_node_request(), and xmpp_pubsub_receive_node_list().
Referenced by xmpp_cli_list_pubsub_nodes().
|
static |
Subscribe to a PubSub node.
client | the configured XMPP client we use to connect to a XMPP server |
node | the name of the node to which to subscribe |
Definition at line 1539 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ast_log, ast_test_flag, ast_xmpp_client_send(), globals, ast_xmpp_client::jid, LOG_ERROR, ast_xmpp_client::name, options, RAII_VAR, request(), subscribe, xmpp_pubsub_iq_create(), and XMPP_XEP0248.
Referenced by xmpp_init_event_distribution().
|
static |
Unsubscribe from a PubSub node.
client | the configured XMPP client we use to connect to a XMPP server |
node | the name of the node to which to unsubscribe from |
Definition at line 1514 of file res_xmpp.c.
References ast_log, ast_xmpp_client_send(), ast_xmpp_client::jid, LOG_ERROR, ast_xmpp_client::name, request(), unsubscribe(), and xmpp_pubsub_iq_create().
Referenced by ast_xmpp_client_disconnect(), and xmpp_init_event_distribution().
|
static |
Comparator function for XMPP resource.
Definition at line 982 of file res_xmpp.c.
References CMP_MATCH, CMP_STOP, and ast_xmpp_resource::resource.
Referenced by get_buddy_status(), xmpp_client_create_buddy(), xmpp_client_service_discovery_result_hook(), and xmpp_pak_presence().
|
static |
Destructor callback function for XMPP resource.
Definition at line 964 of file res_xmpp.c.
References ast_free, and ast_xmpp_resource::resource.
Referenced by xmpp_pak_presence().
|
static |
Hashing function for XMPP resource.
Definition at line 974 of file res_xmpp.c.
References OBJ_KEY, ast_xmpp_resource::priority, and ast_xmpp_resource::resource.
Referenced by xmpp_client_create_buddy().
|
static |
Internal astobj2 callback function which returns the first resource, which is the highest priority one.
Definition at line 1751 of file res_xmpp.c.
References CMP_MATCH, and CMP_STOP.
Referenced by get_buddy_status().
|
static |
Callback function which returns when the resource is available.
Definition at line 3350 of file res_xmpp.c.
References CMP_MATCH, CMP_STOP, and ast_xmpp_resource::resource.
Referenced by xmpp_pak_presence().
|
static |
Hook function called when roster is received from server.
Definition at line 2376 of file res_xmpp.c.
References ao2_callback, ao2_cleanup, ao2_find, ao2_global_obj_ref, ao2_ref, ast_log, ast_test_flag, ast_xmpp_client::buddies, globals, item, LOG_ERROR, ast_xmpp_client::name, NULL, OBJ_KEY, OBJ_MULTIPLE, OBJ_NODATA, RAII_VAR, ast_xmpp_buddy::subscribe, XMPP_AUTOPRUNE, XMPP_AUTOREGISTER, xmpp_client_change_state(), xmpp_client_create_buddy(), xmpp_client_subscribe_user(), xmpp_client_unsubscribe_user(), xmpp_config_find(), and XMPP_STATE_CONNECTED.
Referenced by xmpp_connect_hook().
|
static |
Definition at line 2255 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, ast_debug, ast_log, ast_msg_get_body(), ast_strdupa, ast_strlen_zero(), ast_xmpp_client_send_message(), ast_xmpp_message::from, globals, LOG_ERROR, LOG_WARNING, NULL, RAII_VAR, strsep(), and xmpp_config_find().
|
static |
Definition at line 1967 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, app_ajisend, args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), ast_xmpp_client_send_message(), globals, LOG_WARNING, NULL, RAII_VAR, and xmpp_config_find().
Referenced by load_module().
|
static |
Helper function which sends an XMPP stream header to the server.
Definition at line 2651 of file res_xmpp.c.
References ast_test_flag, ast_xmpp_client_config::flags, xmpp_client_send_raw_message(), and XMPP_COMPONENT.
Referenced by xmpp_client_authenticating(), and xmpp_client_requested_tls().
|
static |
Application to send a message to a groupchat.
chan | ast_channel |
data | Data is sender|groupchat|message. |
0 | success |
-1 | error |
Definition at line 2008 of file res_xmpp.c.
References ao2_cleanup, ao2_global_obj_ref, app_ajisendgroup, args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log, AST_STANDARD_APP_ARGS, ast_strdupa, ast_strlen_zero(), ast_test_flag, ast_xmpp_chatroom_send(), globals, LOG_ERROR, NULL, RAII_VAR, XMPP_COMPONENT, xmpp_config_find(), and XMPP_MAX_RESJIDLEN.
Referenced by load_module().
|
static |
Definition at line 4539 of file res_xmpp.c.
References a, ao2_cleanup, ao2_global_obj_ref, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_cli(), ast_xmpp_client::buddies, CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_xmpp_client_config::client, ast_cli_entry::command, globals, ast_xmpp_buddy::id, ast_xmpp_client_config::name, NULL, RAII_VAR, ast_xmpp_resource::resource, ast_xmpp_buddy::resources, and ast_cli_entry::usage.
|
static |
Definition at line 4463 of file res_xmpp.c.
References a, ao2_cleanup, ao2_container_count(), ao2_global_obj_ref, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_cli(), CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_xmpp_client_config::client, ast_cli_entry::command, globals, ast_xmpp_client_config::name, NULL, RAII_VAR, ast_xmpp_client::state, ast_cli_entry::usage, ast_xmpp_client_config::user, XMPP_STATE_AUTHENTICATE, XMPP_STATE_AUTHENTICATING, XMPP_STATE_CONNECTED, XMPP_STATE_CONNECTING, XMPP_STATE_DISCONNECTED, XMPP_STATE_DISCONNECTING, XMPP_STATE_REQUEST_TLS, XMPP_STATE_REQUESTED_TLS, and XMPP_STATE_ROSTER.
|
static |
Definition at line 4832 of file res_xmpp.c.
|
static |
Definition at line 648 of file res_xmpp.c.
Referenced by load_module(), unload_module(), and xmpp_join_exec().
|
static |
Definition at line 649 of file res_xmpp.c.
Referenced by load_module(), unload_module(), and xmpp_leave_exec().
|
static |
Definition at line 645 of file res_xmpp.c.
Referenced by load_module(), unload_module(), and xmpp_send_exec().
|
static |
Definition at line 646 of file res_xmpp.c.
Referenced by load_module(), unload_module(), and xmpp_sendgroup_exec().
|
static |
Definition at line 647 of file res_xmpp.c.
Referenced by unload_module().
|
static |
Definition at line 4832 of file res_xmpp.c.
|
static |
Definition at line 939 of file res_xmpp.c.
struct aco_type* client_options[] = ACO_TYPES(&client_option) |
Definition at line 950 of file res_xmpp.c.
Referenced by load_module().
|
static |
Global debug status.
Definition at line 570 of file res_xmpp.c.
Referenced by ari_set_debug(), ast_cc_agent_accept_request(), ast_cc_agent_caller_available(), ast_cc_agent_caller_busy(), ast_cc_agent_recalling(), ast_cc_completed(), ast_cc_failed(), ast_cc_monitor_callee_available(), ast_cc_monitor_failed(), ast_cc_monitor_request_acked(), ast_sip_initialize_sorcery_global(), cc_offer(), cc_ref(), cc_request_state_change(), cc_unref(), check_debug(), check_events(), global_bitfield_handler(), load_module(), stasis_app_set_debug(), stasis_app_set_debug_by_name(), stasis_app_set_global_debug(), xmpp_do_set_debug(), and xmpp_log_hook().
|
static |
Definition at line 929 of file res_xmpp.c.
struct aco_type* global_options[] = ACO_TYPES(&global_option) |
Definition at line 937 of file res_xmpp.c.
Referenced by load_module().
|
static |
Definition at line 2208 of file res_xmpp.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1835 of file res_xmpp.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 651 of file res_xmpp.c.
Referenced by acf_jabberreceive_read(), load_module(), unload_module(), and xmpp_pak_message().
|
static |
Definition at line 652 of file res_xmpp.c.
Referenced by acf_jabberreceive_read(), load_module(), unload_module(), and xmpp_pak_message().
|
static |
Definition at line 2286 of file res_xmpp.c.
Referenced by load_module(), and unload_module().
struct aco_file res_xmpp_conf |
Definition at line 952 of file res_xmpp.c.
|
static |
Definition at line 4599 of file res_xmpp.c.
Referenced by load_module(), and unload_module().
|
static |
Referenced by xmpp_action_hook().
|
static |
Referenced by xmpp_action_hook().