imc_cmd.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef _IMC_CMD_H_
00032 #define _IMC_CMD_H_
00033
00034 #include "../../parser/parse_uri.h"
00035 #include "../../str.h"
00036 #include "imc_mng.h"
00037
00038 #define IMC_CMD_START '#'
00039 #define IMC_CMD_START_STR "#"
00040
00041 #define IMC_CMDID_CREATE 1
00042 #define IMC_CMDID_INVITE 2
00043 #define IMC_CMDID_JOIN 3
00044 #define IMC_CMDID_EXIT 4
00045 #define IMC_CMDID_ACCEPT 5
00046 #define IMC_CMDID_DENY 6
00047 #define IMC_CMDID_REMOVE 7
00048 #define IMC_CMDID_DESTROY 8
00049 #define IMC_CMDID_HELP 9
00050 #define IMC_CMDID_LIST 10
00051 #define IMC_CMDID_UNKNOWN 11
00052
00053 #define IMC_CMD_CREATE "create"
00054 #define IMC_CMD_INVITE "invite"
00055 #define IMC_CMD_JOIN "join"
00056 #define IMC_CMD_EXIT "exit"
00057 #define IMC_CMD_ACCEPT "accept"
00058 #define IMC_CMD_DENY "deny"
00059 #define IMC_CMD_REMOVE "remove"
00060 #define IMC_CMD_DESTROY "destroy"
00061 #define IMC_CMD_LIST "list"
00062
00063 #define IMC_ROOM_PRIVATE "private"
00064 #define IMC_ROOM_PRIVATE_LEN (sizeof(IMC_ROOM_PRIVATE)-1)
00065
00066 #define IMC_HELP_MSG "\r\n"IMC_CMD_START_STR IMC_CMD_CREATE" <room_name> - \
00067 create new connference room\r\n\
00068 "IMC_CMD_START_STR IMC_CMD_JOIN" [<room_name>] - \
00069 join the conference room\r\n\
00070 "IMC_CMD_START_STR IMC_CMD_INVITE" <user_name> [<room_name>] - \
00071 invite a user to join a conference room\r\n\
00072 "IMC_CMD_START_STR IMC_CMD_ACCEPT" - \
00073 accept invitation to join a conference room\r\n\
00074 "IMC_CMD_START_STR IMC_CMD_DENY" - \
00075 deny invitation to join a conference room\r\n\
00076 "IMC_CMD_START_STR IMC_CMD_REMOVE" <user_name> [<room_name>] - \
00077 remove an user from the conference room\r\n\
00078 "IMC_CMD_START_STR IMC_CMD_LIST" - \
00079 list members is a conference room\r\n\
00080 "IMC_CMD_START_STR IMC_CMD_EXIT" [<room_name>] - \
00081 exit from a conference room\r\n\
00082 "IMC_CMD_START_STR IMC_CMD_DESTROY" [<room_name>] - \
00083 destroy conference room\r\n"
00084
00085 #define IMC_HELP_MSG_LEN (sizeof(IMC_HELP_MSG)-1)
00086
00087
00088 #define IMC_CMD_MAX_PARAM 5
00089 typedef struct _imc_cmd
00090 {
00091 str name;
00092 int type;
00093 str param[IMC_CMD_MAX_PARAM];
00094 } imc_cmd_t, *imc_cmd_p;
00095
00096 int imc_parse_cmd(char *buf, int len, imc_cmd_p cmd);
00097
00098 int imc_handle_create(struct sip_msg* msg, imc_cmd_t *cmd,
00099 struct sip_uri *src, struct sip_uri *dst);
00100 int imc_handle_join(struct sip_msg* msg, imc_cmd_t *cmd,
00101 struct sip_uri *src, struct sip_uri *dst);
00102 int imc_handle_invite(struct sip_msg* msg, imc_cmd_t *cmd,
00103 struct sip_uri *src, struct sip_uri *dst);
00104 int imc_handle_accept(struct sip_msg* msg, imc_cmd_t *cmd,
00105 struct sip_uri *src, struct sip_uri *dst);
00106 int imc_handle_deny(struct sip_msg* msg, imc_cmd_t *cmd,
00107 struct sip_uri *src, struct sip_uri *dst);
00108 int imc_handle_remove(struct sip_msg* msg, imc_cmd_t *cmd,
00109 struct sip_uri *src, struct sip_uri *dst);
00110 int imc_handle_list(struct sip_msg* msg, imc_cmd_t *cmd,
00111 struct sip_uri *src, struct sip_uri *dst);
00112 int imc_handle_exit(struct sip_msg* msg, imc_cmd_t *cmd,
00113 struct sip_uri *src, struct sip_uri *dst);
00114 int imc_handle_destroy(struct sip_msg* msg, imc_cmd_t *cmd,
00115 struct sip_uri *src, struct sip_uri *dst);
00116 int imc_handle_unknown(struct sip_msg* msg, imc_cmd_t *cmd,
00117 str *src, str *dst);
00118 int imc_handle_help(struct sip_msg* msg, imc_cmd_t *cmd,
00119 str *src, str *dst);
00120 int imc_handle_message(struct sip_msg* msg, str *msgbody,
00121 struct sip_uri *src, struct sip_uri *dst);
00122
00123 #endif