#include "../../parser/parse_uri.h"#include "../../str.h"#include "imc_mng.h"


Go to the source code of this file.
Data Structures | |
| struct | _imc_cmd |
Defines | |
| #define | IMC_CMD_ACCEPT "accept" |
| #define | IMC_CMD_CREATE "create" |
| #define | IMC_CMD_DENY "deny" |
| #define | IMC_CMD_DESTROY "destroy" |
| #define | IMC_CMD_EXIT "exit" |
| #define | IMC_CMD_INVITE "invite" |
| #define | IMC_CMD_JOIN "join" |
| #define | IMC_CMD_LIST "list" |
| #define | IMC_CMD_MAX_PARAM 5 |
| #define | IMC_CMD_REMOVE "remove" |
| #define | IMC_CMD_START '#' |
| #define | IMC_CMD_START_STR "#" |
| #define | IMC_CMDID_ACCEPT 5 |
| #define | IMC_CMDID_CREATE 1 |
| #define | IMC_CMDID_DENY 6 |
| #define | IMC_CMDID_DESTROY 8 |
| #define | IMC_CMDID_EXIT 4 |
| #define | IMC_CMDID_HELP 9 |
| #define | IMC_CMDID_INVITE 2 |
| #define | IMC_CMDID_JOIN 3 |
| #define | IMC_CMDID_LIST 10 |
| #define | IMC_CMDID_REMOVE 7 |
| #define | IMC_CMDID_UNKNOWN 11 |
| #define | IMC_HELP_MSG "\r\n"IMC_CMD_START_STR IMC_CMD_CREATE" <room_name> - \create new connference room\r\n\"IMC_CMD_START_STR IMC_CMD_JOIN" [<room_name>] - \join the conference room\r\n\"IMC_CMD_START_STR IMC_CMD_INVITE" <user_name> [<room_name>] - \invite a user to join a conference room\r\n\"IMC_CMD_START_STR IMC_CMD_ACCEPT" - \accept invitation to join a conference room\r\n\"IMC_CMD_START_STR IMC_CMD_DENY" - \deny invitation to join a conference room\r\n\"IMC_CMD_START_STR IMC_CMD_REMOVE" <user_name> [<room_name>] - \remove an user from the conference room\r\n\"IMC_CMD_START_STR IMC_CMD_LIST" - \list members is a conference room\r\n\"IMC_CMD_START_STR IMC_CMD_EXIT" [<room_name>] - \exit from a conference room\r\n\"IMC_CMD_START_STR IMC_CMD_DESTROY" [<room_name>] - \destroy conference room\r\n" |
| #define | IMC_HELP_MSG_LEN (sizeof(IMC_HELP_MSG)-1) |
| #define | IMC_ROOM_PRIVATE "private" |
| #define | IMC_ROOM_PRIVATE_LEN (sizeof(IMC_ROOM_PRIVATE)-1) |
Typedefs | |
| typedef struct _imc_cmd * | imc_cmd_p |
| typedef struct _imc_cmd | imc_cmd_t |
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) |
| int | imc_parse_cmd (char *buf, int len, imc_cmd_p cmd) |
| #define IMC_CMD_MAX_PARAM 5 |
| #define IMC_CMDID_ACCEPT 5 |
| #define IMC_CMDID_CREATE 1 |
| #define IMC_CMDID_DENY 6 |
| #define IMC_CMDID_DESTROY 8 |
| #define IMC_CMDID_EXIT 4 |
| #define IMC_CMDID_HELP 9 |
| #define IMC_CMDID_INVITE 2 |
| #define IMC_CMDID_JOIN 3 |
| #define IMC_CMDID_LIST 10 |
| #define IMC_CMDID_REMOVE 7 |
| #define IMC_CMDID_UNKNOWN 11 |
| #define IMC_HELP_MSG "\r\n"IMC_CMD_START_STR IMC_CMD_CREATE" <room_name> - \create new connference room\r\n\"IMC_CMD_START_STR IMC_CMD_JOIN" [<room_name>] - \join the conference room\r\n\"IMC_CMD_START_STR IMC_CMD_INVITE" <user_name> [<room_name>] - \invite a user to join a conference room\r\n\"IMC_CMD_START_STR IMC_CMD_ACCEPT" - \accept invitation to join a conference room\r\n\"IMC_CMD_START_STR IMC_CMD_DENY" - \deny invitation to join a conference room\r\n\"IMC_CMD_START_STR IMC_CMD_REMOVE" <user_name> [<room_name>] - \remove an user from the conference room\r\n\"IMC_CMD_START_STR IMC_CMD_LIST" - \list members is a conference room\r\n\"IMC_CMD_START_STR IMC_CMD_EXIT" [<room_name>] - \exit from a conference room\r\n\"IMC_CMD_START_STR IMC_CMD_DESTROY" [<room_name>] - \destroy conference room\r\n" |
| #define IMC_HELP_MSG_LEN (sizeof(IMC_HELP_MSG)-1) |
| #define IMC_ROOM_PRIVATE "private" |
| #define IMC_ROOM_PRIVATE_LEN (sizeof(IMC_ROOM_PRIVATE)-1) |
| 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().
| 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().
1.5.6