xjab_jcon.h File Reference

#include "../../str.h"
#include "xjab_jconf.h"
#include "xjab_base.h"
#include "tree234.h"
#include "xjab_presence.h"

Include dependency graph for xjab_jcon.h:

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

Go to the source code of this file.

Data Structures

struct  _xj_jcon

Defines

#define XJ_AIM_LEN   4
#define XJ_AIM_NAME   "aim."
#define XJ_ICQ_LEN   3
#define XJ_ICQ_NAME   "icq"
#define XJ_JCMD_SUBSCRIBE   1
#define XJ_JCMD_UNSUBSCRIBE   2
#define XJ_JMSG_CHAT   2
#define XJ_JMSG_GROUPCHAT   4
#define XJ_JMSG_NORMAL   1
#define XJ_MSN_LEN   4
#define XJ_MSN_NAME   "msn."
#define XJ_NET_AIM   2
#define XJ_NET_ALL   0xFFFFFFFF
#define XJ_NET_ICQ   4
#define XJ_NET_JAB   1
#define XJ_NET_MSN   8
#define XJ_NET_NUL   0
#define XJ_NET_YAH   16
#define XJ_YAH_LEN   6
#define XJ_YAH_NAME   "yahoo."

Typedefs

typedef struct _xj_jcon t_xj_jcon
typedef struct _xj_jconxj_jcon

Functions

xj_jconf xj_jcon_check_jconf (xj_jcon, char *)
int xj_jcon_connect (xj_jcon)
int xj_jcon_del_jconf (xj_jcon, str *, char, int)
int xj_jcon_disconnect (xj_jcon)
int xj_jcon_free (xj_jcon)
xj_jconf xj_jcon_get_jconf (xj_jcon, str *, char)
int xj_jcon_get_juid (xj_jcon)
int xj_jcon_get_roster (xj_jcon)
xj_jcon xj_jcon_init (char *, int)
int xj_jcon_is_ready (xj_jcon, char *, int, char)
int xj_jcon_jconf_presence (xj_jcon, xj_jconf, char *, char *)
int xj_jcon_send_msg (xj_jcon, char *, int, char *, int, int)
int xj_jcon_send_presence (xj_jcon, char *, char *, char *, char *)
int xj_jcon_send_sig_msg (xj_jcon, char *, int, char *, int, char *, int)
int xj_jcon_send_subscribe (xj_jcon, char *, char *, char *)
int xj_jcon_set_attrs (xj_jcon, xj_jkey, int, int)
void xj_jcon_set_juid (xj_jcon, int)
int xj_jcon_set_roster (xj_jcon, char *, char *)
int xj_jcon_update (xj_jcon, int)
int xj_jcon_user_auth (xj_jcon, char *, char *, char *)


Define Documentation

#define XJ_AIM_LEN   4

Definition at line 44 of file xjab_jcon.h.

Referenced by xj_jcon_is_ready(), and xj_manage_jab().

#define XJ_AIM_NAME   "aim."

Definition at line 43 of file xjab_jcon.h.

Referenced by xj_jcon_is_ready(), and xj_manage_jab().

#define XJ_ICQ_LEN   3

Definition at line 46 of file xjab_jcon.h.

Referenced by xj_jcon_is_ready(), and xj_manage_jab().

#define XJ_ICQ_NAME   "icq"

Definition at line 45 of file xjab_jcon.h.

Referenced by xj_jcon_is_ready(), and xj_manage_jab().

#define XJ_JCMD_SUBSCRIBE   1

Definition at line 56 of file xjab_jcon.h.

#define XJ_JCMD_UNSUBSCRIBE   2

Definition at line 57 of file xjab_jcon.h.

Referenced by xj_jcon_del_jconf(), and xj_worker_process().

#define XJ_JMSG_CHAT   2

Definition at line 53 of file xjab_jcon.h.

Referenced by xj_jcon_send_msg(), xj_worker_check_qmsg(), and xj_worker_process().

#define XJ_JMSG_GROUPCHAT   4

Definition at line 54 of file xjab_jcon.h.

Referenced by xj_jcon_send_msg(), xj_worker_check_qmsg(), and xj_worker_process().

#define XJ_JMSG_NORMAL   1

Definition at line 52 of file xjab_jcon.h.

#define XJ_MSN_LEN   4

Definition at line 48 of file xjab_jcon.h.

Referenced by xj_jcon_is_ready(), and xj_manage_jab().

#define XJ_MSN_NAME   "msn."

Definition at line 47 of file xjab_jcon.h.

Referenced by xj_jcon_is_ready(), and xj_manage_jab().

#define XJ_NET_AIM   2

Definition at line 38 of file xjab_jcon.h.

Referenced by xj_jcon_is_ready(), and xj_manage_jab().

#define XJ_NET_ALL   0xFFFFFFFF

Definition at line 36 of file xjab_jcon.h.

Referenced by xj_jcon_user_auth().

#define XJ_NET_ICQ   4

Definition at line 39 of file xjab_jcon.h.

Referenced by xj_jcon_is_ready(), and xj_manage_jab().

#define XJ_NET_JAB   1

Definition at line 37 of file xjab_jcon.h.

Referenced by xj_jcon_user_auth().

#define XJ_NET_MSN   8

Definition at line 40 of file xjab_jcon.h.

Referenced by xj_jcon_is_ready(), and xj_manage_jab().

#define XJ_NET_NUL   0

Definition at line 35 of file xjab_jcon.h.

Referenced by xj_jcon_init().

#define XJ_NET_YAH   16

Definition at line 41 of file xjab_jcon.h.

Referenced by xj_jcon_is_ready(), and xj_manage_jab().

#define XJ_YAH_LEN   6

Definition at line 50 of file xjab_jcon.h.

Referenced by xj_jcon_is_ready(), and xj_manage_jab().

#define XJ_YAH_NAME   "yahoo."

Definition at line 49 of file xjab_jcon.h.

Referenced by xj_jcon_is_ready(), and xj_manage_jab().


Typedef Documentation

typedef struct _xj_jcon t_xj_jcon

typedef struct _xj_jcon * xj_jcon


Function Documentation

xj_jconf xj_jcon_check_jconf ( xj_jcon  ,
char *   
)

int xj_jcon_connect ( xj_jcon  jbc  ) 

connect to JABBER server

Definition at line 97 of file xjab_jcon.c.

References _xj_jcon::hostname, LM_DBG, NULL, _xj_jcon::port, _xj_jcon::sock, and sock.

Referenced by xj_worker_process().

int xj_jcon_del_jconf ( xj_jcon  ,
str ,
char  ,
int   
)

int xj_jcon_disconnect ( xj_jcon  jbc  ) 

disconnect from JABBER server

Definition at line 158 of file xjab_jcon.c.

References LM_DBG, NULL, _xj_jcon::sock, and xj_jcon_send_presence().

Referenced by xj_worker_check_jcons(), and xj_worker_process().

int xj_jcon_free ( xj_jcon  jbc  ) 

xj_jconf xj_jcon_get_jconf ( xj_jcon  ,
str ,
char   
)

int xj_jcon_get_juid ( xj_jcon  jbc  ) 

return the Jabber internal ID

Definition at line 148 of file xjab_jcon.c.

References _xj_jcon::juid, and NULL.

int xj_jcon_get_roster ( xj_jcon  jbc  ) 

receive the list of the roster

Definition at line 346 of file xjab_jcon.c.

References JB_IQ_ROSTER_GET, and _xj_jcon::sock.

Referenced by xj_worker_process().

xj_jcon xj_jcon_init ( char *  hostname,
int  port 
)

int xj_jcon_is_ready ( xj_jcon  ,
char *  ,
int  ,
char   
)

int xj_jcon_jconf_presence ( xj_jcon  ,
xj_jconf  ,
char *  ,
char *   
)

int xj_jcon_send_msg ( xj_jcon  jbc,
char *  to,
int  tol,
char *  msg,
int  msgl,
int  type 
)

send a message through a JABBER connection params are pairs (buffer, len)

Definition at line 403 of file xjab_jcon.c.

References LM_DBG, NULL, _xj_jcon::sock, XJ_JMSG_CHAT, XJ_JMSG_GROUPCHAT, xode_free(), xode_insert_cdata(), xode_new_tag(), xode_put_attrib(), xode_to_str(), and xode_wrap().

Referenced by xj_worker_check_qmsg(), and xj_worker_process().

int xj_jcon_send_presence ( xj_jcon  jbc,
char *  sto,
char *  type,
char *  status,
char *  priority 
)

send presence type - "unavailable", "subscribe", "subscribed" .... status - "online", "away", "unavailable" ... priority - "0", "1", ...

Definition at line 470 of file xjab_jcon.c.

References LM_DBG, NULL, _xj_jcon::sock, xode_free(), xode_insert_cdata(), xode_insert_tag(), xode_new_tag(), xode_put_attrib(), and xode_to_str().

Referenced by xj_jcon_disconnect(), xj_jcon_jconf_presence(), xj_manage_jab(), and xj_worker_process().

int xj_jcon_send_sig_msg ( xj_jcon  ,
char *  ,
int  ,
char *  ,
int  ,
char *  ,
int   
)

int xj_jcon_send_subscribe ( xj_jcon  jbc,
char *  to,
char *  from,
char *  type 
)

send subscribe for user's presence

Definition at line 522 of file xjab_jcon.c.

References LM_DBG, NULL, _xj_jcon::sock, xode_free(), xode_new_tag(), xode_put_attrib(), and xode_to_str().

Referenced by xj_worker_check_watcher().

int xj_jcon_set_attrs ( xj_jcon  jbc,
xj_jkey  jkey,
int  cache_time,
int  delay_time 
)

create a open connection to Jabber

  • id : id of the connection
  • jbc : pointer to Jabber connection
  • cache_time : life time of the connection
  • delay_time : time needed to became an active connection return : pointer to the structure or NULL on error

Definition at line 605 of file xjab_jcon.c.

References _xj_jcon::expire, get_ticks(), _xj_jkey::id, _xj_jcon::jkey, NULL, _xj_jcon::ready, and _str::s.

Referenced by xj_worker_process().

void xj_jcon_set_juid ( xj_jcon  jbc,
int  _juid 
)

set the Jabber internal ID

Definition at line 138 of file xjab_jcon.c.

References _xj_jcon::juid, and NULL.

int xj_jcon_set_roster ( xj_jcon  jbc,
char *  jid,
char *  type 
)

add a new contact in user's roster

Definition at line 357 of file xjab_jcon.c.

References LM_DBG, NULL, _xj_jcon::seq_nr, _xj_jcon::sock, xode_free(), xode_new_tag(), xode_put_attrib(), xode_to_str(), and xode_wrap().

int xj_jcon_update ( xj_jcon  jbc,
int  cache_time 
)

update the life time of the connection

  • ojc : pointer to the open connection
  • cache_time : number of seconds to keep the connection open return : 0 on success or <0 on error

Definition at line 624 of file xjab_jcon.c.

References _xj_jcon::expire, get_ticks(), _xj_jkey::id, _xj_jcon::jkey, _str::len, LM_DBG, NULL, and _str::s.

Referenced by xj_worker_process().

int xj_jcon_user_auth ( xj_jcon  jbc,
char *  username,
char *  passwd,
char *  resource 
)


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