Skinny: handle Hold stimulus
This commit is contained in:
parent
764b435d7c
commit
e7a5420b31
|
@ -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 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;
|
struct speed_dial_stat_res_message *button = NULL;
|
||||||
uint32_t line_instance = 0;
|
uint32_t line_instance = 0;
|
||||||
uint32_t call_id = 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_create_ingoing_session(listener, &line_instance, &session);
|
||||||
skinny_session_process_dest(session, listener, line_instance, "redial", '\0', 0);
|
skinny_session_process_dest(session, listener, line_instance, "redial", '\0', 0);
|
||||||
break;
|
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:
|
case SKINNY_BUTTON_SPEED_DIAL:
|
||||||
skinny_speed_dial_get(listener, request->data.stimulus.instance, &button);
|
skinny_speed_dial_get(listener, request->data.stimulus.instance, &button);
|
||||||
if(strlen(button->line) > 0) {
|
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);
|
skinny_session_process_dest(session, listener, line_instance, button->line, '\0', 0);
|
||||||
}
|
}
|
||||||
break;
|
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:
|
default:
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unknown Stimulus Type Received [%d]\n", request->data.stimulus.instance_type);
|
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);
|
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)
|
switch_status_t skinny_handle_open_receive_channel_ack_message(listener_t *listener, skinny_message_t *request)
|
||||||
|
|
|
@ -118,6 +118,7 @@ struct skinny_table SKINNY_BUTTONS[] = {
|
||||||
{"Unknown", SKINNY_BUTTON_UNKNOWN},
|
{"Unknown", SKINNY_BUTTON_UNKNOWN},
|
||||||
{"LastNumberRedial", SKINNY_BUTTON_LAST_NUMBER_REDIAL},
|
{"LastNumberRedial", SKINNY_BUTTON_LAST_NUMBER_REDIAL},
|
||||||
{"SpeedDial", SKINNY_BUTTON_SPEED_DIAL},
|
{"SpeedDial", SKINNY_BUTTON_SPEED_DIAL},
|
||||||
|
{"Hold", SKINNY_BUTTON_HOLD},
|
||||||
{"Line", SKINNY_BUTTON_LINE},
|
{"Line", SKINNY_BUTTON_LINE},
|
||||||
{"Voicemail", SKINNY_BUTTON_VOICEMAIL},
|
{"Voicemail", SKINNY_BUTTON_VOICEMAIL},
|
||||||
{"Privacy", SKINNY_BUTTON_PRIVACY},
|
{"Privacy", SKINNY_BUTTON_PRIVACY},
|
||||||
|
|
|
@ -151,13 +151,14 @@ enum skinny_button_definition {
|
||||||
SKINNY_BUTTON_UNKNOWN = 0x00,
|
SKINNY_BUTTON_UNKNOWN = 0x00,
|
||||||
SKINNY_BUTTON_LAST_NUMBER_REDIAL = 0x01,
|
SKINNY_BUTTON_LAST_NUMBER_REDIAL = 0x01,
|
||||||
SKINNY_BUTTON_SPEED_DIAL = 0x02,
|
SKINNY_BUTTON_SPEED_DIAL = 0x02,
|
||||||
|
SKINNY_BUTTON_HOLD = 0x03,
|
||||||
SKINNY_BUTTON_LINE = 0x09,
|
SKINNY_BUTTON_LINE = 0x09,
|
||||||
SKINNY_BUTTON_VOICEMAIL = 0x0F,
|
SKINNY_BUTTON_VOICEMAIL = 0x0F,
|
||||||
SKINNY_BUTTON_PRIVACY = 0x13,
|
SKINNY_BUTTON_PRIVACY = 0x13,
|
||||||
SKINNY_BUTTON_SERVICE_URL = 0x14,
|
SKINNY_BUTTON_SERVICE_URL = 0x14,
|
||||||
SKINNY_BUTTON_UNDEFINED = 0xFF,
|
SKINNY_BUTTON_UNDEFINED = 0xFF,
|
||||||
};
|
};
|
||||||
struct skinny_table SKINNY_BUTTONS[9];
|
struct skinny_table SKINNY_BUTTONS[10];
|
||||||
const char *skinny_button2str(uint32_t id);
|
const char *skinny_button2str(uint32_t id);
|
||||||
uint32_t skinny_str2button(const char *str);
|
uint32_t skinny_str2button(const char *str);
|
||||||
#define SKINNY_PUSH_STIMULI SKINNY_DECLARE_PUSH_MATCH(SKINNY_BUTTONS)
|
#define SKINNY_PUSH_STIMULI SKINNY_DECLARE_PUSH_MATCH(SKINNY_BUTTONS)
|
||||||
|
|
Loading…
Reference in New Issue