xmpp_api.h File Reference

The XMPP api. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  xmpp_api_
struct  xmpp_callback_
struct  xmpp_cb_list_

Defines

#define xmpp_isset_cb_type(_types_)   ((_xmpp_cb_list->types)|(_types_) )
#define XMPP_RCV_IQ   (1<<2)
#define XMPP_RCV_MESSAGE   (1<<0)
#define XMPP_RCV_PRESENCE   (1<<1)

Typedefs

typedef int(* bind_xmpp_t )(xmpp_api_t *api)
typedef int(* register_xmpp_cb_t )(int types, xmpp_cb_f f, void *param)
typedef struct xmpp_api_ xmpp_api_t
typedef struct xmpp_callback_ xmpp_callback_t
typedef void( xmpp_cb_f )(char *msg, int type, void *param)
typedef struct xmpp_cb_list_ xmpp_cb_list_t
typedef int(* xmpp_send_xmessage_f )(str *from, str *to, str *msg, str *id)
typedef int(* xmpp_send_xnotify_f )(str *from, str *to, str *msg, str *id)
typedef int(* xmpp_send_xpacket_f )(str *from, str *to, str *msg, str *id)
typedef int(* xmpp_send_xsubscribe_f )(str *from, str *to, str *msg, str *id)
typedef char *(* xmpp_translate_uri_f )(char *uri)

Functions

int bind_xmpp (xmpp_api_t *api)
char * decode_uri_sip_xmpp (char *uri)
 decode sip:user*domain1@domain2 -> user@domain1
char * decode_uri_xmpp_sip (char *jid)
 decode user*domain1@domain2 -> sip:user@domain1
void destroy_xmpp_cb_list (void)
char * encode_uri_sip_xmpp (char *uri)
 encode sip:user@domain -> user*domain@xmpp_domain
char * encode_uri_xmpp_sip (char *jid)
 encode user@domain -> sip:user*domain@gateway_domain
int init_xmpp_cb_list (void)
int register_xmpp_cb (int types, xmpp_cb_f f, void *param)
 register a callback function 'f' for 'types' mask of events;
static void run_xmpp_callbacks (int type, char *msg)
 run all transaction callbacks for an event type
int xmpp_send_xmessage (str *from, str *to, str *msg, str *id)
int xmpp_send_xnotify (str *from, str *to, str *msg, str *id)
int xmpp_send_xpacket (str *from, str *to, str *msg, str *id)
int xmpp_send_xsubscribe (str *from, str *to, str *msg, str *id)

Variables

xmpp_cb_list_t_xmpp_cb_list


Detailed Description

The XMPP api.

Definition in file xmpp_api.h.


Define Documentation

#define xmpp_isset_cb_type ( _types_   )     ((_xmpp_cb_list->types)|(_types_) )

Definition at line 61 of file xmpp_api.h.

#define XMPP_RCV_IQ   (1<<2)

Definition at line 37 of file xmpp_api.h.

Referenced by stream_node_callback().

#define XMPP_RCV_MESSAGE   (1<<0)

Definition at line 35 of file xmpp_api.h.

#define XMPP_RCV_PRESENCE   (1<<1)

Definition at line 36 of file xmpp_api.h.

Referenced by mod_init(), and stream_node_callback().


Typedef Documentation

typedef int(* bind_xmpp_t)(xmpp_api_t *api)

Definition at line 117 of file xmpp_api.h.

typedef int(* register_xmpp_cb_t)(int types, xmpp_cb_f f, void *param)

Definition at line 40 of file xmpp_api.h.

typedef struct xmpp_api_ xmpp_api_t

typedef void( xmpp_cb_f)(char *msg, int type, void *param)

Definition at line 39 of file xmpp_api.h.

typedef struct xmpp_cb_list_ xmpp_cb_list_t

typedef int(* xmpp_send_xmessage_f)(str *from, str *to, str *msg, str *id)

Definition at line 89 of file xmpp_api.h.

typedef int(* xmpp_send_xnotify_f)(str *from, str *to, str *msg, str *id)

Definition at line 95 of file xmpp_api.h.

typedef int(* xmpp_send_xpacket_f)(str *from, str *to, str *msg, str *id)

Definition at line 86 of file xmpp_api.h.

typedef int(* xmpp_send_xsubscribe_f)(str *from, str *to, str *msg, str *id)

Definition at line 92 of file xmpp_api.h.

typedef char*(* xmpp_translate_uri_f)(char *uri)

Definition at line 98 of file xmpp_api.h.


Function Documentation

int bind_xmpp ( xmpp_api_t api  ) 

char* decode_uri_sip_xmpp ( char *  uri  ) 

decode sip:user*domain1@domain2 -> user@domain1

Note:
In many kinds of gateway scenarios, the % sign is a common character used See the MSN XMPP transports for an example.

Definition at line 42 of file util.c.

References buf, domain_separator, _str::len, LM_ERR, NULL, parse_uri(), _str::s, and sip_uri::user.

Referenced by bind_xmpp(), do_send_message_component(), and do_send_message_server().

char* decode_uri_xmpp_sip ( char *  jid  ) 

decode user*domain1@domain2 -> sip:user@domain1

Definition at line 85 of file util.c.

References buf, domain_separator, NULL, and snprintf.

Referenced by bind_xmpp(), in_stream_node_callback(), and stream_node_callback().

void destroy_xmpp_cb_list ( void   ) 

Definition at line 56 of file xmpp_api.c.

References xmpp_cb_list_::first, xmpp_callback_::next, and shm_free.

char* encode_uri_sip_xmpp ( char *  uri  ) 

encode sip:user@domain -> user*domain@xmpp_domain

Definition at line 65 of file util.c.

References buf, domain_separator, sip_uri::host, _str::len, LM_ERR, NULL, parse_uri(), _str::s, snprintf, sip_uri::user, and xmpp_domain.

Referenced by bind_xmpp(), do_send_message_component(), and do_send_message_server().

char* encode_uri_xmpp_sip ( char *  jid  ) 

encode user@domain -> sip:user*domain@gateway_domain

Definition at line 108 of file util.c.

References buf, domain_separator, gateway_domain, NULL, and snprintf.

Referenced by bind_xmpp(), in_stream_node_callback(), and stream_node_callback().

int init_xmpp_cb_list ( void   ) 

Definition at line 44 of file xmpp_api.c.

References LM_CRIT, and shm_malloc().

Referenced by mod_init().

int register_xmpp_cb ( int  types,
xmpp_cb_f  f,
void *  param 
)

register a callback function 'f' for 'types' mask of events;

Definition at line 77 of file xmpp_api.c.

References xmpp_callback_::cbf, xmpp_callback_::cbp, E_BUG, E_OUT_OF_MEM, xmpp_cb_list_::first, LM_CRIT, LM_ERR, xmpp_callback_::next, shm_malloc(), xmpp_callback_::types, and xmpp_cb_list_::types.

Referenced by bind_xmpp().

static void run_xmpp_callbacks ( int  type,
char *  msg 
) [inline, static]

run all transaction callbacks for an event type

Definition at line 73 of file xmpp_api.h.

References xmpp_callback_::cbf, xmpp_callback_::cbp, xmpp_cb_list_::first, LM_DBG, xmpp_callback_::next, and xmpp_callback_::types.

Referenced by stream_node_callback().

int xmpp_send_xmessage ( str from,
str to,
str msg,
str id 
)

Definition at line 419 of file xmpp.c.

References NULL, XMPP_PIPE_SEND_MESSAGE, and xmpp_send_pipe_cmd().

Referenced by bind_xmpp().

int xmpp_send_xnotify ( str from,
str to,
str msg,
str id 
)

Definition at line 439 of file xmpp.c.

References NULL, XMPP_PIPE_SEND_PNOTIFY, and xmpp_send_pipe_cmd().

Referenced by bind_xmpp().

int xmpp_send_xpacket ( str from,
str to,
str msg,
str id 
)

Definition at line 409 of file xmpp.c.

References NULL, XMPP_PIPE_SEND_PACKET, and xmpp_send_pipe_cmd().

Referenced by bind_xmpp().

int xmpp_send_xsubscribe ( str from,
str to,
str msg,
str id 
)

Definition at line 429 of file xmpp.c.

References NULL, XMPP_PIPE_SEND_PSUBSCRIBE, and xmpp_send_pipe_cmd().

Referenced by bind_xmpp().


Variable Documentation

Definition at line 41 of file xmpp_api.c.


Generated on Fri May 25 00:00:45 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6