#include <stdio.h>#include <string.h>#include <stdlib.h>#include <unistd.h>#include <sys/types.h>#include "../../mem/shm_mem.h"#include "../../mem/mem.h"#include "../../sr_module.h"#include "../../dprint.h"#include "../../parser/parse_uri.h"#include "imc.h"#include "imc_cmd.h"

Go to the source code of this file.
Defines | |
| #define | IMC_BUF_SIZE 1024 |
Functions | |
| int | imc_handle_accept (struct sip_msg *msg, imc_cmd_t *cmd, struct sip_uri *src, struct sip_uri *dst) |
| int | imc_handle_create (struct sip_msg *msg, imc_cmd_t *cmd, struct sip_uri *src, struct sip_uri *dst) |
| int | imc_handle_deny (struct sip_msg *msg, imc_cmd_t *cmd, struct sip_uri *src, struct sip_uri *dst) |
| int | imc_handle_destroy (struct sip_msg *msg, imc_cmd_t *cmd, struct sip_uri *src, struct sip_uri *dst) |
| int | imc_handle_exit (struct sip_msg *msg, imc_cmd_t *cmd, struct sip_uri *src, struct sip_uri *dst) |
| int | imc_handle_help (struct sip_msg *msg, imc_cmd_t *cmd, str *src, str *dst) |
| int | imc_handle_invite (struct sip_msg *msg, imc_cmd_t *cmd, struct sip_uri *src, struct sip_uri *dst) |
| int | imc_handle_join (struct sip_msg *msg, imc_cmd_t *cmd, struct sip_uri *src, struct sip_uri *dst) |
| int | imc_handle_list (struct sip_msg *msg, imc_cmd_t *cmd, struct sip_uri *src, struct sip_uri *dst) |
| int | imc_handle_message (struct sip_msg *msg, str *msgbody, struct sip_uri *src, struct sip_uri *dst) |
| int | imc_handle_remove (struct sip_msg *msg, imc_cmd_t *cmd, struct sip_uri *src, struct sip_uri *dst) |
| int | imc_handle_unknown (struct sip_msg *msg, imc_cmd_t *cmd, str *src, str *dst) |
| void | imc_inv_callback (struct cell *t, int type, struct tmcb_params *ps) |
| int | imc_parse_cmd (char *buf, int len, imc_cmd_p cmd) |
| int | imc_room_broadcast (imc_room_p room, str *ctype, str *body) |
| int | imc_send_message (str *src, str *dst, str *headers, str *body) |
Variables | |
| static char | imc_body_buf [IMC_BUF_SIZE] |
| static str | imc_hdr_ctype = { "Content-Type: text/plain\r\n", 26} |
| static str | imc_msg_type = { "MESSAGE", 7 } |
| #define IMC_BUF_SIZE 1024 |
Definition at line 40 of file imc_cmd.c.
Referenced by imc_handle_accept(), imc_handle_create(), imc_handle_deny(), imc_handle_exit(), imc_handle_invite(), imc_handle_join(), imc_handle_message(), imc_handle_remove(), and imc_handle_unknown().
| int imc_handle_accept | ( | struct sip_msg * | msg, | |
| imc_cmd_t * | cmd, | |||
| struct sip_uri * | src, | |||
| struct sip_uri * | dst | |||
| ) |
Definition at line 528 of file imc_cmd.c.
References _imc_member::flags, _imc_room::flags, sip_uri::host, imc_body_buf, IMC_BUF_SIZE, imc_get_member(), imc_get_room(), IMC_MEMBER_INVITED, imc_release_room(), imc_room_broadcast(), IMC_ROOM_DELETED, _str::len, LM_ERR, NULL, _imc_cmd::param, _str::s, snprintf, _imc_member::uri, and sip_uri::user.
Referenced by imc_manager().
| int imc_handle_create | ( | struct sip_msg * | msg, | |
| imc_cmd_t * | cmd, | |||
| struct sip_uri * | src, | |||
| struct sip_uri * | dst | |||
| ) |
Definition at line 160 of file imc_cmd.c.
References _imc_room::flags, sip_uri::host, imc_add_member(), imc_add_room(), imc_body_buf, IMC_BUF_SIZE, imc_get_member(), imc_get_room(), IMC_MEMBER_OWNER, imc_release_room(), imc_room_broadcast(), IMC_ROOM_PRIV, IMC_ROOM_PRIVATE, IMC_ROOM_PRIVATE_LEN, imc_send_message(), _str::len, LM_DBG, LM_ERR, NULL, _imc_cmd::param, _str::s, snprintf, _imc_member::uri, _imc_room::uri, and sip_uri::user.
Referenced by imc_manager().
| int imc_handle_deny | ( | struct sip_msg * | msg, | |
| imc_cmd_t * | cmd, | |||
| struct sip_uri * | src, | |||
| struct sip_uri * | dst | |||
| ) |
Definition at line 724 of file imc_cmd.c.
References _imc_member::flags, _imc_room::flags, sip_uri::host, imc_body_buf, IMC_BUF_SIZE, imc_del_member(), imc_get_member(), imc_get_room(), IMC_MEMBER_INVITED, imc_release_room(), IMC_ROOM_DELETED, imc_send_message(), _str::len, LM_ERR, NULL, _imc_cmd::param, _str::s, snprintf, _imc_room::uri, and sip_uri::user.
Referenced by imc_manager().
| int imc_handle_destroy | ( | struct sip_msg * | msg, | |
| imc_cmd_t * | cmd, | |||
| struct sip_uri * | src, | |||
| struct sip_uri * | dst | |||
| ) |
Definition at line 920 of file imc_cmd.c.
References _imc_member::flags, _imc_room::flags, sip_uri::host, imc_body_buf, imc_del_room(), imc_get_member(), imc_get_room(), IMC_MEMBER_OWNER, imc_release_room(), imc_room_broadcast(), IMC_ROOM_DELETED, _str::len, LM_DBG, LM_ERR, NULL, _imc_cmd::param, _str::s, and sip_uri::user.
Referenced by imc_manager().
| int imc_handle_exit | ( | struct sip_msg * | msg, | |
| imc_cmd_t * | cmd, | |||
| struct sip_uri * | src, | |||
| struct sip_uri * | dst | |||
| ) |
Definition at line 848 of file imc_cmd.c.
References _imc_member::flags, _imc_room::flags, sip_uri::host, imc_body_buf, IMC_BUF_SIZE, imc_del_member(), imc_del_room(), imc_get_member(), imc_get_room(), IMC_MEMBER_DELETED, IMC_MEMBER_OWNER, imc_release_room(), imc_room_broadcast(), IMC_ROOM_DELETED, _str::len, LM_ERR, NULL, _imc_cmd::param, _str::s, snprintf, and sip_uri::user.
Referenced by imc_manager().
Definition at line 979 of file imc_cmd.c.
References IMC_HELP_MSG, IMC_HELP_MSG_LEN, _str::len, LM_DBG, NULL, outbound_proxy, _str::s, tm_binds::t_request, and tmb.
Referenced by imc_manager().
| int imc_handle_invite | ( | struct sip_msg * | msg, | |
| imc_cmd_t * | cmd, | |||
| struct sip_uri * | src, | |||
| struct sip_uri * | dst | |||
| ) |
Definition at line 352 of file imc_cmd.c.
References _imc_member::domain, _imc_room::domain, _imc_member::flags, _imc_room::flags, sip_uri::host, imc_add_member(), imc_body_buf, IMC_BUF_SIZE, imc_get_member(), imc_get_room(), imc_inv_callback(), IMC_MEMBER_ADMIN, IMC_MEMBER_INVITED, IMC_MEMBER_OWNER, imc_release_room(), IMC_ROOM_DELETED, _str::len, LM_DBG, LM_ERR, _imc_room::name, NULL, outbound_proxy, _imc_cmd::param, parse_uri(), pkg_free, pkg_malloc, _str::s, shm_free, shm_malloc(), tm_binds::t_request, tmb, _imc_room::uri, _imc_member::uri, _imc_member::user, and sip_uri::user.
Referenced by imc_manager().
| int imc_handle_join | ( | struct sip_msg * | msg, | |
| imc_cmd_t * | cmd, | |||
| struct sip_uri * | src, | |||
| struct sip_uri * | dst | |||
| ) |
Definition at line 252 of file imc_cmd.c.
References _imc_member::flags, _imc_room::flags, sip_uri::host, imc_add_member(), imc_add_room(), imc_body_buf, IMC_BUF_SIZE, imc_get_member(), imc_get_room(), IMC_MEMBER_INVITED, IMC_MEMBER_OWNER, imc_release_room(), imc_room_broadcast(), IMC_ROOM_DELETED, IMC_ROOM_PRIV, imc_send_message(), _str::len, LM_DBG, LM_ERR, _imc_room::name, NULL, _imc_cmd::param, _str::s, snprintf, _imc_member::uri, _imc_room::uri, and sip_uri::user.
Referenced by imc_manager().
| int imc_handle_list | ( | struct sip_msg * | msg, | |
| imc_cmd_t * | cmd, | |||
| struct sip_uri * | src, | |||
| struct sip_uri * | dst | |||
| ) |
Definition at line 776 of file imc_cmd.c.
References _imc_member::flags, _imc_room::flags, sip_uri::host, imc_body_buf, imc_get_member(), imc_get_room(), IMC_MEMBER_ADMIN, IMC_MEMBER_DELETED, IMC_MEMBER_INVITED, IMC_MEMBER_OWNER, IMC_MEMBER_SKIP, imc_release_room(), IMC_ROOM_DELETED, imc_send_message(), _str::len, LM_DBG, LM_ERR, _imc_room::members, _imc_member::next, NULL, _imc_cmd::param, _str::s, _imc_room::uri, _imc_member::uri, and sip_uri::user.
Referenced by imc_manager().
| int imc_handle_message | ( | struct sip_msg * | msg, | |
| str * | msgbody, | |||
| struct sip_uri * | src, | |||
| struct sip_uri * | dst | |||
| ) |
Definition at line 1035 of file imc_cmd.c.
References _imc_member::flags, _imc_room::flags, sip_uri::host, imc_body_buf, IMC_BUF_SIZE, imc_get_member(), imc_get_room(), IMC_MEMBER_INVITED, IMC_MEMBER_SKIP, imc_release_room(), imc_room_broadcast(), IMC_ROOM_DELETED, _str::len, LM_DBG, LM_ERR, NULL, _str::s, _imc_member::uri, _imc_room::uri, and sip_uri::user.
Referenced by imc_manager().
| int imc_handle_remove | ( | struct sip_msg * | msg, | |
| imc_cmd_t * | cmd, | |||
| struct sip_uri * | src, | |||
| struct sip_uri * | dst | |||
| ) |
Definition at line 577 of file imc_cmd.c.
References _imc_member::flags, _imc_room::flags, sip_uri::host, imc_body_buf, IMC_BUF_SIZE, imc_del_member(), imc_get_member(), imc_get_room(), IMC_MEMBER_ADMIN, IMC_MEMBER_DELETED, IMC_MEMBER_OWNER, imc_release_room(), imc_room_broadcast(), IMC_ROOM_DELETED, imc_send_message(), _str::len, LM_DBG, LM_ERR, NULL, _imc_cmd::param, parse_uri(), pkg_free, pkg_malloc, _str::s, snprintf, _imc_room::uri, _imc_member::uri, and sip_uri::user.
Referenced by imc_manager().
Definition at line 1003 of file imc_cmd.c.
References imc_body_buf, IMC_BUF_SIZE, imc_cmd_start_str, _str::len, LM_DBG, LM_ERR, _imc_cmd::name, NULL, outbound_proxy, _str::s, snprintf, tm_binds::t_request, and tmb.
Referenced by imc_manager().
| void imc_inv_callback | ( | struct cell * | t, | |
| int | type, | |||
| struct tmcb_params * | ps | |||
| ) |
Definition at line 1141 of file imc_cmd.c.
References tmcb_params::code, imc_del_member(), imc_get_member(), imc_get_room(), imc_release_room(), _str::len, LM_DBG, LM_ERR, NULL, outbound_proxy, tmcb_params::param, _str::s, shm_free, tm_binds::t_request, tmb, _imc_room::uri, and _imc_member::uri.
Referenced by imc_handle_invite().
| int imc_parse_cmd | ( | char * | buf, | |
| int | len, | |||
| imc_cmd_p | cmd | |||
| ) |
parse cmd
Definition at line 54 of file imc_cmd.c.
References IMC_CMD_MAX_PARAM, imc_cmd_start_char, IMC_CMDID_ACCEPT, IMC_CMDID_CREATE, IMC_CMDID_DENY, IMC_CMDID_DESTROY, IMC_CMDID_EXIT, IMC_CMDID_HELP, IMC_CMDID_INVITE, IMC_CMDID_JOIN, IMC_CMDID_LIST, IMC_CMDID_REMOVE, IMC_CMDID_UNKNOWN, _str::len, LM_DBG, LM_ERR, _imc_cmd::name, NULL, _imc_cmd::param, _str::s, and _imc_cmd::type.
Referenced by imc_manager().
| int imc_room_broadcast | ( | imc_room_p | room, | |
| str * | ctype, | |||
| str * | body | |||
| ) |
Definition at line 1088 of file imc_cmd.c.
References _imc_member::flags, IMC_MEMBER_DELETED, IMC_MEMBER_INVITED, IMC_MEMBER_SKIP, imc_send_message(), _str::len, LM_DBG, _imc_room::members, _imc_member::next, _imc_room::nr_of_members, NULL, _str::s, _imc_room::uri, and _imc_member::uri.
Referenced by imc_handle_accept(), imc_handle_create(), imc_handle_destroy(), imc_handle_exit(), imc_handle_join(), imc_handle_message(), and imc_handle_remove().
Definition at line 1120 of file imc_cmd.c.
References NULL, outbound_proxy, _str::s, tm_binds::t_request, and tmb.
Referenced by imc_handle_create(), imc_handle_deny(), imc_handle_join(), imc_handle_list(), imc_handle_remove(), and imc_room_broadcast().
char imc_body_buf[IMC_BUF_SIZE] [static] |
Definition at line 42 of file imc_cmd.c.
Referenced by imc_handle_accept(), imc_handle_create(), imc_handle_deny(), imc_handle_destroy(), imc_handle_exit(), imc_handle_invite(), imc_handle_join(), imc_handle_list(), imc_handle_message(), imc_handle_remove(), and imc_handle_unknown().
str imc_hdr_ctype = { "Content-Type: text/plain\r\n", 26} [static] |
str imc_msg_type = { "MESSAGE", 7 } [static] |
1.5.6