]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add send of DisplayPromptStatusMessage and ForwardAll stimulus
authorNathan Neulinger <nneul@neulinger.org>
Mon, 23 Sep 2013 18:18:00 +0000 (13:18 -0500)
committerNathan Neulinger <nneul@neulinger.org>
Mon, 23 Sep 2013 18:18:00 +0000 (13:18 -0500)
src/mod/endpoints/mod_skinny/skinny_api.c
src/mod/endpoints/mod_skinny/skinny_tables.c
src/mod/endpoints/mod_skinny/skinny_tables.h

index daebbb9385ef52b0eaa3c987f33cc2b29d065864..f4c9560352ee8df47b43673e06b2b6eb54e35987 100644 (file)
@@ -407,6 +407,28 @@ static switch_status_t skinny_api_cmd_profile_device_send_forward_stat_message(c
        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)
 {
        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 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 DisplayPromptStatus <message>\n"
                "skinny profile <profile_name> device <device_name> send <UserToDeviceDataMessage|UserToDeviceDataVersion1Message> [ <param>=<value>;... ] <data>\n"
                "skinny profile <profile_name> set <name> <value>\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);
                                }
                                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:
                                if (argc == 7) {
                                        /* 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 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 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 UserToDeviceDataVersion1Message");
        switch_console_set_complete("add skinny profile ::skinny::list_profiles set ::skinny::list_settings");
index ea29918cbbb9a21b3d4ceb329a0f5b3dd2c878e1..9c053d6b587d20a403d2b362c0993b07ff6b52da 100644 (file)
@@ -212,6 +212,7 @@ SKINNY_DECLARE_STR2ID(skinny_str2ring_mode, SKINNY_RING_MODES, -1)
                {SKINNY_BUTTON_LAST_NUMBER_REDIAL, "LastNumberRedial"},
                {SKINNY_BUTTON_SPEED_DIAL, "SpeedDial"},
                {SKINNY_BUTTON_HOLD, "Hold"},
+               {SKINNY_BUTTON_FORWARDALL, "ForwardAll"},
                {SKINNY_BUTTON_TRANSFER, "Transfer"},
                {SKINNY_BUTTON_LINE, "Line"},
                {SKINNY_BUTTON_VOICEMAIL, "Voicemail"},
index 647837f212ae9ba1bafe9fbb2a5d16933bb5e041..4fea984756bd0b62339fef742109ebc25414ebcb 100644 (file)
@@ -165,13 +165,14 @@ enum skinny_button_definition {
        SKINNY_BUTTON_SPEED_DIAL = 0x02,
        SKINNY_BUTTON_HOLD = 0x03,
        SKINNY_BUTTON_TRANSFER = 0x04,
+       SKINNY_BUTTON_FORWARDALL = 0x05,
        SKINNY_BUTTON_LINE = 0x09,
        SKINNY_BUTTON_VOICEMAIL = 0x0F,
        SKINNY_BUTTON_PRIVACY = 0x13,
        SKINNY_BUTTON_SERVICE_URL = 0x14,
        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);
 uint32_t skinny_str2button(const char *str);
 #define SKINNY_PUSH_STIMULI SKINNY_DECLARE_PUSH_MATCH(SKINNY_BUTTONS)