diff --git a/src/mod/endpoints/mod_skinny/skinny_protocol.h b/src/mod/endpoints/mod_skinny/skinny_protocol.h index 20e7d7f92f..1a26558ffc 100644 --- a/src/mod/endpoints/mod_skinny/skinny_protocol.h +++ b/src/mod/endpoints/mod_skinny/skinny_protocol.h @@ -68,6 +68,13 @@ struct PACKED keypad_button_message { uint32_t call_id; }; +/* EnblocCallMessage */ +#define ENBLOC_CALL_MESSAGE 0x0004 +struct PACKED enbloc_call_message { + char called_party[24]; + uint32_t line_instance; +}; + /* StimulusMessage */ #define STIMULUS_MESSAGE 0x0005 struct PACKED stimulus_message { @@ -562,6 +569,7 @@ union skinny_data { struct register_message reg; struct port_message port; struct keypad_button_message keypad_button; + struct enbloc_call_message enbloc_call; struct stimulus_message stimulus; struct off_hook_message off_hook; struct on_hook_message on_hook; diff --git a/src/mod/endpoints/mod_skinny/skinny_server.c b/src/mod/endpoints/mod_skinny/skinny_server.c index 5874be4c6c..e7c761dfca 100644 --- a/src/mod/endpoints/mod_skinny/skinny_server.c +++ b/src/mod/endpoints/mod_skinny/skinny_server.c @@ -1171,6 +1171,29 @@ switch_status_t skinny_handle_keypad_button_message(listener_t *listener, skinny return SWITCH_STATUS_SUCCESS; } +switch_status_t skinny_handle_enbloc_call_message(listener_t *listener, skinny_message_t *request) +{ + uint32_t line_instance = 1; + switch_core_session_t *session = NULL; + + skinny_check_data_length(request, sizeof(request->data.enbloc_call.called_party)); + + if(skinny_check_data_length_soft(request, sizeof(request->data.enbloc_call))) { + if (request->data.enbloc_call.line_instance > 0) { + line_instance = request->data.enbloc_call.line_instance; + } + } + + session = skinny_profile_find_session(listener->profile, listener, &line_instance, 0); + + if(session) { + skinny_session_process_dest(session, listener, line_instance, request->data.enbloc_call.called_party, '\0', 0); + switch_core_session_rwunlock(session); + } + + return SWITCH_STATUS_SUCCESS; +} + switch_status_t skinny_handle_stimulus_message(listener_t *listener, skinny_message_t *request) { switch_status_t status = SWITCH_STATUS_SUCCESS; @@ -2004,6 +2027,8 @@ switch_status_t skinny_handle_request(listener_t *listener, skinny_message_t *re return skinny_handle_port_message(listener, request); case KEYPAD_BUTTON_MESSAGE: return skinny_handle_keypad_button_message(listener, request); + case ENBLOC_CALL_MESSAGE: + return skinny_handle_enbloc_call_message(listener, request); case STIMULUS_MESSAGE: return skinny_handle_stimulus_message(listener, request); case OFF_HOOK_MESSAGE: diff --git a/src/mod/endpoints/mod_skinny/skinny_tables.c b/src/mod/endpoints/mod_skinny/skinny_tables.c index 053b350b46..466a70538d 100644 --- a/src/mod/endpoints/mod_skinny/skinny_tables.c +++ b/src/mod/endpoints/mod_skinny/skinny_tables.c @@ -39,6 +39,7 @@ struct skinny_table SKINNY_MESSAGE_TYPES[] = { {"RegisterMessage", REGISTER_MESSAGE}, {"PortMessage", PORT_MESSAGE}, {"KeypadButtonMessage", KEYPAD_BUTTON_MESSAGE}, + {"EnblocCallMessage", ENBLOC_CALL_MESSAGE}, {"StimulusMessage", STIMULUS_MESSAGE}, {"OffHookMessage", OFF_HOOK_MESSAGE}, {"OnHookMessage", ON_HOOK_MESSAGE}, diff --git a/src/mod/endpoints/mod_skinny/skinny_tables.h b/src/mod/endpoints/mod_skinny/skinny_tables.h index c119e1f141..bc92f9f4bf 100644 --- a/src/mod/endpoints/mod_skinny/skinny_tables.h +++ b/src/mod/endpoints/mod_skinny/skinny_tables.h @@ -87,7 +87,7 @@ uint32_t func(const char *str)\ } -extern struct skinny_table SKINNY_MESSAGE_TYPES[66]; +extern struct skinny_table SKINNY_MESSAGE_TYPES[67]; const char *skinny_message_type2str(uint32_t id); uint32_t skinny_str2message_type(const char *str); #define SKINNY_PUSH_MESSAGE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_MESSAGE_TYPES)