Skinny: noop ForwardStatReq and ForwardStat implementation

This commit is contained in:
Mathieu Parent 2011-02-26 11:37:32 +01:00
parent f217ec48a4
commit d86388dbf7
4 changed files with 175 additions and 134 deletions

View File

@ -97,6 +97,12 @@ struct PACKED on_hook_message {
uint32_t call_id; uint32_t call_id;
}; };
/* ForwardStatReqMessage */
#define FORWARD_STAT_REQ_MESSAGE 0x0009
struct PACKED forward_stat_req_message {
uint32_t line_instance;
};
/* SpeedDialStatReqMessage */ /* SpeedDialStatReqMessage */
#define SPEED_DIAL_STAT_REQ_MESSAGE 0x000A #define SPEED_DIAL_STAT_REQ_MESSAGE 0x000A
struct PACKED speed_dial_stat_req_message { struct PACKED speed_dial_stat_req_message {
@ -328,6 +334,19 @@ struct PACKED call_info_message {
uint32_t party_pi_restriction_bits; uint32_t party_pi_restriction_bits;
}; };
/* ForwardStatMessage */
#define FORWARD_STAT_MESSAGE 0x0090
struct PACKED forward_stat_message {
uint32_t active_forward;
uint32_t line_instance;
uint32_t forward_all_active;
char forward_all_number[24];
uint32_t forward_busy_active;
char forward_busy_number[24];
uint32_t forward_noanswer_active;
char forward_noanswer_number[24];
};
/* SpeedDialStatMessage */ /* SpeedDialStatMessage */
#define SPEED_DIAL_STAT_RES_MESSAGE 0x0091 #define SPEED_DIAL_STAT_RES_MESSAGE 0x0091
struct PACKED speed_dial_stat_res_message { struct PACKED speed_dial_stat_res_message {
@ -573,6 +592,7 @@ union skinny_data {
struct stimulus_message stimulus; struct stimulus_message stimulus;
struct off_hook_message off_hook; struct off_hook_message off_hook;
struct on_hook_message on_hook; struct on_hook_message on_hook;
struct forward_stat_req_message forward_stat_req;
struct speed_dial_stat_req_message speed_dial_req; struct speed_dial_stat_req_message speed_dial_req;
struct line_stat_req_message line_req; struct line_stat_req_message line_req;
/* no data for CONFIG_STAT_REQ_MESSAGE */ /* no data for CONFIG_STAT_REQ_MESSAGE */
@ -603,6 +623,7 @@ union skinny_data {
struct start_media_transmission_message start_media; struct start_media_transmission_message start_media;
struct stop_media_transmission_message stop_media; struct stop_media_transmission_message stop_media;
struct call_info_message call_info; struct call_info_message call_info;
struct forward_stat_message forward_stat;
struct speed_dial_stat_res_message speed_dial_res; struct speed_dial_stat_res_message speed_dial_res;
struct line_stat_res_message line_res; struct line_stat_res_message line_res;
struct config_stat_res_message config_res; struct config_stat_res_message config_res;

View File

@ -1329,6 +1329,22 @@ switch_status_t skinny_handle_on_hook_message(listener_t *listener, skinny_messa
return status; return status;
} }
switch_status_t skinny_handle_forward_stat_req_message(listener_t *listener, skinny_message_t *request)
{
skinny_message_t *message;
skinny_check_data_length(request, sizeof(request->data.forward_stat_req));
message = switch_core_alloc(listener->pool, 12+sizeof(message->data.forward_stat));
message->type = FORWARD_STAT_MESSAGE;
message->length = 4 + sizeof(message->data.forward_stat);
message->data.forward_stat.line_instance = request->data.forward_stat_req.line_instance;
skinny_send_reply(listener, message);
return SWITCH_STATUS_SUCCESS;
}
switch_status_t skinny_handle_speed_dial_stat_request(listener_t *listener, skinny_message_t *request) switch_status_t skinny_handle_speed_dial_stat_request(listener_t *listener, skinny_message_t *request)
{ {
@ -2046,6 +2062,8 @@ switch_status_t skinny_handle_request(listener_t *listener, skinny_message_t *re
return skinny_handle_off_hook_message(listener, request); return skinny_handle_off_hook_message(listener, request);
case ON_HOOK_MESSAGE: case ON_HOOK_MESSAGE:
return skinny_handle_on_hook_message(listener, request); return skinny_handle_on_hook_message(listener, request);
case FORWARD_STAT_REQ_MESSAGE:
return skinny_handle_forward_stat_req_message(listener, request);
case SPEED_DIAL_STAT_REQ_MESSAGE: case SPEED_DIAL_STAT_REQ_MESSAGE:
return skinny_handle_speed_dial_stat_request(listener, request); return skinny_handle_speed_dial_stat_request(listener, request);
case LINE_STAT_REQ_MESSAGE: case LINE_STAT_REQ_MESSAGE:

View File

@ -43,6 +43,7 @@ struct skinny_table SKINNY_MESSAGE_TYPES[] = {
{"StimulusMessage", STIMULUS_MESSAGE}, {"StimulusMessage", STIMULUS_MESSAGE},
{"OffHookMessage", OFF_HOOK_MESSAGE}, {"OffHookMessage", OFF_HOOK_MESSAGE},
{"OnHookMessage", ON_HOOK_MESSAGE}, {"OnHookMessage", ON_HOOK_MESSAGE},
{"ForwardStatReqMessage", FORWARD_STAT_REQ_MESSAGE},
{"SpeedDialStatReqMessage", SPEED_DIAL_STAT_REQ_MESSAGE}, {"SpeedDialStatReqMessage", SPEED_DIAL_STAT_REQ_MESSAGE},
{"LineStatReqMessage", LINE_STAT_REQ_MESSAGE}, {"LineStatReqMessage", LINE_STAT_REQ_MESSAGE},
{"ConfigStatReqMessage", CONFIG_STAT_REQ_MESSAGE}, {"ConfigStatReqMessage", CONFIG_STAT_REQ_MESSAGE},
@ -73,6 +74,7 @@ struct skinny_table SKINNY_MESSAGE_TYPES[] = {
{"StartMediaTransmissionMessage", START_MEDIA_TRANSMISSION_MESSAGE}, {"StartMediaTransmissionMessage", START_MEDIA_TRANSMISSION_MESSAGE},
{"StopMediaTransmissionMessage", STOP_MEDIA_TRANSMISSION_MESSAGE}, {"StopMediaTransmissionMessage", STOP_MEDIA_TRANSMISSION_MESSAGE},
{"CallInfoMessage", CALL_INFO_MESSAGE}, {"CallInfoMessage", CALL_INFO_MESSAGE},
{"ForwardStatMessage", FORWARD_STAT_MESSAGE},
{"SpeedDialStatResMessage", SPEED_DIAL_STAT_RES_MESSAGE}, {"SpeedDialStatResMessage", SPEED_DIAL_STAT_RES_MESSAGE},
{"LineStatResMessage", LINE_STAT_RES_MESSAGE}, {"LineStatResMessage", LINE_STAT_RES_MESSAGE},
{"ConfigStatResMessage", CONFIG_STAT_RES_MESSAGE}, {"ConfigStatResMessage", CONFIG_STAT_RES_MESSAGE},

View File

@ -87,7 +87,7 @@ uint32_t func(const char *str)\
} }
extern struct skinny_table SKINNY_MESSAGE_TYPES[67]; extern struct skinny_table SKINNY_MESSAGE_TYPES[69];
const char *skinny_message_type2str(uint32_t id); const char *skinny_message_type2str(uint32_t id);
uint32_t skinny_str2message_type(const char *str); uint32_t skinny_str2message_type(const char *str);
#define SKINNY_PUSH_MESSAGE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_MESSAGE_TYPES) #define SKINNY_PUSH_MESSAGE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_MESSAGE_TYPES)