diff --git a/src/mod/endpoints/mod_skinny/skinny_protocol.c b/src/mod/endpoints/mod_skinny/skinny_protocol.c index 30bd4b3913..c74c65c170 100644 --- a/src/mod/endpoints/mod_skinny/skinny_protocol.c +++ b/src/mod/endpoints/mod_skinny/skinny_protocol.c @@ -2223,6 +2223,7 @@ switch_status_t skinny_handle_off_hook_message(listener_t *listener, skinny_mess switch_status_t skinny_handle_stimulus_message(listener_t *listener, skinny_message_t *request) { + switch_status_t status = SWITCH_STATUS_SUCCESS; struct speed_dial_stat_res_message *button = NULL; uint32_t line_instance = 0; uint32_t call_id = 0; @@ -2239,10 +2240,6 @@ switch_status_t skinny_handle_stimulus_message(listener_t *listener, skinny_mess skinny_create_ingoing_session(listener, &line_instance, &session); skinny_session_process_dest(session, listener, line_instance, "redial", '\0', 0); break; - case SKINNY_BUTTON_VOICEMAIL: - skinny_create_ingoing_session(listener, &line_instance, &session); - skinny_session_process_dest(session, listener, line_instance, "vmain", '\0', 0); - break; case SKINNY_BUTTON_SPEED_DIAL: skinny_speed_dial_get(listener, request->data.stimulus.instance, &button); if(strlen(button->line) > 0) { @@ -2250,6 +2247,17 @@ switch_status_t skinny_handle_stimulus_message(listener_t *listener, skinny_mess skinny_session_process_dest(session, listener, line_instance, button->line, '\0', 0); } break; + case SKINNY_BUTTON_HOLD: + session = skinny_profile_find_session(listener->profile, listener, &line_instance, call_id); + + if(session) { + status = skinny_session_hold_line(session, listener, line_instance); + } + break; + case SKINNY_BUTTON_VOICEMAIL: + skinny_create_ingoing_session(listener, &line_instance, &session); + skinny_session_process_dest(session, listener, line_instance, "vmain", '\0', 0); + break; default: switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unknown Stimulus Type Received [%d]\n", request->data.stimulus.instance_type); } @@ -2258,7 +2266,7 @@ switch_status_t skinny_handle_stimulus_message(listener_t *listener, skinny_mess switch_core_session_rwunlock(session); } - return SWITCH_STATUS_SUCCESS; + return status; } switch_status_t skinny_handle_open_receive_channel_ack_message(listener_t *listener, skinny_message_t *request) diff --git a/src/mod/endpoints/mod_skinny/skinny_tables.c b/src/mod/endpoints/mod_skinny/skinny_tables.c index b9d6a2e29b..a9bf84431f 100644 --- a/src/mod/endpoints/mod_skinny/skinny_tables.c +++ b/src/mod/endpoints/mod_skinny/skinny_tables.c @@ -118,6 +118,7 @@ struct skinny_table SKINNY_BUTTONS[] = { {"Unknown", SKINNY_BUTTON_UNKNOWN}, {"LastNumberRedial", SKINNY_BUTTON_LAST_NUMBER_REDIAL}, {"SpeedDial", SKINNY_BUTTON_SPEED_DIAL}, + {"Hold", SKINNY_BUTTON_HOLD}, {"Line", SKINNY_BUTTON_LINE}, {"Voicemail", SKINNY_BUTTON_VOICEMAIL}, {"Privacy", SKINNY_BUTTON_PRIVACY}, diff --git a/src/mod/endpoints/mod_skinny/skinny_tables.h b/src/mod/endpoints/mod_skinny/skinny_tables.h index 8db8209e87..f3755b5c2f 100644 --- a/src/mod/endpoints/mod_skinny/skinny_tables.h +++ b/src/mod/endpoints/mod_skinny/skinny_tables.h @@ -151,13 +151,14 @@ enum skinny_button_definition { SKINNY_BUTTON_UNKNOWN = 0x00, SKINNY_BUTTON_LAST_NUMBER_REDIAL = 0x01, SKINNY_BUTTON_SPEED_DIAL = 0x02, + SKINNY_BUTTON_HOLD = 0x03, SKINNY_BUTTON_LINE = 0x09, SKINNY_BUTTON_VOICEMAIL = 0x0F, SKINNY_BUTTON_PRIVACY = 0x13, SKINNY_BUTTON_SERVICE_URL = 0x14, SKINNY_BUTTON_UNDEFINED = 0xFF, }; -struct skinny_table SKINNY_BUTTONS[9]; +struct skinny_table SKINNY_BUTTONS[10]; const char *skinny_button2str(uint32_t id); uint32_t skinny_str2button(const char *str); #define SKINNY_PUSH_STIMULI SKINNY_DECLARE_PUSH_MATCH(SKINNY_BUTTONS)