add send of DisplayPromptStatusMessage and ForwardAll stimulus

This commit is contained in:
Nathan Neulinger 2013-09-23 13:18:00 -05:00
parent c214648d88
commit 23530ebb23
3 changed files with 33 additions and 1 deletions

View File

@ -407,6 +407,28 @@ static switch_status_t skinny_api_cmd_profile_device_send_forward_stat_message(c
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status_t skinny_api_cmd_profile_device_send_display_prompt_status_message(const char *profile_name, const char *device_name, const char *display, switch_stream_handle_t *stream)
{
skinny_profile_t *profile;
if ((profile = skinny_find_profile(profile_name))) {
listener_t *listener = NULL;
skinny_profile_find_listener_by_device_name(profile, device_name, &listener);
if(listener) {
send_display_prompt_status(listener, 0, display, 0, 0);
stream->write_function(stream, "+OK\n");
} else {
stream->write_function(stream, "Listener not found!\n");
}
} else {
stream->write_function(stream, "Profile not found!\n");
}
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t skinny_api_cmd_profile_device_send_reset_message(const char *profile_name, const char *device_name, const char *reset_type, switch_stream_handle_t *stream) static switch_status_t skinny_api_cmd_profile_device_send_reset_message(const char *profile_name, const char *device_name, const char *reset_type, switch_stream_handle_t *stream)
{ {
skinny_profile_t *profile; skinny_profile_t *profile;
@ -521,6 +543,7 @@ SWITCH_STANDARD_API(skinny_function)
"skinny profile <profile_name> device <device_name> send SetSpeakerModeMessage <speaker_mode>\n" "skinny profile <profile_name> device <device_name> send SetSpeakerModeMessage <speaker_mode>\n"
"skinny profile <profile_name> device <device_name> send CallStateMessage <call_state> <line_instance> <call_id>\n" "skinny profile <profile_name> device <device_name> send CallStateMessage <call_state> <line_instance> <call_id>\n"
"skinny profile <profile_name> device <device_name> send ForwardStatMessage <number>\n" "skinny profile <profile_name> device <device_name> send ForwardStatMessage <number>\n"
"skinny profile <profile_name> device <device_name> send DisplayPromptStatus <message>\n"
"skinny profile <profile_name> device <device_name> send <UserToDeviceDataMessage|UserToDeviceDataVersion1Message> [ <param>=<value>;... ] <data>\n" "skinny profile <profile_name> device <device_name> send <UserToDeviceDataMessage|UserToDeviceDataVersion1Message> [ <param>=<value>;... ] <data>\n"
"skinny profile <profile_name> set <name> <value>\n" "skinny profile <profile_name> set <name> <value>\n"
"--------------------------------------------------------------------------------\n"; "--------------------------------------------------------------------------------\n";
@ -593,6 +616,12 @@ SWITCH_STANDARD_API(skinny_function)
status = skinny_api_cmd_profile_device_send_forward_stat_message(argv[1], argv[3], NULL, stream); status = skinny_api_cmd_profile_device_send_forward_stat_message(argv[1], argv[3], NULL, stream);
} }
break; break;
case DISPLAY_PROMPT_STATUS_MESSAGE:
if (argc == 7) {
/* DisplayPromptStatus <display> */
status = skinny_api_cmd_profile_device_send_display_prompt_status_message(argv[1], argv[3], argv[6], stream);
}
break;
case RESET_MESSAGE: case RESET_MESSAGE:
if (argc == 7) { if (argc == 7) {
/* ResetMessage <reset_type> */ /* ResetMessage <reset_type> */
@ -644,6 +673,7 @@ switch_status_t skinny_api_register(switch_loadable_module_interface_t **module_
switch_console_set_complete("add skinny profile ::skinny::list_profiles device ::skinny::list_devices send SetSpeakerModeMessage ::skinny::list_speaker_modes"); switch_console_set_complete("add skinny profile ::skinny::list_profiles device ::skinny::list_devices send SetSpeakerModeMessage ::skinny::list_speaker_modes");
switch_console_set_complete("add skinny profile ::skinny::list_profiles device ::skinny::list_devices send CallStateMessage ::skinny::list_call_states ::skinny::list_line_instances ::skinny::list_call_ids"); switch_console_set_complete("add skinny profile ::skinny::list_profiles device ::skinny::list_devices send CallStateMessage ::skinny::list_call_states ::skinny::list_line_instances ::skinny::list_call_ids");
switch_console_set_complete("add skinny profile ::skinny::list_profiles device ::skinny::list_devices send ForwardStatMessage"); switch_console_set_complete("add skinny profile ::skinny::list_profiles device ::skinny::list_devices send ForwardStatMessage");
switch_console_set_complete("add skinny profile ::skinny::list_profiles device ::skinny::list_devices send DisplayPromptStatusMessage");
switch_console_set_complete("add skinny profile ::skinny::list_profiles device ::skinny::list_devices send UserToDeviceDataMessage"); switch_console_set_complete("add skinny profile ::skinny::list_profiles device ::skinny::list_devices send UserToDeviceDataMessage");
switch_console_set_complete("add skinny profile ::skinny::list_profiles device ::skinny::list_devices send UserToDeviceDataVersion1Message"); switch_console_set_complete("add skinny profile ::skinny::list_profiles device ::skinny::list_devices send UserToDeviceDataVersion1Message");
switch_console_set_complete("add skinny profile ::skinny::list_profiles set ::skinny::list_settings"); switch_console_set_complete("add skinny profile ::skinny::list_profiles set ::skinny::list_settings");

View File

@ -212,6 +212,7 @@ SKINNY_DECLARE_STR2ID(skinny_str2ring_mode, SKINNY_RING_MODES, -1)
{SKINNY_BUTTON_LAST_NUMBER_REDIAL, "LastNumberRedial"}, {SKINNY_BUTTON_LAST_NUMBER_REDIAL, "LastNumberRedial"},
{SKINNY_BUTTON_SPEED_DIAL, "SpeedDial"}, {SKINNY_BUTTON_SPEED_DIAL, "SpeedDial"},
{SKINNY_BUTTON_HOLD, "Hold"}, {SKINNY_BUTTON_HOLD, "Hold"},
{SKINNY_BUTTON_FORWARDALL, "ForwardAll"},
{SKINNY_BUTTON_TRANSFER, "Transfer"}, {SKINNY_BUTTON_TRANSFER, "Transfer"},
{SKINNY_BUTTON_LINE, "Line"}, {SKINNY_BUTTON_LINE, "Line"},
{SKINNY_BUTTON_VOICEMAIL, "Voicemail"}, {SKINNY_BUTTON_VOICEMAIL, "Voicemail"},

View File

@ -165,13 +165,14 @@ enum skinny_button_definition {
SKINNY_BUTTON_SPEED_DIAL = 0x02, SKINNY_BUTTON_SPEED_DIAL = 0x02,
SKINNY_BUTTON_HOLD = 0x03, SKINNY_BUTTON_HOLD = 0x03,
SKINNY_BUTTON_TRANSFER = 0x04, SKINNY_BUTTON_TRANSFER = 0x04,
SKINNY_BUTTON_FORWARDALL = 0x05,
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,
}; };
extern struct skinny_table SKINNY_BUTTONS[11]; extern struct skinny_table SKINNY_BUTTONS[12];
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)