Skinny: One more for MODSKINNY-1: (soft_key_event)

This commit is contained in:
Mathieu Parent 2010-05-21 15:52:30 +02:00
parent 18a7657332
commit 0cb6af2f5a
1 changed files with 12 additions and 11 deletions

View File

@ -1714,16 +1714,17 @@ switch_status_t skinny_handle_soft_key_event_message(listener_t *listener, skinn
{ {
switch_status_t status = SWITCH_STATUS_SUCCESS; switch_status_t status = SWITCH_STATUS_SUCCESS;
uint32_t line_instance = 0; uint32_t line_instance = 0;
uint32_t call_id = 0;
switch_core_session_t *session = NULL; switch_core_session_t *session = NULL;
switch_channel_t *channel = NULL; switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL; private_t *tech_pvt = NULL;
switch_assert(listener); skinny_check_data_length(request, sizeof(request->data.soft_key_event.event));
switch_assert(listener->profile);
skinny_check_data_length(request, sizeof(request->data.soft_key_event));
if(skinny_check_data_length_soft(request, sizeof(request->data.soft_key_event))) {
line_instance = request->data.soft_key_event.line_instance; line_instance = request->data.soft_key_event.line_instance;
call_id = request->data.soft_key_eventcall_id;
}
switch(request->data.soft_key_event.event) { switch(request->data.soft_key_event.event) {
case SOFTKEY_REDIAL: case SOFTKEY_REDIAL:
@ -1738,28 +1739,28 @@ switch_status_t skinny_handle_soft_key_event_message(listener_t *listener, skinn
skinny_session_process_dest(session, listener, line_instance, NULL, '\0', 0); skinny_session_process_dest(session, listener, line_instance, NULL, '\0', 0);
break; break;
case SOFTKEY_HOLD: case SOFTKEY_HOLD:
session = skinny_profile_find_session(listener->profile, listener, &line_instance, request->data.soft_key_event.call_id); session = skinny_profile_find_session(listener->profile, listener, &line_instance, call_id);
if(session) { if(session) {
status = skinny_session_hold_line(session, listener, line_instance); status = skinny_session_hold_line(session, listener, line_instance);
} }
break; break;
case SOFTKEY_TRANSFER: case SOFTKEY_TRANSFER:
session = skinny_profile_find_session(listener->profile, listener, &line_instance, request->data.soft_key_event.call_id); session = skinny_profile_find_session(listener->profile, listener, &line_instance, call_id);
if(session) { if(session) {
status = skinny_session_transfer(session, listener, line_instance); status = skinny_session_transfer(session, listener, line_instance);
} }
break; break;
case SOFTKEY_BACKSPACE: case SOFTKEY_BACKSPACE:
session = skinny_profile_find_session(listener->profile, listener, &line_instance, request->data.soft_key_event.call_id); session = skinny_profile_find_session(listener->profile, listener, &line_instance, call_id);
if(session) { if(session) {
skinny_session_process_dest(session, listener, line_instance, NULL, '\0', 1); skinny_session_process_dest(session, listener, line_instance, NULL, '\0', 1);
} }
break; break;
case SOFTKEY_ENDCALL: case SOFTKEY_ENDCALL:
session = skinny_profile_find_session(listener->profile, listener, &line_instance, request->data.soft_key_event.call_id); session = skinny_profile_find_session(listener->profile, listener, &line_instance, call_id);
if(session) { if(session) {
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
@ -1768,14 +1769,14 @@ switch_status_t skinny_handle_soft_key_event_message(listener_t *listener, skinn
} }
break; break;
case SOFTKEY_RESUME: case SOFTKEY_RESUME:
session = skinny_profile_find_session(listener->profile, listener, &line_instance, request->data.soft_key_event.call_id); session = skinny_profile_find_session(listener->profile, listener, &line_instance, call_id);
if(session) { if(session) {
status = skinny_session_unhold_line(session, listener, line_instance); status = skinny_session_unhold_line(session, listener, line_instance);
} }
break; break;
case SOFTKEY_ANSWER: case SOFTKEY_ANSWER:
session = skinny_profile_find_session(listener->profile, listener, &line_instance, request->data.soft_key_event.call_id); session = skinny_profile_find_session(listener->profile, listener, &line_instance, call_id);
if(session) { if(session) {
status = skinny_session_answer(session, listener, line_instance); status = skinny_session_answer(session, listener, line_instance);