Project "FreeSWITCH Source" received a push.

branch: master updated

       via: 45ec088753031fc60b1b1abeb25536b7ac042374 (commit)
       via: 33848eb01c327b04ad3c34bb5165bb1e01891863 (commit)
      from: 53aeb1c1a71e6546950721d9f79f4a6131eb3071 (commit)


= COMMIT LOG ===========================================================
committer: Leon de Rooij
comments: 
Merge branch 'master' of ssh://git.freeswitch.org/freeswitch
committer: Mathieu Parent
comments: 
Skinny: handle Enbloc messages

diff --git a/src/mod/endpoints/mod_skinny/skinny_protocol.h b/src/mod/endpoints/mod_skinny/skinny_protocol.h
index 20e7d7f..1a26558 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 5874be4..e7c761d 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 053b350..466a705 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 c119e1f..bc92f9f 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)
========================================================================

Summary of changes:
 src/mod/endpoints/mod_skinny/skinny_protocol.h |    8 +++++++
 src/mod/endpoints/mod_skinny/skinny_server.c   |   25 ++++++++++++++++++++++++
 src/mod/endpoints/mod_skinny/skinny_tables.c   |    1 +
 src/mod/endpoints/mod_skinny/skinny_tables.h   |    2 +-
 4 files changed, 35 insertions(+), 1 deletions(-)

this email was generated because of /git/your-repo.git/hooks/post-receive by the file /git-core/contrib/hooks/post-receive-email
For more info, see http://blog.chomperstomp.com/?p=630 --
FreeSWITCH Source